@fskmh: No problem. I quite enjoyed playing around with this as it gives me good preparation for the future. I'm bound to buy a suitably big disk one day.
Anyway, I have yet another update. I recently realised that the Extlinux bootloader available with Slackware -current (part of the Syslinux package) is capable of booting ext2/ext3/ext4/btrfs GPT partitions (when a BIOS is used, though sadly not with EFI). Personally I think this is still preferable to Grub2 (unless you have an EFI system) as it avoids having to install an extra boot loader and its various dependencies.
I used the
official Extlinux page along with the
Arch Linux Wiki page on Syslinux as sources of information on how to setup Extlinux, needing to adapt the information only very slightly for Slackware (e.g. some differences in paths). I thought I would once again outline what I found in case it is useful to others.
First off, my test system (actually a VM under VirtualBOX) was slackware-current (32bit) with the disk partitioned as follows:
Code:
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 7517MB 7516MB ext4 Linux/Windows data
2 7517MB 8589MB 1072MB linux-swap(v1) Linux swap
3 8589MB 8590MB 1032kB BIOS boot partition bios_grub
Note: Extlinux doesn't actually need the "BIOS boot partition". My understanding is that the bootloaders have a slight size problem when installing on GPT systems under BIOS, due to the lack of post-MBR embed gap on GPT disks. Grub2 works around this by having the first stage of its bootloader look for a "BIOS boot partition" where it stores a second, bigger file. This second stage file includes support for a large set of filesystems. Extlinux however has a different solution. Since it supports fewer filesystems, its first stage is still small enough to include ext2+/btrfs support. It can therefore have the second stage on the /boot partition directly. Of course it still need to know which partition is the /boot partition and this is done by marking it with a special attribute.
Anyway, I set this attribute with sgdisk (provided by the gdisk package) as follows:
Code:
# sgdisk /dev/sda --attributes=1:set:2
I then used sgdisk to confirm it was indeed set correctly, i.e.:
Code:
# sgdisk /dev/sda --attributes=1:show
1:2:1 (legacy BIOS bootable)
With that out of the way I installed extlinux as follows:
Code:
# mkdir -p /boot/extlinux
# extlinux --install /boot/extlinux
# cat /usr/share/syslinux/gptmbr.bin > /dev/sda
Since I wanted a boot menu, I copied menu.c32 over into the extlinux boot directory as well:
Code:
# cp /usr/share/syslinux/menu.c32 /boot/extlinux/
I then created a /boot/extlinux/extlinux.conf file that looked like this:
Code:
UI menu.c32
PROMPT 0
MENU TITLE Boot options
TIMEOUT 50
DEFAULT generic
LABEL generic
MENU LABEL Slackware (vmlinuz-generic-smp-3.2.21-smp)
KERNEL /boot/vmlinuz-generic-smp-3.2.21-smp
APPEND root=/dev/sda1 ro
INITRD /boot/initrd.gz
LABEL huge
MENU LABEL Slackware (vmlinuz-huge-smp-3.2.21-smp)
KERNEL /boot/vmlinuz-huge-smp-3.2.21-smp
APPEND root=/dev/sda1 ro
This worked just fine for booting the huge kernel. However, when I attempted to load the generic kernel, booting halted with the following message:
Code:
/boot/initrd.gz: Loading kernel modules from initrd image:
mount: can't find /mnt in /etc/fstab
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
You can try to fix it. Type 'exit' when things are done.
/bin/sh: can't access tty; job control turned off
/ # _
I realised that I could get past this point and continue with booting if I manually did the following:
Code:
/ # mount -o ro /dev/sda1 /mnt
/ # exit
However, this it is not very convenient to have to do this every time, so after booting I did the following:
Code:
echo "/dev/sda1 /mnt ext4 ro 1 1" >> /boot/initrd-tree/etc/fstab
mkinitrd
I'm not sure if this is the optimal way to fix the issue but it did work because the updated /etc/fstab within my new initrd.gz allows the mount command to find /dev/sda1 by itself. If anyone knows of a better way to do this, I would certainly be interested to hear about it.