Ubuntu 无法启动,进入 initramfs。我正在从 Live CD 试用会话中进行写入。我该怎么办?
我理解启动流程有问题,当要将来自根目录的文件加载到 RAM 中时,它找不到根目录中的文件。如果我错了,请纠正我。
以下是我输入“ exit
”命令时 ashell 的输出:
(initramfs) exit
/dev/mapper/ubuntu--vg-root contains a file system with errors, check forced.
Inodes that were part of a corrupted orphan linked list found.
/dev/mapper/ubuntu-vg-root: UNEXPECTED INCONSISTENCY; Run fsck MANUALLY.
(i.e., without -a or -p options)
fsck exited with status code 4.
The root file system on /dev/mapper/ubuntu--vg-root requires manual fsck
答案1
执行:
(initramfs) fsck /dev/mapper/ubuntu--vg-root
对所有“修复?”提示选择“y”
注意,你的根分区可能不是/dev/mapper/ubuntu--vg-root
- 修改此部分以适合你的启动分区的位置
答案2
看来您的超级块有问题。要修复此问题,请按照以下步骤操作:
步骤1:启动到实时 CD 或 USB 并选择尝试不安装选项的 ubuntu
第2步:按下ctrl+alt+t
或打开你的终端
步骤3:
使用以下方法找出分区号
sudo fdisk -l|grep Linux|grep -Ev 'swap'
然后,使用以下命令列出所有超级块:
sudo dumpe2fs /dev/sda7 | grep superblock
将 sda7 替换为您的驱动器号
你应该得到类似的输出
Primary superblock at 0, Group descriptors at 1-6
Backup superblock at 32768, Group descriptors at 32769-32774
Backup superblock at 98304, Group descriptors at 98305-98310
Backup superblock at 163840, Group descriptors at 163841-163846
Backup superblock at 229376, Group descriptors at 229377-229382
Backup superblock at 294912, Group descriptors at 294913-294918
Backup superblock at 819200, Group descriptors at 819201-819206
Backup superblock at 884736, Group descriptors at 884737-884742
Backup superblock at 1605632, Group descriptors at 1605633-1605638
Backup superblock at 2654208, Group descriptors at 2654209-2654214
Backup superblock at 4096000, Group descriptors at 4096001-4096006
Backup superblock at 7962624, Group descriptors at 7962625-7962630
Backup superblock at 11239424, Group descriptors at 11239425-11239430
Backup superblock at 20480000, Group descriptors at 20480001-20480006
Backup superblock at 23887872, Group descriptors at 23887873-23887878
从此列表中选择一个备用超级块,对于此例,备用超级块#32768
现在,使用备用超级块#32768 检查并修复 Linux 文件系统:
sudo fsck -b 32768 /dev/sda7 -y
该-y
标志用于跳过所有使固定?并自动回答所有问题
您应该获得类似这样的输出:
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda2 was not cleanly unmounted, check forced.
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
Free blocks count wrong for group #241 (32254, counted=32253).
Fix? yes
Free blocks count wrong for group #362 (32254, counted=32248).
Fix? yes
Free blocks count wrong for group #368 (32254, counted=27774).
Fix? yes
..........
/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 59586/30539776 files (0.6% non-contiguous), 3604682/61059048 blocks
现在尝试挂载分区
sudo mount /dev/sda7 /mnt
现在,尝试使用以下命令浏览文件系统
cd /mnt
sudo mkdir test
ls -l
如果您能够执行上述命令,那么您很可能已经解决了您的问题。
现在,重新启动计算机,您应该能够正常启动。
(来源)
答案3
很简单!自从上次以来,你的 FS 发生了一些变化,那么必须检查并更正,请执行以下操作:
- 首先你需要知道你的系统安装的分区:例如 /dev/sda1
当您进入 initramfs 屏幕时,输入以下内容:
e2fsck -f -y -v -C 0 /dev/sdaX
请记住,/dev/sdaX 必须更改为系统安装分区