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

Re: where is grub installed?



On Sat, Aug 18, 2007 at 04:38:33PM -0400, P Kapat wrote:
> Suppose my hard disks are setup as:
> 
> IDE (Master)
> /dev/hda1  -- ext3  -- 10 GB
> /dev/hda2  -- ext3  -- 100 GB
> /dev/hda3  -- ext3  -- 50 GB
> 
> SATA (connected to SATA 1 controller on the mobo)
> /dev/sda1 -- ext3 -- 50GB  -- /
> /dev/sda2 -- ext3 -- 500 MB -- /boot
> /dev/sda3 -- ext3 -- 100 GB -- /home
> 
> So, the GRUB oncfig files are in /dev/sda2 (/boot/grub). I am assuming
> that grub is installed in /dev/sda2. So, where is the MBR? Is it on
> the first track of the first partition of the first hard disk, ie
> /dev/hda1?

It is wherever you told grub to put it.  On debian, it should go on the
MBR of the drive, which in your example would be the MBR of /dev/hda.
The MBR is the first block of the drive (first 512 B) with the partition
table in the subsequent block somewhere (check wikipedia).
This means that you can reformat /dev/hda1 to your heart's content. 

> 
> If so, suppose I format /dev/hda1 will the MBR be gone implying that I
> cannot reboot m y system?


> 
> What is the safest way to partition the disks so that, if sometime
> later I install someother OS (Solaris/FreeBSD/Anyother GNU/Linux but
> not Windows) the MBR is not disturbed and I can use it to boot into
> the existing Debian.

There's the rub.  It seems that all OSs by default figure that they are
the only OS and put their boot loader in the MBR of the first hard
drive.  However, every OS that you may want to install should include
documentation on dual-booting.  One of your considerations is whether or
not Grub can boot that OS.   I think (check the docs) that as long as
Grub will boot it, you leave grub in the MBR and put the OS's loader on
the actual partition, then set up grub to chain-load.  The bios will boot
Grub, then Grub will boot the OS's loader which will in turn boot the
OS.

My new Athlon64 Asus bios has an F8 boot menu.  It presents a list of
drives to attempt to boot.  If I had multiple OSs with multiple drives,
I'd install each OS on its own drive with its loader in the drive's MBR,
then use the bios boot menu to choose which drive to boot.

Doug.



Reply to: