Siduction Forum

Siduction Forum => Hardware - Support => Topic started by: Mte90 on 2018/07/12, 12:47:18

Title: Slow mounting of SSD
Post by: Mte90 on 2018/07/12, 12:47:18
I bought a new SSD with more capacity then the previous one and copied with dd.
So after that I removed the swap partition that was on that and enlarged the partition, execute a trimmer, made an update-initramfs, update-grub, add in /etc/sysctl.conf to disable swap, an e2fsck, removed also the reference on fstab of the swap partition.The only difference that i swat that the start block on the previous ssd vas 2048 and on the new one is 2049.I was thinking that was systemd the problem on launching the system because there is like a prompt for like 30 seconds and later start systemd.
This is the output of dmesg https://pastebin.com/KJaVmSUN (https://pastebin.com/KJaVmSUN) and you can see that (apart the random issue that I saw that writing random characters on that moment of boot remove that warnings) take 33 seconds to mount my drive.
I am using the latest kernel available and I have no idea how to fix this very slow starting time.
PS: this is what journalctl -b say: https://pastebin.com/kzGHkrzp (https://pastebin.com/kzGHkrzp)
Title: Re: Slow mounting of SSD
Post by: devil on 2018/07/12, 13:45:34
Wat does
Code: [Select]
systemd-analyze blame tell you
Title: Re: Slow mounting of SSD
Post by: der_bud on 2018/07/12, 14:15:07
I notice some network activity/waiting in the logs. Do you have NetworkManager-wait-online.service enabled. If yes, does disabling that make your boot faster?
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/12, 14:28:26
Systemd-analyze blame report -> https://pastebin.com/DwUSwZU0
As I can see nothing helpful to understand why is so slow before starting systemd itself.
For network manager I am not sure but I think that is executed after the mounting of the ssd so with systemd and I have the problem that slow is before systemd starting itself.
When I boot the laptop, after the choosing of the kernel in grub I have a black screen with a blink prompt dash (where i can write stuff without any effect). after 30 seconds systemd is executed and in less of 3 seconds the operative system is ready.
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/12, 19:34:18
when was the last file system check on the ssd partitions?
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/12, 19:49:47
I made one this morning
Title: Re: Slow mounting of SSD
Post by: unklarer on 2018/07/12, 20:04:45
Quote from: Mte90
I bought a new SSD with more capacity then the previous one and copied with dd.

