不久前,我在计算机中安装了新的 NVME 驱动器并在其上安装了 Windows。我从旧的 SSD 中删除了旧的 Windows 安装,以便我的 Linux 安装可以使用所有它。然后,我将 Linux 根分区移动到左侧,并将其扩展以填充 Windows 之前使用的空间。我还将一些文件从 NVME 上的 EFI 分区复制到 SSD,以便能够使用 systemd-boot。
现在问题来了:完成此操作后,Linux 需要很长时间才能启动(Windows 工作正常)。这是以下的输出systemd-analyze
:
Startup finished in 18.338s (firmware) + 1.492s (loader) + 4.869s (kernel) + 1min 34.689s (userspace) = 1min 59.389s
graphical.target reached after 1min 34.684s in userspace
systemd-analyze blame
:
4.745s dev-sda6.device
4.291s plymouth-quit-wait.service
898ms mysql.service
740ms snapd.service
665ms systemd-logind.service
535ms accounts-daemon.service
517ms networkd-dispatcher.service
323ms udisks2.service
257ms system76-power.service
220ms snap-snapd-10492.mount
216ms fwupd.service
210ms dev-loop0.device
208ms snap-flutter-40.mount
199ms systemd-journal-flush.service
182ms snap-core18-1944.mount
177ms snap-snapd-10238.mount
167ms ModemManager.service
144ms snap-flutter-36.mount
138ms teamviewerd.service
137ms polkit.service
136ms dev-loop1.device
135ms avahi-daemon.service
134ms NetworkManager.service
126ms systemd-resolved.service
123ms switcheroo-control.service
117ms thermald.service
116ms wpa_supplicant.service
116ms systemd-machined.service
115ms systemd-modules-load.service
114ms upower.service
111ms snap-core18-1932.mount
107ms systemd-timesyncd.service
99ms [email protected]
97ms lvm2-monitor.service
95ms dev-loop2.device
94ms dev-loop3.device
84ms apparmor.service
77ms gdm.service
77ms gpu-manager.service
61ms systemd-udevd.service
60ms systemd-journald.service
55ms colord.service
55ms systemd-udev-trigger.service
52ms rsyslog.service
50ms dev-loop4.device
49ms libvirtd.service
47ms apport.service
42ms keyboard-setup.service
37ms update-notifier-download.service
32ms e2scrub_reap.service
32ms dev-disk-by\x2duuid-ebb2d3f4\x2d5518\x2d4c00\x2d9298\x2dfb3a4b774f78.swap
32ms qemu-kvm.service
29ms plymouth-start.service
28ms networking.service
24ms lm-sensors.service
22ms dev-loop5.device
20ms systemd-fsck@dev-disk-by\x2duuid-9d66c204\x2dfe76\x2d4fcb\x2d8ca3\x2d27acc6c41576.service
20ms snapd.seeded.service
18ms home.mount
16ms alsa-restore.service
14ms snapd.apparmor.service
14ms systemd-tmpfiles-setup.service
14ms systemd-sysctl.service
12ms resolvconf-pull-resolved.service
12ms [email protected]
11ms plymouth-read-write.service
11ms systemd-sysusers.service
11ms nvidia-persistenced.service
10ms pppd-dns.service
9ms dev-hugepages.mount
9ms dev-mqueue.mount
9ms systemd-random-seed.service
9ms libvirt-guests.service
8ms sys-kernel-debug.mount
8ms sys-kernel-tracing.mount
8ms systemd-tmpfiles-clean.service
7ms blk-availability.service
6ms systemd-tmpfiles-setup-dev.service
6ms systemd-update-utmp.service
6ms systemd-remount-fs.service
6ms boot-efi.mount
6ms kmod-static-nodes.service
6ms [email protected]
5ms hddtemp.service
5ms sys-fs-fuse-connections.mount
4ms systemd-user-sessions.service
4ms tmp.mount
4ms sys-kernel-config.mount
3ms ufw.service
3ms rtkit-daemon.service
3ms systemd-update-utmp-runlevel.service
2ms console-setup.service
2ms finalrd.service
2ms ifupdown-pre.service
1ms setvtrgb.service
955us libvirtd.socket
560us snapd.socket
systemd-analyze critical-chain
:
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @1min 34.684s
└─multi-user.target @1min 34.684s
└─plymouth-quit-wait.service @1min 30.392s +4.291s
└─systemd-user-sessions.service @1min 30.385s +4ms
└─network.target @1min 30.380s
└─NetworkManager.service @1min 30.245s +134ms
└─dbus.service @1min 30.243s
└─basic.target @1min 30.239s
└─sockets.target @1min 30.239s
└─libvirtd-ro.socket @1min 30.239s
└─libvirtd.socket @1min 30.238s +955us
└─sysinit.target @1min 30.233s
└─systemd-timesyncd.service @5.040s +107ms
└─systemd-tmpfiles-setup.service @5.024s +14ms
└─local-fs.target @5.021s
└─home.mount @5.002s +18ms
└─systemd-fsck@dev-disk-by\x2duuid-9d66c204\x2dfe76\x2d4fcb\x2d8ca3\x2d27acc6c41576.service @4.981s +20ms
└─dev-disk-by\x2duuid-9d66c204\x2dfe76\x2d4fcb\x2d8ca3\x2d27acc6c41576.device @4.973s
我没有看到任何内容,blame
或者critical-chain
需要花费异常长的时间,但是boot.log
从上次启动来看,我看到以下内容:
[ OK ] Finished Tell Plymouth To Write Out Runtime Data.
[ OK ] Finished Create Volatile Files and Directories.
Starting Network Name Resolution...
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Finished Update UTMP about System Boot/Shutdown.
[ OK ] Finished QEMU KVM preparation - module, ksm, hugepages.
[ OK ] Finished Load AppArmor profiles.
Starting Raise network interfaces...
Starting Load AppArmor pro…managed internally by snapd...
[ OK ] Finished Load AppArmor pro…s managed internally by snapd.
[ OK ] Finished Raise network interfaces.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ OK ] Started Network Name Resolution.
[ OK ] Reached target Host and Network Name Lookups.
[ TIME ] Timed out waiting for device -1259-4770-ba01-32b86790a561.
[DEPEND] Dependency failed for Cryptography Setup for cryptswap.
[DEPEND] Dependency failed for Local Encrypted Volumes.
[ OK ] Reached target Block Devic…ion for /dev/mapper/cryptswap.
[ OK ] Reached target System Initialization.
[ OK ] Started ACPI Events Check.
[ OK ] Started CUPS Scheduler.
[ OK ] Started resolvconf-pull-resolved.path.
[ OK ] Started Daily apt download activities.
[ OK ] Started Daily apt upgrade and clean activities.
[ OK ] Started Periodic ext4 Onli…ata Check for All Filesystems.
[ OK ] Started Discard unused blocks once a week.
[ OK ] Started Refresh fwupd metadata regularly.
[ OK ] Started Daily rotation of log files.
[ OK ] Started Daily man-db regeneration.
[ OK ] Started Message of the Day.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Paths.
[ OK ] Listening on ACPID Listen Socket.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on CUPS Scheduler.
[ OK ] Listening on D-Bus System Message Bus Socket.
Starting Libvirt local socket.
Starting Socket activation for snappy daemon.
[ OK ] Listening on UUID daemon activation socket.
[ OK ] Listening on Virtual machine lock manager socket.
[ OK ] Listening on Virtual machine lock manager admin socket.
[ OK ] Listening on Virtual machine log manager socket.
[ OK ] Listening on Virtual machine log manager socket.
[ OK ] Listening on Libvirt local socket.
[ OK ] Listening on Socket activation for snappy daemon.
[ OK ] Stopped target Block Devic…ion for /dev/mapper/cryptswap.
[ OK ] Listening on Libvirt admin socket.
[ OK ] Listening on Libvirt local read-only socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
Starting Accounts Service...
[ OK ] Started ACPI event daemon.
Starting LSB: automatic crash report generation...
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started Regular background program processing daemon.
[ OK ] Started CUPS Scheduler.
[ OK ] Reached target Printer.
[ OK ] Started D-Bus System Message Bus.
Starting Network Manager...
[ OK ] Started Save initial kernel messages after boot.
Starting Remove Stale Onli…t4 Metadata Check Snapshots...
[ OK ] Reached target Login Prompts.
Starting Detect the availa…eal with any system changes...
[ OK ] Started irqbalance daemon.
Starting Initialize hardware monitoring sensors...
Starting Dispatcher daemon for systemd-networkd...
Starting NVIDIA Persistence Daemon...
Starting Authorization Manager...
[ OK ] Started Pop Upgrade Daemon.
Starting Restore /etc/reso… the ppp link was shut down...
Starting resolvconf-pull-resolved.service...
Starting System Logging Service...
Starting Snap Daemon...
Starting Switcheroo Control Proxy service...
Starting System76 Power Daemon...
Starting User Login Management...
Starting Virtual Machine a…tainer Registration Service...
Starting Thermal Daemon Service...
Starting Disk Manager...
Starting WPA supplicant...
[ OK ] Started NVIDIA Persistence Daemon.
[ OK ] Finished Restore /etc/reso…re the ppp link was shut down.
[ OK ] Finished Initialize hardware monitoring sensors.
[ OK ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots.
[ OK ] Started LSB: automatic crash report generation.
[ OK ] Finished resolvconf-pull-resolved.service.
[ OK ] Started System Logging Service.
[ OK ] Finished Detect the availa… deal with any system changes.
[ OK ] Started Virtual Machine an…ontainer Registration Service.
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Started WPA supplicant.
[ OK ] Started Thermal Daemon Service.
[ OK ] Started Make remote CUPS printers available locally.
[ OK ] Started Switcheroo Control Proxy service.
[ OK ] Started Network Manager.
[ OK ] Reached target Network.
[ OK ] Reached target Network is Online.
[ OK ] Started Download data for …ailed at package install time.
[ OK ] Started Check to see wheth…w version of Ubuntu available.
[ OK ] Reached target Timers.
Starting Save/Restore Sound Card State...
Starting Manage, Install and Generate Color Profiles...
Starting LSB: disk temperature monitoring daemon...
Starting MySQL Community Server...
[ OK ] Started Private Internet Access daemon.
Starting Permit User Sessions...
Starting TeamViewer remote control daemon...
[ OK ] Started LSB: disk temperature monitoring daemon.
[ OK ] Started Authorization Manager.
[ OK ] Finished Permit User Sessions.
Starting Modem Manager...
Starting GNOME Display Manager...
Starting Hold until boot process finishes up...
Starting Hostname Service...
[ OK ] Finished Save/Restore Sound Card State.
[ OK ] Reached target Sound Card.
[ OK ] Started Manage, Install and Generate Color Profiles.
[ OK ] Started Hostname Service.
[ OK ] Started GNOME Display Manager.
我怀疑这一行可能与该问题有关:
[ TIME ] Timed out waiting for device -1259-4770-ba01-32b86790a561.
该设备看起来像 UUID 的末尾,所以我怀疑我的fstab file
:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=de390d43-ceed-4756-82f9-e2af6908cb03 /tmp ext4 noatime,errors=remount-ro 0 0
PARTUUID=c45be408-0645-4676-ad10-2faa239a802b /boot/efi vfat umask=0077 0 0
UUID=ebb2d3f4-5518-4c00-9298-fb3a4b774f78 none swap defaults 0 0
UUID=a4a8fe1d-5017-4fed-9397-7c6463fe5d04 / ext4 errors=remount-ro 0 0
UUID=9d66c204-fe76-4fcb-8ca3-27acc6c41576 /home ext4 defaults 0 2
但没有 UUID 与产生错误的 UUID 相匹配,并且该 ID 也不在sudo blkid
以下任一命令的输出中:
/dev/sda6: UUID="a4a8fe1d-5017-4fed-9397-7c6463fe5d04" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6dd08769-eae4-4a5a-a17c-776806c8c2d9"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/nvme0n1p1: LABEL="SYSTEM" UUID="E6F4-51CF" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="M-dM-.M-.&" PARTUUID="cd2c4c5d-221d-425e-8125-db5e97aaf98b"
/dev/nvme0n1p2: BLOCK_SIZE="512" UUID="AEC02A49C02A17DB" TYPE="ntfs" PARTLABEL="[hmg checkos]:File not exist! filena" PARTUUID="9a34299d-bc2b-4ee5-8ca3-ef51c8662cf1"
/dev/sda1: UUID="ebb2d3f4-5518-4c00-9298-fb3a4b774f78" TYPE="swap" PARTUUID="b719b11d-e8b4-4232-b4a3-7ebb2884ca17"
/dev/sda2: LABEL="SYSTEM" UUID="E6F4-51CF" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="SYSTEM" PARTUUID="c45be408-0645-4676-ad10-2faa239a802b"
/dev/sda3: UUID="9d66c204-fe76-4fcb-8ca3-27acc6c41576" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="1b7287d0-725b-49f2-ab58-3cfb09eb349f"
/dev/sda4: UUID="de390d43-ceed-4756-82f9-e2af6908cb03" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c6e2143d-3bc0-4c80-945e-fa7945933473"
/dev/sdb1: UUID="fb34963c-9b6d-42ca-acfb-1603eb003306" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7fabbbe5-86c1-4b9d-be33-72b6fd1ac345"
/dev/sdc2: LABEL="Data" BLOCK_SIZE="512" UUID="A2038F931B0424E6" TYPE="ntfs"
所以现在我不知道我应该如何继续。我还尝试过在拔掉除一个屏幕(包括 NVME 驱动器)之外的所有外围设备的情况下启动。
答案1
您可能会像我一样发现该boot-repair
实用程序对此非常有用。
它使用系统工具、、、、fdisk
目录来发现所有分区并诊断所有标签;以及 GRUB 来识别可从中引导的操作系统。parted
lsblk
blkid
/dev/disk
os-prober