[ale] How do I get grub on an alternate disk?

Geoffrey esoteric at 3times25.net
Tue Oct 18 09:54:58 EDT 2005


ale_nospam at fayettedigital.com wrote:
> I'm putting a new disk on my wife's computer.  She dual boots with grub
> and I'm just going to hang the new disk off temporarily and dd partitions
> over to the new one.  The only think I can't figure out is how to run grub
> to write the MBR so it will boot correctly when I make the new drive the
> default.
> 
> Any suggestions?  After I move the new disk in place, can I run Knoppix
> and somehow run grub using my menu?

Make sure that your grub directory has been updated with the new 
goodies.  That is if you're adding a /dev/hde drive and it will be your 
new boot drive, whereas it was /dev/hda, then references to /dev/hda in 
the menu.lst (grub.conf) file will need to reflect this change.

Boot from your favorite boot media as you've noted above.  Then mount 
the new root partition and any other partitions that would be part of 
the normal install on this disk.  then chroot to that new root.  Then 
run /usr/sbin/grub-install 'NEW_DEV'  where NEW_DEV is the device you 
want grub installed on.  In summary:

boot with alternate media (toms root/boot?)
mkdir /tmp/newroot
mount /dev/hd?? /tmp/newroot
(if other partitions need mounting, mount them as well, (ie, if /boot is 
a separate partition, mount /dev/hd?? /tmp/newroot/boot))
chroot /tmp/newroot
/usr/sbin/grub-install /dev/hd?

reboot
-- 
Until later, Geoffrey



More information about the Ale mailing list