linux grub confusion

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来修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值