一段时间以来,我的启动过程花费了太长时间(将近1分钟)。
systemd-analyse time
表明内核耗时35.765s
看一下dmesg
,问题似乎出在挂载文件系统上:
...
[ 2.186084] sdb: sdb1 sdb9
[ 2.186919] sd 2:0:0:0: [sdb] supports TCG Opal
[ 2.186922] sd 2:0:0:0: [sdb] Attached SCSI disk
[ 2.499795] ata5: SATA link down (SStatus 0 SControl 300)
[ 2.844320] clocksource: Switched to clocksource tsc
[ 35.670493] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 35.782128] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 35.803610] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
...
我的/etc/fstab
样子是这样的:
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=3996-2381 /boot/efi vfat umask=0077 0 1
#/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
我该如何解决?
编辑:仔细查看启动消息(删除grub中的quiet选项后),我发现了一条可疑行:
gave up waiting for suspend/resume device
我认为我的交换已加密,并且我也认为UUID /etc/initramfs/conf.d/resume
与任何设备都不对应。
我应该禁用简历/暂停吗?以及如何做到这一点?