GNU GRUB Terminal-代替Ubuntu登录屏幕


14

注意:在将其标记为重复项之前,请完整阅读问题。

我一直在正常使用Ubuntu 12.04,但是今天当我打开笔记本电脑并从两个选项中选择Ubuntu时:Windows和Ubuntu,出现以下屏幕:

在此处输入图片说明

我在这里搜索了很多,但找不到有效的解决方案。

一种解决方案建议我首先ls在不同的分区中执行操作,然后查看文件vmliuzinitrd驻留位置。但是我没有发现这些文件在哪里。

我还玩了笔记本电脑的亮度,这可能是屏幕卡死的原因。

编辑1:

我仍然找不到包含initrd.img文件的目录。

grub> ls 
(memdisk) (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
grub> set pager=1
grub> ls (memdisk)/
wubuilder.cfg
grub> ls (hd0)/
error: unknown filesystem.
grub> ls (hd0,3)/
$AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Code School/ Downloads/ Movies/ System Volume Information/ ubuntu/ wubuilder
grub> ls (hd0, 2)/
Programming Files (x86)/ Users/ $AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Documents and Settings/ hiberfil.sys Intel/ MSOCache/ pagefile.sys PerfLogs/ Program Files/ ProgramDAta/ Recovery/ Setup/ swsetup/ System Volume Information/ Windows/ wubildr wubildr.mbr
grub> ls (hd0, 1)/
$AttrDef $BadClus $Bitmap $Boot $Extend/ $LogFile $MFT $MFTMirr $RECYCLE.BIN/ $Secure $UpCase $Volume ./ Boot/ bootmgr BOOTSECT.BAK System Volume Information/

编辑2:

另外,请注意,我已经安装了Ubuntu 12.04和Windows7。Ubuntu位于以下位置:我通过启动Windows OS进行了检查:

grub ls (hd0,3)/ubuntu/
install/ uninstall-wubi.exe winboot/ 

是的,我最后用过/。但是我的格式是ls (hdx,msdosy)/x并且y是数字。我还应该ls /boot/看看提到的文件是否存在。
2015年

Answers:


11

如果您没有安装Wubi.exe,则:

grub提示符下,尝试以下命令:

set pager=1
ls

现在,假设输出ls为:(hd0) (hd0,msdos2) (hd0,msdos1),以便找到运行Linux根文件系统:

ls (hd0,1)/ 应该会给您所有的文件/文件夹,/例如bin/ boot/ cdrom/ dev/ etc/ home/ lib/etc。

完成此操作后,继续:

set root=(hd0,1)
linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
initrd /boot/initrd.img-3.13.0-29-generic
boot

当然vmlinuz-3.13.0-29-genericinitrd.img-3.13.0-29-generic用您在您发现的东西替换/boot

/dev/sda1是根系统的位置。如果/dev/sda1不起作用,则可能必须更改它。

如果已使用Wubi.exe安装:

如果您已经使用Wubi安装了Ubuntu,请执行WubiGuide中给出的以下步骤:

  1. 引导到Windows,chkdsk /r在安装Ubuntu的同一驱动器上从Windows 运行,干净地关机,然后尝试再次引导到Ubuntu。

  2. 如果仍然不好,请检查您是否有C:\ubuntu\disks\root.disk文件。如果缺少此文件,请在Windows上启动,打开Windows Explorer,将其设置为能够查看隐藏的文件夹,然后查找名为C:\found.000或的隐藏文件夹dir0000.chk。将文件从found.000移到\ubuntu\disks目录内的原始位置。您可能必须将其重命名为root.disk


我已按照您的步骤进行操作,但/boot/到目前为止找不到。我已经更新了我的问题,请复查。
阿斯兰·阿里

您是如何安装Ubuntu的?您是否使用过wubi installer
罗恩(Ron)

是的@Ron,我是通过wubi安装程序安装的。我很久以前做了。
阿斯兰·阿里

天啊!终于奏效了。我遵循与您在编辑中编写的相同说明,但在其他地方使用。您能否更改顺序,然后将与之相关的最后一个书面说明\disks\root.disk向上移动-似乎是正确的-这样,它将使您大为受益,我将接受您的回答。真的感谢。
2015年

请注意,此问题的最可能原因是强制关闭操作系统。
阿斯兰·阿里

8

运行这些命令

grub> linux  (hd0,1)/vmlinuz root=/dev/sda1
grub> initrd  (hd0,1)/initrd.img
grub> boot

hd0用您的硬盘号和/ dev / sda1 替换为包含/ boot的分区,主要是如果您没有多个硬盘且默认安装,dafult将可以工作

检查此以获取更多信息

当您可以重新启动时,您应该解决问题

sudo update-grub

我不应该使用(hd0,msdos1)代替(hd0,1)吗?
阿斯兰·阿里

它可以工作
Maythux

抱歉,我找不到该分区。我得到的是:我已经更新了问题,请对其进行复审。
Arslan Ali
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.