Go to the first, previous, next, last section, table of contents.


4. Boot Loaders

The boot loader is the program that allows you to select which operating system you want to use, and loads that operating system. You may have more than one boot loader installed, especially if you have more than one type of operating system installed. It is common for boot loaders to be able to load other boot loaders.

When resizing a partition, lots of data gets moved around. Many boot loaders don't understand the file system. They just remember where on the disk the required boot loader information lies. If this information is moved, they must be told where it has been moved. This is done by reinstalling the boot loader (i.e., re-running the installer program for the boot loader, which usually involves issuing a single command at the shell). Not all boot loaders require this.

4.1 LILO: a bootloader for the Linux kernel

LILO is a popular boot loader for x86. LILO's boot loader is usually installed with:

# /sbin/lilo

If you are using a boot disk, then you should do this instead: (where `/dev/hda1' should be replaced with your root device)

# mount /dev/hda1 /mnt
# chroot /mnt /sbin/lilo
# umount /dev/hda1

Old versions of LILO don't support LBA mode (see section 3.1 The PC BIOS). LBA mode is enabled with the lba32 or linear option, in `/etc/lilo.conf' (see the LILO documentation for more info).

If you use LBA mode, you should have no problems, as long as your BIOS supports LBA.

If you use CHS mode, then the partition with your `/boot' directory must finish before cylinder 1024. So, if you have a large disk (say, over 8 gigabytes), you should have a `/boot' partition near the start of your disk.

4.2 GRUB: The GNU GRand Unified Bootloader

GRUB is a relatively new boot loader, for x86. Depending on how GRUB is installed, it may understand the file system, or simply remember where the boot files are stored. It understands the file system if it's using "Stage1.5". If it's not using Stage1.5, or the partition number changes, then you need to reinstall Stage2 (please see the GRUB documentation). Otherwise, you don't need to do anything.

GRUB automatically detects if LBA is available, and will use it if it is available (equivalent to LILO's "lba32" option).

4.3 Legacy Microsoft Operating System Bootloaders

DOS and Windows require you to re-install the boot loader if you change the FAT type (FAT16 or FAT32) of the boot partition. Parted will warn you before attempting to do this. To re-install the boot loader, you can either create a boot disk, or use the boot CDROM. The boot disk method does not work with Windows ME.

Also, DOS and Windows impose a few restrictions:

4.4 The Microsoft Windows NT Bootloader

Windows NT can't read or boot from FAT32 partitions. Therefore, you should never convert FAT16 partitions to FAT32 partitions, if you want to use them with Windows NT.

4.5 The Microsoft Windows 2000 Bootloader

Windows 2000 require you to re-install the boot loader if you change the FAT type (FAT16 or FAT32) of the system partition. Parted will warn you before attempting to do this. To re-install the boot loader, do:

  1. Boot off the Windows 2000 CD.
  2. It will ask if you want to proceed installing. Hit Enter.
  3. It will then ask you if you want to install a new system, or Repair an existing system. Choose the later (by pressing "R").
  4. It will ask you if you want to do an automatic repair, or if you want to use the recovery console. Choose to use the recovery console.
  5. At the console, type:
    C:\>fixboot
    
    The system should boot successfully now.

The NT/2000 boot loader also needs:

4.6 Quik: a bootloader for Macintosh PowerPC's

Quik is a popular boot loader for "Old World" Macintosh PowerPCs. You need to reinstall Quik if you resize an ext2 partition, with:

# /sbin/quik

4.7 Yaboot: a boot loader for Macintosh PowerPC's

Yaboot is a popular boot loader for "new world" Macintosh PowerPCs. ("New-world" refers to coloured PowerPCs manufactured since 1999.)

Yaboot needs its own boot strap partition that must be at least 800k. So, if you are installing GNU/Linux from scratch, you would do something like:

(parted) mklabel mac
(parted) print
Disk geometry for /dev/sda: 0.000-6149.882 megabytes
Disk label type: mac
Minor    Start       End     Filesystem  Name          Flags
1          0.000      0.031              Apple
(parted) mkpart primary hfs 0.032 1
(parted) print
Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
Disk label type: mac
Minor    Start       End     Filesystem  Name          Flags
1          0.000      0.031              Apple
2          0.031      1.000
(parted) set 2 boot on
(parted) print
Disk geometry for /dev/hdb: 0.000-6149.882 megabytes
Disk label type: mac
Minor    Start       End     Filesystem  Name          Flags
1          0.000      0.031              Apple
2          0.031      1.000                            boot

You don't need to reinstall Yaboot after resizing a partition. Yaboot is installed with ybin section 9. Related Software and Info.


Go to the first, previous, next, last section, table of contents.