引导下降到(initramfs)提示/ busybox
我正在运行HP展馆dv6000双启动win7和Ubuntu 12.04。 (好吧,直到今天)。 重新启动后,启动过程将下降到BusyBox shell,我最终会出现提示:
BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs)
我一直在研究那些遇到同样问题的人,但却找不到任何适合我的解决方案。
我尝试了这里描述的方法,在最后的命令mount -t ntfs-3g /dev/sda1 /root -o force
它什么也没做,给了我另一个(initramfs)提示符。
我可以启动到现场CD(USB)并进入一个终端,但它似乎没有太大的好处,因为我可以在ls命令中看到/ dev / sda1,但它不能识别它当我尝试cd到它。
还有一个问题:使用命令fdisk -l
如何判断哪个挂载点(sda1 / sda2)是我的Windows分区,哪一个是Ubuntu?
在initramfs控制台,我传递了一个命令出口来自shell。 在我之前呈现了相同的控制台,但这次是使用已损坏的分区的确切名称 。
BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) exit /dev/mapper/ubuntu--vg-root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (ie, without -a or -p options) fsck exited with status code 4. The root filesystem on /dev/mapper/ubuntu--vg-root requires a manual fsck. BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) fsck /dev/mapper/ubuntu--vg-root -y fsck from util-linux 2.27.1 e2fsck 1.42.13 (17-May-2015) /dev/mapper/ubuntu--vg-root contains a file system with errors, check forced.
检查完成后,我重新启动了系统。
BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) reboot
就是这样,我重新进入文件系统没有任何错误。
看来你有一个糟糕的超级块。 解决这个问题:
首先,启动到现场CD或USB
通过使用找出您的分区号
sudo fdisk -l|grep Linux|grep -Ev 'swap'
然后,使用以下命令列出所有超级块:
sudo dumpe2fs /dev/sda2 | grep superblock
将sda2
替换为您的驱动器号
你应该得到类似的输出
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/sda2 -y
-y
标志用于跳过所有Fix?
问题并自动回答所有问题
您应该获得类似的输出:
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/sda2 /mnt
现在,尝试使用以下命令浏览文件系统
cd /mnt mkdir test ls -l cp file /path/to/safe/location
如果您能够执行上述命令,则很可能已修复错误。
现在,重新启动计算机,您应该能够正常启动。
( 来源 )
实际上解决方案很简单,只需编写fsck /dev/sdax
的命令,如下所示,如果控制台要求修复某些内容,则给出Y
:
(initramfs) fsck /dev/sda1
要么
(initramfs) fsck /dev/sdaX
X
指定安装的磁盘部件号。
如果您不想在每次要求修复时手动按’y’,您也可以使用-y
选项运行该命令。
(initramfs) fsck /dev/sdaX -y
- 简单的答案是在另一个系统中删除你的硬盘连接并启动系统(请不要从你的initramfs错误硬盘启动使用任何Ubuntu和
gparted
安装)。 - 启动
gparted
并选择您的硬盘并从右键菜单中选择CHECK。
我只是通过Live CD中的“Parted Magic”工具启动系统来尝试一个幸运的镜头。 查看分区,Linux分区上有一些GBytes声明的“未知空间”。
所以我只是在整个分区上扩大了Linux空间并且瞧 – 从那时起我的Linux启动就像以前一样没有任何失败。