Previous Section  < Day Day Up >  Next Section

Recipe 12.8. Configuring the Boot Partition

12.8.1 Problem

Because you are using a boot partition, instead of a /boot directory on the root filesystem, you're not sure that the filepaths are correct.

12.8.2 Solution

Use df to see what partitions your filesystems are on. You'll need to make sure any partitions you want to check are mounted.

First, you can verify that your filesystems are installed to the correct partitions with df:

$ df -h

Filesystem      Size    Used    Available  Use% Mounted on

/dev/hda2       2.5G    1.5G      1G        60%    /

/dev/hda1       100M    30M      70M        30%    /boot

Now, verify that the file tree in the boot partition is correct, look for /boot/boot:

$ ls /boot

System.map-2.4.21  boot  grub  config  splash.xpm.gz  vmlinuz  vmlinuz-2.4.21

If there is not a /boot/boot directory, create one, and copy over the files from the parent directory:

# cp -av /boot/ /boot/boot/

Some distributions, such as Debian, create a /boot soft link to the parent directory:

$ cd /boot

$ ls -al boot

lrwxrwxrwx  1 root  root  1 Apr  16  08:50  /boot/boot -> .

It is okay to leave this alone and not create a new /boot directory, even though this link creates an endless loop in the file tree. It's another way to ensure having a /boot directory in the boot partition.

12.8.3 Discussion

Confused over all these boots? Just keep in mind that a partition name is not a directory name, because a partition is not a directory, and a mountpoint can be given any name. GRUB knows nothing about mountpoints—it reads filesystems before they are mounted. So if there is not a /boot directory in the boot partition, GRUB does not see /boot/grub, but /grub. While it's not strictly necessary to have a /boot directory, following this convention will make your life a lot easier.

12.8.4 See Also

    Previous Section  < Day Day Up >  Next Section