bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writing MBRs & disk numbering


From: Felix Zielcke
Subject: Re: writing MBRs & disk numbering
Date: Wed, 19 Aug 2009 12:06:10 +0200

Am Dienstag, den 18.08.2009, 17:44 +0200 schrieb Wojtek SWIATEK:

> 
> My question is the following: what exactly should I do to write the
> MBR to /dev/hda1 using the config above. In practical terms I can
> access it by mounting /dev/sda1 at /mnt (and then access the config
> file via /mnt/boot/grub/grub.conf if needed).
> Specifically, is (hd0) currently pointing to the internal or external
> drive? In other words when I issue a 
> 
> # grub  --config-file=/mnt/boot/grub/grub.conf
> grub> root(hd0,0)
> grub> setup (hd0)
> 
> will I be writing the MBR with the new (adapted to a boot from the
> internal drive sda) config to the internal drive?
> 
> I would like, obviously, to avoid writing the MBR on my external drive
> which has a working MBR.

It's better to use grub-install if you can.
/boot/grub/device.map tells which device is hd0

> Thanks a lot for any pointers, I would like to avoid spending another
> 2 sleepless nights :)
> 
> Aside of the problem, one thing which makes me wonder a lot is that
> the current config (on the external drive) refers to (hd0) and at the
> same time the device map claims that hd0 is /dev/sda (so the internal
> drive):
> 
> --- grub.conf in the current, working /boot on the external USB drive)
> # grub.conf generated by anaconda
> #
> # Note that you do not have to rerun grub after making changes to this
> file
> # NOTICE:  You have a /boot partition.  This means that
> #          all kernel and initrd paths are relative to /boot/, eg.
> #          root (hd0,0)
> #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
> #          initrd /initrd-version.img
> #boot=/dev/sda
> default=0
> timeout=0
> splashimage=(hd0,0)/grub/splash.xpm.gz
> hiddenmenu
> title Fedora (2.6.27.5-117.fc10.i686)
>         root (hd0,0)
>         kernel /vmlinuz-2.6.27.5-117.fc10.i686 ro
> root=UUID=32faed91-ab12-4d81-9
> 173-246be6a11391 rhgb quiet
>         initrd /initrd-2.6.27.5-117.fc10.i686.img
> ---
> 
> --- device.map on the external USB drive in /boot/grub --
> # this device map was generated by anaconda
> (hd0)     /dev/sda
> ---
> 
> mount shows on the current setup that:
> /dev/sdb1 on /boot type ext3 (rw)
> (which is OK).
> 
> My wild guess is that the device map is not being used :)
> 

It is but just for the utilities.
real grub uses BIOS disk order so hd0 is mostly the disk where it's
loaded from.
Whereas device.map is created by Linux device order which can be
different.
So sometimes you have to fix device.map yourself.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]