Using the GRUB bootloader to multi-boot


 Using the GRUB bootloader to multi-boot.

 

Before you start.

Before you start installing another Operating System to an existing installation, you should back up your MBR [Master Boot Record] in case this gets trashed during the installation. A good place to save it is to removable media such as a floppy disk or a USB Pen-drive.

 

 

[code]

paul@PAULS:~$ dd if=/dev/hda of="/home/paul/My Documents/backupMBR/backupfile.mbr" bs=512 count=1

1+0 records in

1+0 records out

512 bytes transferred in 0.022755 seconds (22501 bytes/sec)

paul@PAULS:~$

[/code]

 

With the result : --

 

[code]file:/home/paul/My Documents/backupMBR/backupfile.mbr  512 B[/code]

 

Note :

If you have made changes to your partitions, when restoring the MBR, use this : --

 

[code]

dd if="/home/paul/My Documents/backupMBR/backupfile.mbr" of=/dev/hda bs=448 count=1

[/code] leaving the last 64 bytes unchanged, as this points to the partition table and you do not want to change this.

 

If this had been written to removable media it would be a bit easier to access when needed, but a liveCD will be able to get back to backupfile.mbr also.

 

Further information on this topic found at [url]http://ubuntu.wordpress.com/2005/10/20/backing-up-the-mbr/[/url]

 

 


 

http://www.tux.org/pub/people/kent-robotti/looplinux/backup-mbr.readme

 Unfortunately it does not work for me in Linspire 5.0.59 - 'file not found' error, meaning the app. is not installed.

[quote]
=============================================================================
You can use 'backup-mbr' to backup and restore your MBR.

The (M)aster (B)oot (R)ecord is the first 512 bytes of your hard drive,
and you should always have a current backup of your MBR!

To hold the MBR, you can use any media with a filesystem on it,
but the filesystem on the media must be supported by the kernel!

In addition to backing up the MBR of the hard drive you specify, it also
makes a backup of the boot sector from each partition on the hard drive.

Backup MBR from /dev/hda to directory /mbr/hda on /dev/fd0.
# backup-mbr -b -d /mbr/hda hda fd0 "If directory doesn't exist, will create."

Restore MBR to /dev/hda from backup in directory /mbr/hda on /dev/fd0.
# backup-mbr -r -d /mbr/hda hda fd0

Restore boot sector to /dev/hda1 from backup in directory /mbr/hda on /dev/fd0.
# backup-mbr -r -d /mbr/hda hda1 fd0

If you want to backup the MBR to a multi-session CD-R/RW, do this.
# backup-mbr -cd-multi -b -d /mbr/hda hda hdc

You can specify the cd device the old (pre kernel v2.6) way, like this.
# backup-mbr -cd-multi -b -d /mbr/hda hda 0,0,0

You'll need 'cdrecord' and 'mkisofs' installed, and have a CD in the
drive '/dev/hdc'.

If it's not a multi-session CD-R/RW, do it this way.
# backup-mbr -cd -b -d /mbr/hda hda hdc "CD will be written multi-session."

The non multi-session CD-RW must be blank, blank it first if it's not.
cdrecord blank=fast dev=/dev/hdc "You'll loose anything on the CD!"

Or, if you want this script to blank the CD-RW.

# backup-mbr -cd-blank -b -d /mbr/hda hda hdc

Restore MBR to /dev/hda from backup in directory /mbr/hda on /dev/hdc.
# backup-mbr -r -d /mbr/hda hda hdc

<dwilson24@nyc.rr.com>

[/quote]

 

Now to the taks of setting up your hard drive(s) for multibooting.