ParrotSecurity 4.2: Slow boot problem when using LVM

If you install ParrotSecurity 4.2 with LVM, slow boot problem happens. This article will describe a way to avoid this problem. If you install ParrotSecurity 4.2 without LVM, this problem does not happen.

1 Slow boot problem when using LVM

systemd-analyze shows that kernel boot time takes a lot of time.

$ systemd-analyze
Startup finished in 34.683s (kernel) + 2.507s (userspace) = 37.191s
graphical.target reached after 2.470s in userspace

2 Avoid slow boot problem when using LVM

Assign device file path of LVM swap partition to RESUME. This is the same with /etc/initramfs-tools/conf.d/resume in Debian 9.

#!/bin/sh -e


RESUME=$(sudo lvscan -q | awk '{ print $2 }' | \
           sed -e "s/^'//g" -e "s/'$//g" | grep '/swap_1$')
sudo sed -e 's/^RESUME=/#RESUME=/g' \
     -i /etc/initramfs-tools/conf.d/resume
echo "RESUME=${RESUME}" | sudo tee -a /etc/initramfs-tools/conf.d/resume
sudo update-initramfs -u
sudo reboot

Kernel boot time is faster and you can use hibernation.

$ systemd-analyze
Startup finished in 2.622s (kernel) + 2.413s (userspace) = 5.035s
graphical.target reached after 2.382s in userspace