Grub 仅显示“Grub 加载”后重新启动 PC。

Grub 仅显示“Grub 加载”后重新启动 PC。

我有一台旧电脑,用于实验性的操作系统,大约一个月前我在上面安装了 Gentoo,并使用 GRUB2 作为引导加载程序。一切工作正常,但每次启动时都会显示有关 /dev/sda2 (我的 grub 启动分区)的错误,由于某些错误(错误的超级块、错误的 fs 类型等......)而无法安装它

编辑:我应该提到分区的顺序(由于重新分区)是:
/dev/sda2 (/boot)
/dev/sda1 (/)
/dev/sda3 (swap)

昨天我决定通过运行来消除这个错误e2fsck /dev/sda2。有很多错误的事情,但是它们重复了很多(如果不是全部)inode,所以我决定让 e2fsck 完成它的工作,并通过按住 Enter 键跳过所有内容。
到最后并没有出现什么异常的情况,或许是提到了修复了多少东西。

然后我尝试重新启动,因为我一直试图通过使用正确的驱动程序重新编译内核来使声音正常工作。当它启动时,它显示了通常的 BIOS 启动屏幕(带有加载栏),然后是通常的文本屏幕,在该屏幕上我总是必须按 F1 键才能继续(我认为这是因为我唯一的 HDD 通过连接SATA 而不是当时(2004 年)常见的 IDE)。它显示文本“Grub 加载。”,然后重新启动,进入无限循环(如果不是我必须在每个启动序列期间按 F1)。我还没能解决这个问题。

我已经使用 Gentoo 安装磁盘启动并重新安装了 GRUB2,
我已重新格式化 /dev/sda2 并重新配置了 GRUB2,
我已重新排序分区,以便 /dev/sda1 是 GRUB 启动分区,并且也位于磁盘的开头,重新配置 GRUB,
我已将所有分区 10 GiB 移动到磁盘后面,以确保第一个分区不在 HDD 的坏点上,并重新配置 GRUB2,
我已更改并尝试了所有有关启动的 BIOS 选项,
我已用 google 搜索我的主笔记本电脑上关于类似问题的活生生的狗屎,
我考虑过放火烧电脑,获得假护照并消失到比利时......

编辑:我发现在某种程度上,GRUB(当它仍然有效时)已安装到文件夹 /boot 而不是分区,因为无法安装分区。

编辑(2):这是/etc/fstab

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed); notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>          <mountpoint>    <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda2       /boot       ext4        noauto,noatime  1 2
/dev/sda1       /       ext4        noatime     0 1
/dev/sda3           none        swap        sw      0 0
/dev/cdrom      /mnt/cdrom  auto        noauto,ro,user  0 0
/dev/fb0        /mnt/floppy auto        noauto,user 0 0

我现在注意到它仍然有 sda1 和 sda2 切换,但我不认为它会在 GRUB 加载期间导致崩溃。

编辑(2.1):我修复了 fstab,但问题仍然存在。

编辑(3):这是更新的 fstab:

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed); notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>          <mountpoint>    <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1       /boot       ext4        noauto,noatime  1 2
/dev/sda2       /       ext4        noatime     0 1
/dev/sda3           none        swap        sw      0 0
/dev/cdrom      /mnt/cdrom  auto        noauto,ro,user  0 0
/dev/fb0        /mnt/floppy0    auto        noauto,user 0 0

ls /boot/奇怪的是,没有产生任何输出 - 也许我犯了一个错误,GRUB 分区毕竟已安装。

将 /dev/sda1 安装到 /boot/ 后,这是以下输出ls -Al /boot/

 root@lubuntu 20:52:29 / # ls -al /boot
total 8941
-rw-r--r--  1 root root   96280 Jul 29 19:09 config-4.0.5-gentoo-2015-07-29-14-09
drwxr-xr-x  5 root root    1024 Jul 29 19:09 grub
drwx------  2 root root   12288 Jul 29 15:52 lost+found
-rw-r--r--  1 root root 2720318 Jul 29 19:09 System.map-4.0.5-gentoo-2015-07-29-14-09
-rw-r--r--  1 root root 6319104 Jul 29 19:09 vmlinuz-4.0.5-gentoo-2015-07-29-14-09

答案1

从救援 CD/USB 启动。然后 chroot 到您的安装,然后运行

grub2-install /dev/sda
grub2-mkconfig /boot/grub2/grub.cfg

相关内容