Installing Slackware 12.2 boot onto a bootable usb drive
** Preliminary Note:
syslinux is technically not required however it
allows you to recompile and install a kernel
easily and there is a SIGNIFICANT speed increase
in the boot process for my computer at least. 2 minutes
verus 10 seconds, no brainer.... Problem with lilo?
or is it a usb driver issue?
Also I'm still not sure if you need to run syslinux
everytime you modifiy initrd.gz/bzImage I'd like to
think no, but I never assume.
For the most part slackware can't currently boot off a USB drive because of
udev, initrd problems, probing delays (or lack of). This guide attempts to fix
or at least workaround all the previous issues.
1. Create two partitions on the usb drive:
one ~70 MB fat16/32
one ~4 GB ext3 partition
2. Install packages through slackware install or installpkg -root /mntdir
or combination there of, you'll be doing some cleanup routines on your
own *later*. If using the slackware install CD try "modprobe usb-storage".
I would recommend using the slackware installpkg however you can always
use tar -zxf slackware/*/*.tgz in the root directory where youd like to install;
that should allow you to chroot it, however will cause a tiny bit of clean up
like deleting /install for example.
3. Chroot to the mounted ext3 partition (This is more or less important )
4. Initrd doesn't work right(or how I like maybe?) with the default slackware 12.2 kernel so
we need to recompile the kernel, and we are going to download the lastest
version from kernel.org.
Im using 220.127.116.11,
You can compile by copying
/boot/config-huge-smp-18.104.22.168-smp, or whatever default slackware kernel your using,
the root kernel source directory as ".config", now run
press enter a whole bunch (This will create a distro style, very large, kernel w/ a
lot of modules!).
Remember to compile in drivers->usb->usb_storag , other usb stuff, initrd, ext3
and any other drivers you might need for the prelim boot process (make menuconfig
Run: make bzImage ; make modules ; make modules_install
5. Currently something in usb messes up with the boot process by reprobing the usb root device;
To fix this just delete the /lib/modules/22.214.171.124/kernel/drives/usb directory
6. Run: mkinitrd -c -k 126.96.36.199 -r /dev/sda2
modify kernel version depending on kernel you compiled above
also modify root directory depending on how you partitioned usb drive.
7. edit /boot/initrd-tree/wait-for-root from the value of 1 to 10
This is the number of seconds the boot process will wait for drives to appear, this is essential!
8. Run: mkinitrd
9. exit chroot (or just modify directions below i guess)
10. Ok now copy the *kernel source*/arch/x86/boot/bzImage and *install*/boot/initrd.gz to the vfat partition
11. On the vfat partition create syslinux.cfg with the following(you might wanna change vga):
SAY Now booting the kernel from SYSLINUX
APPEND root=/dev/sda2 ro vga=794 initrd=/initrd.gz
12. Unmount the vfat partition and run "syslinux /dev/sda1" it (or corresponding command of course!).
*** WARNING *** if you already have a SCSI hard/disk/usb/etc drive attached on the install computer you
must modifiy the syslinux/lilo commands to /dev/sdb1 or corresponding device!
** ALSO NOTE ** If the device you will be booting the usb drive on will have a SCSI disk you
must change the /etc/fstab /etc/lilo.conf and *vfatdevice*/syslinux.cfg to
/dev/sdb2 or corresponding device!!!
13. chroot to install root again, create new /etc/lilo.conf containing:
#change sda to sdb if you have other scsi devices as said above
boot = /dev/sda
#message = /boot/boot_message.txt
vga = normal
other = /dev/sda1
label = syslinux
table = /dev/sda
14. Create a /etc/fstab, it should look something like this:
/dev/sda1 / ext3 defaults 1 1
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 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
15.For most people running lilo
simply will do however you might need lilo -C /mnt/etc/lilo.conf -b /dev/sdX#
16.For an unknown reason X won't boot without reinstalling all font packages use installpkg slackware/*/*font*.tgz
, and later you may want to run setconsolefont
, and timeconfig
Slackware should now boot off the usb drive :D, let me know if you have any problems.....
You can also apply these directions to make a Slackware install pen drive w/ all packages, along with just
being your boot disk. :-D
Things I'd like to see changed:
*Flexibility with drives(when SCSI is crowded with devices)
If you use one boot loader(probably syslinux) you can boot
by editing the initrd boot script located at /boot/initrd-tree/init and
dynamicly generating /etc/fstab
Unfortunately you cannot test this in qemu/bochs yet because of the SCSI, however
if someone knows a work-around please don't be shy to contact me
*Created: Monday 23 March 2009
*Last Modified: Tuesday 24 March 2009
Copyright (C) 2009 Karlan T. Mitchell.
karlanmitchell at gmail dot coim
BSD License: Redistribute/Modify freely, just give me credit, and no using my name for profit ;-)