Boot much slower after partition resize

12,071

Solution 1

Problem solved! Because I moved the swap partition, it had changed UUID. The mismatch in fstab caused the delay, it seems. Found the answer here: Very slow boot with Ubuntu 15.04

Solution 2

One possible cause may be incorrect partition alignment.

Proper partition alignment is essential for optimal performance and longevity. This is due to the block nature of every I/O operation on the hardware level as well as file system level. The key to alignment is partitioning to (at least) the given block size, which depends on the used hardware. If the partitions are not aligned to begin at multiples of the block size, aligning the file system is a pointless exercise because everything is skewed by the start offset of the partition.

Solid state drives are based on flash memory, and thus differ significantly from hard drives. While reading remains possible in a random access fashion, erasure (hence rewriting and random writing) is possible only by whole blocks. Additionally, the erase block size (EBS) are significantly greater than regular block size, for example 128KiB vs. 4KiB, so it is necessary to align to multiples of EBS.

(from ArchLinux wiki)

To verify a partition is aligned, query it using /usr/bin/blockdev as shown below, if a '0' is returned, the partition is aligned:

sudo blockdev --getalignoff /dev/<partition>
Share:
12,071

Related videos on Youtube

spookypeanut
Author by

spookypeanut

Pipeline developer in Visual Effects

Updated on September 18, 2022

Comments

  • spookypeanut
    spookypeanut over 1 year

    I'm on Xubuntu 15.04. I have been running quite happily for several months on a 250GB SSD: <5s boot time. I just swapped to a 500GB SSD (same brand, slightly different model). After initial cloning using CloneZilla (ie all partitions identical sizes), everything was fine. However, after resizing the home partition (and moving the swap), the machine takes about a minute to boot. Not just first boot either, also on second.

    Any ideas on what could cause this? And more importantly how I can fix it? Or even just links on debugging the boot process, I've never had cause to do it before.

    EDIT: I'm wondering now if the boot slowness is unrelated. Looking at dmesg, this is the context of the long wait, and it looks like it could be network related:

    [    7.107228] audit: type=1400 audit(1435867488.135:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince" pid=501 comm="apparmor_parser"
    [    7.107245] audit: type=1400 audit(1435867488.135:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="sanitized_helper" pid=501 comm="apparmor_parser"
    [    7.107248] audit: type=1400 audit(1435867488.135:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince-previewer" pid=501 comm="apparmor_parser"
    [   97.089574] r8169 0000:03:00.1 eth0: link down
    [   97.091147] iwlwifi 0000:02:00.0: L1 Enabled - LTR Disabled
    [   97.098628] iwlwifi 0000:02:00.0: Radio type=0x0-0x0-0x3
    

    Looks to me like a 90s wait for the network :-(

  • spookypeanut
    spookypeanut almost 9 years
    All 0s I'm afraid. But thanks for the answer!
  • alvaropgl
    alvaropgl about 6 years
    love you. saved me a lot of time ;)
  • Admin
    Admin almost 2 years
    Your point 3 was essential to restore my original boot time, but a missing additional step is: sudo update-initramfs -u
  • Admin
    Admin almost 2 years
    Thanks typ1232. I'm not sure since it's more than a year. Maybe it doesn't necessary if reboot machine straight way. Anyway, good to know that!