LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware "USB Boot CD" HOWTO (http://www.linuxquestions.org/questions/slackware-14/slackware-usb-boot-cd-howto-521390/)

samac 01-21-2007 07:17 AM

Slackware "USB Boot CD" HOWTO
 
Slackware "USB Boot CD" HOWTO

After installing a minimal Slackware 11.0 on my USB2.0 external drive (see this thread) http://www.linuxquestions.org/questi...d.php?t=518905, I had to be able to boot it from a laptop, the bios of which, does not support USB booting.

Stage 1
Install Slackware on the USB drive, using huge26.s, connected to the machine that you will use the USB drive with.

Stage 2
Reboot using a rescue cd/live distribution, and do all the following instructions as root.

Stage 3
Mount your USB linux system eg.
Code:

mount -t reiserfs /dev/sda5 /mnt/hd
mount -t ext2 /dev/sda1 /mnt/hd/boot
mount -t reiserfs /dev/sda7 /mnt/hd/home

Stage 4
chroot to the mount point
Code:

chroot /mnt/hd
Stage 5
mount cd or partition with Slackware packages.
Code:

mount -t iso9660 /dev/hdc /mnt/cdrom
(the cd drive should become free when you chroot to your new root directory)
Install kernel 2.6.17.13 plus modules using the Slackware 11.0 install cd 2
Code:

installpkg /mnt/cdrom/extra/linux-2.6.17.13/kernel-generic-2.6.17.13-i486-1.tgz
installpkg /mnt/cdrom/extra/linux-2.6.17.13/kernel-modules-2.6.17.13-i486-1.tgz
rm /etc/rc.d/rc.modules
ln -s rc.modules-2.6.17.13 rc.modules

Stage 5
Make your initrd.gz (a mini linux system that allows your main system to boot).
Code:

cd /boot
mkinitrd -c -k 2.6.17.13 -m reiserfs:uhci-hcd:ehci-hcd:ohci-hcd:usb-storage

Stage 6
Prepare the build directory and files, isolinux is on cd 1.
Code:

mkdir /bootcd
cp /boot/initrd.gz /bootcd/initrd.gz
cp /boot/vmlinuz-generic-2.6.17.13 /bootcd/linux
cp /mnt/cdrom/isolinux/isolinux.bin /bootcd/isolinux.bin
echo "DEFAULT linux initrd=initrd.img ro root=/dev/sda5" > /bootcd/isolinux.cfg

Stage 7
Time to rebuild the initrd.gz
Code:

cd /bootcd/
mkdir tmp/
gunzip initrd.gz
mount -o loop initrd tmp/
cd tmp

pico rootdev and add a line similar to this
Code:

/dev/sda5
pico rootfs and add a line similar to this
Code:

reiserfs
pico linuxrc and add after the modules section but before the lvm section.
Code:

sleep 10
Then run the following commands
Code:

cd ..
umount tmp/
rmdir tmp/
gzip -c -9 initrd > initrd.img


Stage 8

Build the bootcd.iso, this is done in the /bootcd directory.
Code:

mkisofs -o bootcd.iso -b isolinux.bin -c boot.cat\
-no-emul-boot -boot-load-size 4 -boot-info-table -J\
-hide-rr-moved -R .

Remember the final .
Then burn your iso, I use k3b but this can also be done from the command line using cdrecord.


Stage 9
Put the cd where it belongs, make sure your external USB drive is connected and on, boot and enjoy.

vbisis 01-23-2007 12:12 AM

sounds great!

I will try as soon as possible ;)

tux21 02-03-2007 09:11 AM

1.
echo "DEFAULT linux initrd=initrd.img ro root=/dev/sda5" > /bootcd/isolinuxcfg

is

echo "DEFAULT linux initrd=initrd.img ro root=/dev/sda5" > /bootcd/isolinux.cfg

2.

gzip -c 9 initrd > initrd.img

is

gzip -c -9 initrd > initrd.img

3.

cp /mnt/cdrom/isolinux/isolinux.bin /bootcd/isolinux.bin

is in disk 1

4.

installpkg /mnt/cdrom/slackware/extra/linux-2.6.17.13/kernel-generic-2.6.17.13-i486-1.tgz

is

installpkg /mnt/cdrom/extra/linux-2.6.17.13/kernel-generic-2.6.17.13-i486-1.tgz

in disk 2

5.

mkisofs -o bootcd.iso -b isolinux.bin -c boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table -J \
-hide-rr-moved -R .

must be done while in /bootcd directory.bEFORE that initrd.img must be copied in /bootcd

samac 02-03-2007 10:24 AM

Thanks tux21

I have made the changes.

I guess I should try to learn to proof read, and also write things down rather than do them from memory.

More importantly, did this work for you.

Samac

tux21 02-03-2007 02:24 PM

ofcourse it did.

yours is one of the few guides for people like me with 5 yr old pc

by the way where did you get this info from?

samac 02-03-2007 02:45 PM

I pieced it together from about a half dozen sources and reading the info in the boot cd text files.

Samac


All times are GMT -5. The time now is 04:42 PM.