Quote from: Achtung
To transfer an existing system to an SSD (solid-state drive), dd should only be used with extreme caution. In the default settings, dd uses a block size of 512 bytes, which leads to unnecessary write processes with modern SSDs. If, using the parameter bs=, a block size specification corresponding to the block size or a multiple thereof of the SSD is used, this danger does not exist. Furthermore one should consider that the alignment is kept, which is most probably not the case without further parameters.
Source: (https://wiki.ubuntuusers.de/dd/)

Now the question is, what was your dd command like?
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/12, 20:14:37
Code: [Select]
dd if=/dev/sdi of=/media/mte90/ADATA/laptop.img bs=64 status=progressThe blocksize was 64
[/code]
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/12, 20:37:18
that command represents only the "backup" of the original ssd, with all partitions, etc.
personally, i find the block size to be very small for the task... i would have used bs=8M or bs=16M

i think it is quite interesting to check the command that was used to "restore" the image to the new ssd
checking with gparted the alignment of partitions after that makes sense
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/12, 21:27:03
Code: [Select]
dd if=/media/mte90/ADATA/portatile.img of=/dev/sdi bs=64 status=progressThis is the other one but I am not sure what can do the bs, probably the speed on that but now I don't think that is a big problem.
Title: Re: Slow mounting of SSD
Post by: dibl on 2018/07/12, 22:21:42
Sounds like this may be too late to help, but you can use gparted, working on the gui desktop, to copy and paste partitions from one hdd/ssd to another.  Then later you can resize the partitions on the target device, again with gparted.
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/12, 22:47:15
actually, checking the partitions with gparted (and making sure these are aligned) can still be done.
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/13, 00:03:42
I copied with dd and with gparted enlarged the partition so I already made that step.
Title: Re: Slow mounting of SSD
Post by: unklarer on 2018/07/13, 12:06:35
Did you also check the alignment (of all partitions)?
Code: [Select]
# parted /dev/sda align-check opt
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/13, 12:36:02
Report that is not aligned :-/
Checking how to fix that
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/13, 14:26:00
I saw that I have 2 non-allocated space before and after the unique partition, so with gparted I moved everything to remove the first non-allocated and fixed the alignment to cylinders (because before was MiB) but the problem persist.Now the first sector is 63.
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/13, 21:46:12
please paste the output of    fdisk -l

watch the alignment / start of the sda1 partition

Code: [Select]
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 981D877E-5AA9-4835-9EB1-22AB2CFEFA0E

Device        Start       End   Sectors   Size Type
/dev/sda1      2048  67106815  67104768    32G Linux filesystem
/dev/sda2  67106816  75499519   8392704     4G Linux swap
/dev/sda3  75499520 976773119 901273600 429,8G Linux filesystem
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/13, 21:56:22
Code: [Select]
Disk /dev/sda: 223,6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x489f2e91

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1  *       63 468857024 468856962 223,6G 83 Linux
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/13, 23:19:11
please re-align the partitions using gparted (or other tool) to 2048. this is actually the new default value since some time already.
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/13, 23:20:15
before was 2049 but there was the problem so I tried changing the sectors.
Title: Re: Slow mounting of SSD
Post by: absolut on 2018/07/14, 09:13:47
a partition starting with 63 or 2049 is not aligned
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/14, 11:39:34
How I can align it? On internet I didn't find a tutorial or a tool for that.The old ssd has sector 2049 and didn't have this problems
Title: Re: Slow mounting of SSD
Post by: unklarer on 2018/07/14, 13:29:20
For repair of the alignment
My level of knowledge is (I am not all-knowing), it is extensive.   ???  Therefore it is first to consider whether it is not easier to repeat the copying of the plates with gparted (on the again virgin ssd)

I also assume that the old original of sda1 still exists as a backup   ;)

They need:
1. a siduction-live with gparted and parted (some experience with handling is recommended)

Warning: It is extremely important to always select "Align to NOTHING"(Ausrichten an Nichts) in the following operations!
I only found a German manual. (https://www.pc-experience.de/wbb2/thread.php?threadid=30748) The relevant part for Linux starts at: "Get to work."(An die Arbeit)

If the described operations are successful, the siduction will not start on restart. Therefore, the installation of the grub would also have to be rearranged from Live.   :D
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/14, 14:30:23
I already done that with alignment to Cylinder instead MiB for that reason now the first one is 63 as sector.I can try with nothing as alignment but gparted enable to change the alignment if I resize/enlarge a partition and I don't have anymore space for that.
Title: Re: Slow mounting of SSD
Post by: der_bud on 2018/07/14, 16:08:39
Changing gparted back to use MiB should do it, because gparted then normally starts after the first MiB. And arithmetically, the first Mebibyte of a disk contains the sectors 0-2047 (given the sector size is the usual 512 bytes)
It should look like this: https://media-cdn.ubuntu-de.org/wiki/attachments/05/21/ssd-gparted.png
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/16, 13:10:48
Yes is that view and now the sector is 63.I will probably do a new copy with dd of the old ssd and see if the problem happen again.
Title: Re: Slow mounting of SSD
Post by: unklarer on 2018/07/16, 13:36:45
Quote from: Mte90
Yes is that view and now the sector is 63.I will probably do a new copy with dd of the old ssd and see if the problem happen again.

Unfortunately, he doesn't understand what we keep telling him...
Of course, with dd the problem will persist again with 63.
Title: Re: Slow mounting of SSD
Post by: Mte90 on 2018/07/16, 17:59:32
I made a new copy with dd, didn't removed the swap and enlarged the partition and now there are no problems.