我刚刚安装了 Debian,另一个分区上有 ubuntu 18.04.2。以前 ubuntu 加载需要 40 秒左右,但现在需要将近 3 分钟。我的 dim(80 年的记忆)告诉我,交换分区的 uuid 可以通过新安装更改,现有安装在启动期间可能需要很长时间才能解决这个问题。如果这是原因,我可以纠正它吗?如果不是原因,我该怎么办?
根据请求:
john@john-OptiPlex-780:~$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
graphical.target @1min 57.402s
└─multi-user.target @1min 57.402s
└─kerneloops.service @1min 40.283s +11ms
└─network-online.target @1min 40.281s
└─NetworkManager-wait-online.service @1min 35.377s +4.903s
└─NetworkManager.service @1min 31.866s +3.509s
└─dbus.service @1min 31.776s
└─basic.target @1min 31.772s
└─sockets.target @1min 31.772s
└─snapd.socket @1min 31.770s +1ms
└─sysinit.target @1min 31.754s
└─cryptsetup.target @15.948s
└─systemd-ask-password-wall.path @1.660s
└─-.mount @1.657s
└─system.slice @1.660s
└─-.slice @1.657s
john@john-OptiPlex-780:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda7 during installation
UUID=f68d7190-f844-4236-af0c-8ca058df937e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=19be91fa-9600-4851-896b-64ffc12bb07e none swap sw 0 0
john@john-OptiPlex-780:~$ blkid
sudo bklid 生成:
john@john-OptiPlex-780:~$ sudo blkid
[sudo] password for john:
/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/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: UUID="5ACCB5047A8E203D" TYPE="ntfs" PARTUUID="abd411b6-01"
/dev/sda5: UUID="2921846b-0788-49e4-b81e-0afb576dd1a7" TYPE="swap" PARTUUID="abd411b6-05"
/dev/sda6: UUID="76EBD1DC0B897C49" TYPE="ntfs" PTTYPE="dos" PARTUUID="abd411b6-06"
/dev/sda7: UUID="f68d7190-f844-4236-af0c-8ca058df937e" TYPE="ext4" PARTUUID="abd411b6-07"
/dev/sda8: UUID="0db17b41-cb8f-4f6e-9016-657ca5ba0590" TYPE="ext4" PARTUUID="abd411b6-08"
/dev/sda9: UUID="c246fcaa-bedd-4162-a30d-d0762b7fd968" TYPE="ext4" PARTUUID="abd411b6-09"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/loop13: TYPE="squashfs"
/dev/loop14: TYPE="squashfs"
/dev/loop15: TYPE="squashfs"
答案1
同一个分区被用作两个发行版的交换空间 - 在安装第二个发行版期间,分区的 UUID 发生了变化。
为了解决这个问题,您需要复制 /dev/sda5 输出中显示的 UUID blkid
,并将该信息放入 /etc/fstab 中,位于命令“# swap was on ...”下面的行中
为了做到这一点,我会
- 打开两个终端窗口
- 在第一个窗口中输入命令
blkid | grep sda5
- 在第二个窗口中输入命令
sudo cp /etc/fstab /etc/fstab.bak
- 在第二个窗口中输入命令
sudo nano /etc/fstab
- 在第一个窗口中,突出显示组成 UUID 的数字:“2921846b-0788-49e4-b81e-0afb576dd1a7” - 按++ctrl复制UUIDshiftc
- 在第二个窗口中,使用箭头键将光标移动到坏的 uuid,然后使用 delete/backspace 键删除该 uuid。
- 按ctrl++将新的 UUID 粘贴到位。按shift+然后按 +保存并退出编辑器。vctrloctrlx