How may I improve my boot / shutdown time?

Solution 1:

Ok, I have found the problem. As I was feeling, the 5 seconds waiting on resume and wait-for-root is not normal.

Googling around, I finally found this bug report: 5 second delay on wait-for-root

Essentially, it states that the 5 secs wait is due to a wrong entry in /etc/initramfs-tools/conf.d/resume.

It turns out that my swap is encrypted, and I had the initial installation UUID in /etc/initramfs-tools/conf.d/resume. I tried to put the one given by blkid for /dev/mapper/cryptswap1, but it didn't work...

I finally just commented out the entry in the file, and the 5 seconds delay is gone. Any way, hibernate is not enabled on my system (I think it is disabled by default in Ubuntu). Notice the # at the beginning of the entry.

#RESUME=UUID=3835540d-0cb4-46fc-b39a-de9ff88dcefd

then run:

sudo update-initramfs -u

So here is my latest bootchart:

bootchart

Much better. Regarding shutdown, removing rpcbind and modemmanager did the trick. I now have great boot and shutdown times.