Ubuntu(Xubuntu)断电后无法启动

Ubuntu(Xubuntu)断电后无法启动

我安装了 Xubuntu,并在 LVM 设置中配置了 sda。以前,我使用较旧的标准分区,其中 root、/boot 和 swap 都位于单独的 sda1、2、3 上。我似乎总是遇到断电后无法启动的问题,我学会了启动到恢复模式和 fsck,这已经可靠地解决了问题(旁白:为什么文件系统恢复不是更自引导的,也许是在系统在启动时发现问题时提示?)。

然而,两天前我切换到 LVM 以来第一次断电(旧驱动器通过 SMART 报告即将发生故障,因此购买了新的 HD)。

如果它尝试正常启动,屏幕就会变黑,并且保持这种状态。

我启动恢复系统,并能得到 Busybox/initramfs 受限提示。它报告“正在等待根文件系统”,然后“放弃等待根文件系统”。它提供了一些提示,表明启动参数可能不正确(这些提示在此安装中已经工作了好几个月),但也指出“警告!/dev/mapper/xubuntu--vg-root 不存在。转到 shell!”

我遵循了我在 askubuntu 其他地方找到的建议,包括在 initramfs shell 中 ls dev,如果我没有看到文件系统,请等待 10 秒并重试。有人建议 RAID 设置可能有问题,或者设置安装了双启动和 wubi。这些都不适用。

从 LiveCD 启动后,我可以挂载并读取硬盘的内容。我已阅读使用 lvm 工具获取信息的建议,并将发布以下内容。我怀疑我需要修复 LVM 配置的文件系统中的错误。

ubuntu@ubuntu:~$ sudo lvm pvscan
  PV /dev/sda1   VG xubuntu-vg      lvm2 [<465.76 GiB / 4.00 MiB free]
  Total: 1 [<465.76 GiB] / in use: 1 [<465.76 GiB] / in no VG: 0 [0   ]

ubuntu@ubuntu:~$ sudo lvm vgscan
  Reading volume groups from cache.
  Found volume group "xubuntu-vg" using metadata type lvm2

ubuntu@ubuntu:~$ sudo lvm lvscan
  ACTIVE            '/dev/xubuntu-vg/root' [464.80 GiB] inherit
  ACTIVE            '/dev/xubuntu-vg/swap_1' [976.00 MiB] inherit

我不太确定接下来要做什么,因此尝试 fsck xubuntu-vg 根目录似乎是合理的。

ubuntu@ubuntu:~$ sudo fsck /dev/xubuntu-vg/root
fsck from util-linux 2.32
e2fsck 1.44.4 (18-Aug-2018)
/dev/mapper/xubuntu--vg-root: clean, 538363/30466048 files, 48101510/121844736 blocks

看起来那里没有问题。或者我做的事情不正确。

对于我遗漏的内容,您有什么建议吗?谢谢!

[更新信息]

出差回来后,看到没有推荐,有点难过。但我喝完早间咖啡后花了一些时间重新研究了这个问题。

我回顾了之前采取的步骤,发现当我执行时fsck /dev/xubuntu-vg/root,我正在查看实时会话的挂载。而不是我的硬盘。所以这解释了很多。我想我会在这里说明我所做的事情,如果其他人发现这个帖子并且它可能对他们有用...

当我挂载硬盘(在 GUI 文件浏览器中单击它)时,执行 mount 命令时会出现:/dev/mapper/xubuntu--vg-root on /media/ubuntu/1d3ca2dc-c59a-4582-a538-8c529926b276 type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)因此,当我尝试对其进行 fdisk 时,我得到:

sudo fdisk /dev/mapper/xubuntu--vg-root
Welcome to fdisk (util-linux 2.32).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The old ext4 signature will be removed by a write command.

Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x5490643a.

Command (m for help):

我非常担心我将删除旧的 ext4 签名的警告!

[最新更新]

继续做了

sudo fsck -f /dev/mapper/xubuntu--vg-root 
fsck from util-linux 2.32
e2fsck 1.44.4 (18-Aug-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/xubuntu--vg-root: 538364/30466048 files (0.3% non-contiguous), 48101511/121844736 blocks

它没有报告此 lvm 文件系统的任何错误。但是,它仍然无法启动。

我也怀疑我在自言自语。可以修复,因为我从 LiveCD 启动时可以读取硬盘文件系统。还尝试了一些 lvm 工具,sudo vgchange --ignorelockingfailure -ay然后sudo lvscan --ignorelockingfailure,然后重新尝试了sudo fsck -f /dev/mapper/xubuntu--vg-root网页推荐的。

没有成功。

相关内容