六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 40|回复: 0

linux grub confusion

[复制链接]

升级  32.45%

533

主题

533

主题

533

主题

探花

Rank: 6Rank: 6

积分
1649
 楼主| 发表于 2013-1-28 16:12:23 | 显示全部楼层 |阅读模式
solution:  http://www.debianhelp.org/node/3463

After installing ubuntu gutsy, I modified the disk partition using fdisk - fix the partition order during the installation, changed the root partition /dev/hda10 to /dev/hda9. then reboot
"
grub error 25
"
I guess the grub can't find the stage2 according to the stage1.5 embedded MBR, or something that leads to menu.list load failure.
Now what I have to do is tore-install the ubuntu gutsy's grub. "chroot" into the root system will enable gutsy fix itself.
but , bad news, my CD-ROM's broken. I have to boot my notebook from a USB-Disk which recognized by BIOS as "hd0". It matters a lot. I can't manually boot the gutsy in the grub on this "hd0" disk, in turn, I have to boot another LiveCD using unionfs, and eventually "chroot" into the gutsy.
"grub-install /dev/hda" ? It doesn't work! It's reported that "grub: not found or no block device".

....(hard time)

the problem is, chroot do all the static configuration but the dynamic things, such as mount the peripheral device ,etc. So, Prior to chroot, you need to tell the target system all these runtime information by "mount". Here is more details:


from Gerhard Brauer came the solution:only grub as bootloader on /dev/hda
1. booting the  clone in rescue-mode and mount /dev/hda1 /mnt
2. mount -o bind /dev /mnt/dev
3. mount -o bind -t proc /proc /mnt/proc
4. chroot /mnt
5. grub-shell with root (hd0,0) and  setup (hd0)

I tried different ways, but only this one worked.
Don't delete stage2
don't run grub-install. It'll produce the error
/dev/sda1 does not have corresponding BIOS drive


add:基本上一个套路就是: 分区表就用fdisk之类工具修改,引导扇区就用grub来操作,dd都最好不要用,格式化使用mkfs。重建分区时直接使用mkfs,不用fdisk来修改。
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表