OK yall, a quick rundown on how I setup a usb HDD with a bootable Slackware 14 install today.
Firstly, I installed the base system from the CD, with my partition table looking a little something like this..
/dev/sda1 * 63 1558304 779121 83 Linux /boot
/dev/sda2 1558305 9365894 3903795 82 Linux swap swap
/dev/sda3 * 9365895 204684164 97659135 83 Linux /
/dev/sda4 204684165 1953519615 874417725+ 7 HPFS/NTFS/exFAT /store
Now during the install I chose the simple LILO install option, into the MBR of /dev/sda.
After that I modified my initrd tree, firstly by deleting it, located at /boot/initrd-tree, and then by running mkinitrd, which will give us a fresh tree and populate it. Now to get a working initrd image to bring up the usb disk on boot, first I had to modify /boot/initrd-tree/wait-for-root and set the value to something in seconds to allow the drive time to come up once the modules are loaded. I set mine to 15. Next I modified the fstab to only reference UUIDs when mounting the disks, as If you are using this on different machines, you may find the disk moves locations depending on how many disks are in said machine, ie : /dev/sda if singlular, or first drive (unlikely, given USB) becomes /dev/sdb or c, if detected after others. This way the drive is always referenced correctly and you dont get kernel panics. You can get the UUID of your partitions by ‘blkid’.
My fstab as follows
UUID=af7efa55-2f37-415a-b131-130d2accbd5d swap swap defaults 0 0
UUID=ddee4a6a-900d-494e-9573-acb6fd371faf / ext4 defaults 1 1
UUID=dac53074-92d8-4fb1-abc9-0bd0f0631102 /boot ext2 defaults 1 2
UUID=3E58608D586045AD /store ntfs fmask=111,dmask=000 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
Next I built my initrd image using the command ‘mkinitrd -s /boot/initrd-tree -k 3.2.29-smp -m ehci-hcd:uhci-hcd:usb-storage -f ext4 -o /boot/initrd.gz’. You will note the modules we are placing into the image, these will be loaded and allow the drive to be initialised, and the root fs duties to be handed off to it. Change the variables for kernel and filesystem as needed.
Lastly, I configured and reinstalled LILO. Again, like the example above, we want to modify it to only use UUIDs as reference, and to add in the lines for our initrd. Make sure you place the initrd line above the root line when configuring, it denotes hierachy.
My lilo.conf entries, dont forget to change the boot line to the target HDD.
boot = /dev/sdc
image = /boot/vmlinuz
initrd = /boot/initrd.gz
root = “UUID=ddee4a6a-900d-494e-9573-acb6fd371faf”
label = Slack14
Lastly, run ‘lilo -v’ to commit the whole thing to the MBR.