Linux引导文件被破坏解决办法


Minimal BASH-like line editing is supported. Fot the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.
grub>

grub>ls                          #列出分区的盘,我的安装再F盘
grub>ls (hd0,7)/ #找出WUBI安装的盘
grub>insmod ntfs #加载ntfs模块,因为WUBI将Ubuntu安装到了我分的ntfs盘上
grub>set root=(hd0,7) #这里(hd0,7)就是我找到的ubuntu安装的分区
grub>ls $Boot #找到我们BOOT分区的UUID,下一步要用到
grub>search --no-floppy --fs-uuid --set xxxxxxxxxxxx #这里的UUID就是上一定找出来的那个
grub>loopback loop0 /ubuntu/disks/root.disk #设loop0,WUBI装ubuntu安装成了一个root.disk文件
grub>set root=(loop0) #重设root
grub>linux /boot/vmlinuzxxxxxxxxx (tab补全即可) root=/dev/sda7 loop=/ubuntu/disks/root.disk ro quiet splash #加载内核
grub>initrd /boot/initrd.imgxxxxxxxxxxxx(tab 补全即可)  
gurb>boot
这样11个步骤后就可以进入系统了。

进入系统后,打开终端,输入以下3行:
$sudo update-grub2
$sudo apt-get install grub2
$sudo reboot
重启后下次就不会出现黑屏问题了。

相关内容