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.
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.
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).
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.
A:\>sys c:
A:\>c: C:\>cd \windows\command (might be \win98\command, or similar) C:\WINDOWS\COMMAND>sys c:That's all there is to it.
Also, DOS and Windows impose a few restrictions:
(parted) set 3 boot on
(parted) set 2 lba onNote: LBA addressing is not supported in MS-DOS 6.22 and lower, as well as all versions of PC-DOS. Warning: some BIOSes won't enable LBA addressing, unless you enable it in the BIOS as well. If for some reason, Windows doesn't boot after changing this flag, this is probably the problem.
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.
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:
C:\>fixbootThe system should boot successfully now.
The NT/2000 boot loader also needs:
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
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.