Re: Moving/copying the MBR

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



On Wed, Apr 11, 2007 at 10:48:36AM -0700, Mark Hull-Richter wrote:
> Are there any tools for working with and moving or copying the MBR?
> 
> My machine has 2 PATA drives (hda & hdb) and 2 SATA drives (sda & sdb).  The
> MBR is on hda,

Actually, its on every drive. The BIOS just boots the first it cans (by
a configurable order).

> but I would like (eventually or sooner) to boot from sda
> because it is two years newer, faster and, hopefully, more reliable.  Even
> if I don't change that, I'd like a backup MBR on sda in case hda fails (hdb
> has gone sour a few times due to something in the power setup, although no
> data lost and it always comes back).
> 
> In order to copy the MBR, I'd also need to edit it because the drive
> configuration would be different, as well as the location of my /boot
> partition.

So you don't want to backup hda's MBR to sda, you just want to also be
able to boot from sda.

So, you'll need to create the extra boot partition on sda, format it,
copy /boot data to the new one, umount /boot; mount newboot /boot; and
then, depending on your boot loader:

a) lilo:
  1. change boot=/dev/hda to boot=/dev/sda (in /etc/lilo.conf)
  2. make sure disk=/dev/sda exists and is correct (also in /etc/lilo.conf)
  3. lilo -v

b) grub:
  1. make sure /boot/grub/device.map has the correct value for sda
  2. change (hd0) to the sda device in /boot/grub/menu.lst
  3. execute grub-install /dev/sda

Note that disk= and device.map specifies the device name on boot. If you
change the BIOS boot order to boot sda first, then sda will still be
bios=0x80 (lilo) and (hd0) (grub).

Anyway, I just recomend the creation of a boot cd with /boot and fix
/boot when the need arrives.

-- 
lfr
0/0

Attachment: pgpIhUFlCICNQ.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux