====== Voyage Linux on USB flash drive with Extlinux ====== Author: Nicholas A. Schembri, State College, PA USA\\ Last Change: 19 Sept 2006 \\ Wiki base copied from Danny W. Adair Note: Danny W. Adair did all of the hard work. His wiki page is much better then mine. Please read How Do I install voyage on a usb flash drive. Voyage Current has an initrd image. This makes it very simple to load onto a usb device. ===== Summary ===== * We will make one partitions on the USB key, and configure extlinux to boot. * We'll get and unpack the current, Sept 19 Voyage Linux distribution. ---- **Make sure you do all this as root.** \\ ** These are my working notes and not the word of god. I'm posting my notes to help others. \\ Please read Danny W. Adair' "How Do I install voyage on a usb flash drive".** ---- ===== 1. Prepare USB key ===== See "Danny W. Adair" if you have I/O errors. a) Use fdisk or cfdisk to create one bootable (make it at least 80MB. I'm sure voyage-Current is going to be cleaned up to fit on a smaller disk, but Flash is now Cheap. I'm using stock 256 Meg thumb drives.) b) Create ext2 file systems on the partitions and turn off automated fsck: # mkfs.ext2 /dev/sde1 # tune2fs -c 0 /dev/sde1 Note: /dev/sdx you will need to find your USB device. Your USB key is now ready for installation. ===== 2. Download voyage ===== # cd /tmp # wget http://www.voyage.hk/download/voyage/voyage-current.tar.gz ===== 3. Unpack voyage ===== # tar --numeric-owner -zxvf voyage-current.tar.gz ===== Install voyage on USB key (option 1- Rsync) ===== Make sure your USB key is plugged in but not mounted. Go to voyage on your host: # cd /tmp/voyage-current mount the target as /mnt mount /dev/sde1 /mnt run rsync rsync -aH ./ /mnt goto /tmp cd .. ===== Install voyage on USB key option 2 - Voyage.update) ===== **This option currently has a bug in the inittab. I will retest at a later date. Use option 1 for now.** Make sure your USB key is plugged in but not mounted. a) Go to voyage on your host: # cd /tmp/voyage-current c) Start the voyage installation script: # ./usr/local/sbin/voyage.update root@spotflash4:/tmp/voyage-current# ./usr/local/sbin/voyage.update What would you like to do? 1 - Create new Voyage Linux disk 2 - Update existing Voyage configuration 3 - Exit (default=1 [Create new Voyage Linux disk]): 1 Where is the Voyage Linux distribution directory? (default=/tmp/voyage-current): What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 2 Please select Voyage profile: 1 - 4501/4801 2 - 4511/4521 3 - Generic PC 4 - Notebook (pcmcia) 5 - WRAP (default=5 [WRAP]): 3 What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 3 Which device accesses the target disk [/dev/hde]? /dev/sde Which partition should I use on /dev/sde for the Voyage system [1]? Where can I mount the target disk [/mnt/cf]? /mnt What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 4 Which loader do you want (grub or lilo) [grub]? Which partition is used for bootstrap [1]? What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 5 Select terminal type: 1 - Serial Terminal 2 - Console Interface (default=1 [Serial Terminal]): 2 What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 6 Configuration details: ---------------------- Distribution directory: /tmp/voyage-current Disk/Flash Device: /dev/sde Installation Partition: /dev/sde1 Bootstrap Partition: /dev/sde1 Will be mounted on: /mnt Target system profile: Generic PC Target console: standard Bootstrap installer: grub Bootstrap partition: /dev/sde1 OK to continue (y/n)? " This Will wipe out your disk. Look First" copyfiles.sh script completed What would you like to do? 1 - Specify Distribution Directory 2 - Select Target Profile 3 - Select Target Disk 4 - Select Target Bootstrap Loader 5 - Configure Target Console 6 - Copy Distribution to Target 7 - Exit (default=7 [Exit]): 7 ===== 'why Extlinux / Syslinux ===== [[http://syslinux.zytor.com/extlinux.php|Extlinux]] / [[http://syslinux.zytor.com/|Syslinux]] are simple and they just work*. You can edit the configure file without reinstalling. This can be used to build upgrade and rollback configurations. Ie: two or three usb drives that boot round robin (My next project). cd /tmp wget http://www.kernel.org/pub/linux/utils/boot/syslinux/Old/syslinux-3.11.tar.gz tar -zxvf syslinux-3.11.tar.gz * Note:I started using Extlinux because the USB hard drive was found by the boot loader as sda and by the kernel as sdb. Extlinux corrected this issue for a time. extlinux, grub and lilo can have this error. When I can force the loader to boot the correct usb drive 100% of the time, I will add it to the wiki. I still like the simplicity of extlinux. ===== Install Extlinux ===== '' Mount the target disk after the Voyage.update script has run. mount /dev/sde1 /mnt Copy mbr.bin to the boot dir. This will help with any disk cloning. cp ./syslinux-3.11/mbr.bin /mnt/boot cp ./syslinux-3.11/extlinux/extlinux /mnt/boot create the configure file for extlinux echo " DEFAULT voyage display /boot/voyage.txt prompt 1 timeout 10 # voyage image LABEL voyage KERNEL /boot/vmlinuz-2.6.17-486-voyage APPEND vga=0x0f01 initrd=/boot/initrd.img-2.6.17-486-voyage root=/dev/sda1 ro # image #2 LABEL smp KERNEL /boot/vmlinuz-2.6.15-26-686 APPEND vga=0x0f01 initrd=/boot/initrd.img-2.6.15-26-686 root=/dev/sda1 ro ">/mnt/boot/extlinux.conf create the Voyage.txt file. echo " __ __ \ \/ /___ __ __ ___ ___ ___ \ // _ \\ \/ /,-_ |/ _ |/ -_) \/ \___/ \ / \___,\_ |\___| _/_/ _'_| { V o y a g e } - L i n u x < http://www.voyage.hk > Add your info here ">/mnt/boot/voyage.txt Install the loader. Note: This is the only time you have to run this set of commands. cd /mnt/boot ./extlinux $PWD #/mnt/boot is device /dev/sde1 cat mbr.bin >/dev/sde cd / umount /mnt ===== Boot your usb Drive ===== Post any feed back to the list. ===== Troubleshooting ===== I'm checking option 2. First time init is hanging "Init: no more process left in this runlevel" option 1 boots.