Ubuntu 16.04: Avoid boot delay around activating LVM swap


Table of Contents

1 Boot delay problem with mounting LVM partions

Checking printk time with dmesg, a message “EXT4-fs (dm-0): mounted filesystem with ordered data mode” has 5 seconds delay.

[ 1.126338] FDC 0 is a S82078B[ 1.830136] tsc: Refined TSC clocksource calibration: 3392.321 MHz[ 1.830140] clocksource: tsc: mask: 0xffffffffffffffff max_cycles:0x30e5f904771, max_idle_ns: 440795373543 ns[ 6.984151] EXT4-fs (dm-0): mounted filesystem with ordered data mode.Opts: (null)[ 10.421370] systemd[1]: systemd 229 running in system mode.(+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP+LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID+ELFUTILS +KMOD -IDN)[ 10.421397] systemd[1]: Detected virtualization kvm.

This is because Ubuntu 16.04 installer does not support LVM swap.

2 Solution

Change RESUME value from UUID to /dev/mapper/* in /etc/initramfs-tools/conf.d/resume and update initrd.

$ sudo su -c ‘echo RESUME=/dev/mapper/ubuntu–vg-swap_1 > /etc/initramfs-tools/conf.d/resume’$ sudo update-initramfs -u$ sudo reboot

“EXT4-fs (dm-0): mounted filesystem with ordered data mode” has no delay.

[ 1.095876] FDC 0 is a S82078B[ 1.507060] EXT4-fs (dm-0): mounted filesystem with ordered data mode.Opts: (null)[ 1.807522] tsc: Refined TSC clocksource calibration: 3392.321 MHz[ 1.807526] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x30e5f904771, max_idle_ns: 440795373543 ns[ 2.648513] systemd[1]: systemd 229 running in system mode.(+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP+LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID+ELFUTILS +KMOD -IDN)[ 2.648542] systemd[1]: Detected virtualization kvm.

Android | Linux | SDL - Narrow Escape