Moving a FC5 Boot Partition

This post follows on from my earlier one on Moving a FC5 Root Partition to LVM. In this episode, I conclude the work by moving the /boot partition to the new drive and do everything else necessary to remove the old drive.

The story so far is that I have a Fedora Core 5 installation where everything but the /boot partition has now been moved off the old smaller drive (/dev/hda) onto the new larger one (/dev/hdb). Because I had the foresight to create a /dev/hdb1 partition of about 65MB before using the rest of the drive for Logical Volume Manager (LVM) managed space, I'm now in a position to be able to move entirely off the old drive. The partitions on the two drives look like this:

  • /dev/hda:

    • /dev/hda1: /boot (50MB, marked bootable)

    • /dev/hda2: old / partition (unused)

    • /dev/hda3: old swap partition (unused)

    • /dev/hda4: old LVM partition (unused)

  • /dev/hdb:

    • /dev/hdb1: unused 65MB partition

    • /dev/hdb2: LVM partition

    • /dev/hdb3: LVM partition

    • /dev/hdb4: no partition defined

Now, we proceed as follows:

  • With the system running, we move the contents of the /boot partition to the new drive:

    # mke2fs -j /dev/hdb1
    # e2label /dev/hdb1 /boot
    # mkdir /mnt/new
    # mount /dev/hdb1 /mnt/new
    # cd /mnt/new
    # dump 0af - /boot | restore xf -

  • Mark the /dev/hdb1 partition as bootable using the fdisk utility's 'a' subcommand. Don't forget to use the 'w' subcommand to write the partition table back to the drive.

  • Power the system down, remove the /dev/hda drive and tweak the jumpers on what was the /dev/hdb drive so that it will become /dev/hda.

  • Reboot onto the Fedora Core 5 Rescue CD.

  • When you reach a command prompt, install grub on the new drive and reboot:

    # chroot /mnt/sysimage
    # grub-install /dev/hda
    # reboot

And we're done!