h1

MULTIBOOTING: III. FIXING, CHANGING AND MOVING.

October 8, 2008


1A. re-installing LILO from a booted (eg from a boot floppy) linux. LILO keeps its config file in /etc/lilo.conf Simply run lilo -b /dev/hd?? where /dev/hd is the local partition. Unlike GRUB, LILO needs to be re-installed every time something is changed.

1B. re-installing GRUB from a booted (eg from a boot floppy) linux. GRUB keeps its config file in /etc/menu.lst or /boot/grub/menu.lst Simply run grub-install -/dev/hd?? where /dev/hd is the local partition. Unlike LILO, GRUB does not need to be re-installed every time something is changed.

1C. re-installing LILO from an un-booted linux. LILO keeps its config file in /etc/lilo.conf Boot another linux with LILO (including a live CD) Mount the partition (this is where it is handy to have everything on one partition).

1.

cd to the root of the mounted partition.
2.

chroot $PWD. Then run lilo -b /dev/hd?? where /dev/hd is the local partition. Unlike GRUB, LILO needs to be re-installed every time something is changed.

1D. re-installing GRUB from a un-booted linux. GRUB keeps its config file in /etc/menu.lst or /boot/grub/menu.lst Boot another linux with GRUB (including a live CD) Mount the partition (this is where it is handy to have everything on one partition).

1.

cd to the root of the mounted partition.
2.

chroot $PWD.
3.

Then run grub-install -/dev/hd?? where /dev/hd is the local partition.

Unlike LILO, GRUB does not need to be re-installed every time something is changed.

2. Moving a linux partition. Use cfdisk (preferably for a live CD) to create a target partition if necessary. If you have done so, reboot. Use dd to copy , eg dd if=/dev/hda6 of=/dev/hda11. Mount the target partition under some third linux (or a live CD). Go into it and

1.

amend the fstab so that root is the new partition.
2.

amend any partitions that may have been re-numbered. If your swap and data partitions have low numbers, as I have recommended, this won’t be necessary.
3.

amend the lilo.conf or menu.lst, and re-install GRUB or LILO as above.
4.

amend the master boot loader. This is very easy with SmartBoot, just hit ctrl-I and it will recognise the new partition. If you have split your linux across multiple partitions, as I don’t recommend, this will be more difficult.

3. Resizing. Partitions can be resized, up to a point, with parted. However, it is rather shaky, and you often need to fsck the partition afterwards to make it bootable (parted). fdisk , sfdisk and cfdisk cannot resize. Parted can, but unreliably. There are also special-purpose resizers ext2resize, reiserfsresize.

The size of an extended partition is determined by its contents, they can be shrunk by deleting logical partitions off the end.

Leave a comment