Wolvix Forums

Documentation => Guides, Howtos, Tips & Tricks => Topic started by: Wolven on September 28, 2008, 12:40:43 AM



Title: How to install Wolvix to a USB flash drive manually (running Linux)
Post by: Wolven on September 28, 2008, 12:40:43 AM
Introduction:

Sometimes the circumstances requires that you perform a Wolvix USB install manually instead of using the superb USB installer in the Wolvix Control Panel. This guide will describe how to do this from a running Linux distribution. Most of the steps here apply to Windows as well, but that's beyond the scope of this guide.

Requirements:

You'll need a motherboard that actually supports USB booting and you need to make sure that the BIOS is set to use this feature. Pretty obvious you might think, but you'd be surprised how many times I've been asked why Wolvix won't boot from USB, just to find out that the users motherboard does not support USB booting... You'll also need a USB flash drive which can hold the target Wolvix edition. It's also possible to use certain portable music players for this. You need be somewhat familiar with how Linux names storages devices hdXY, sdXY, etc. An lastly you need a running Linux install and a copy of the Wolvix ISO.

Mounting the ISO:

First we need a work directory for our files, (the ISO and syslinux) a directory to mount the Wolvix ISO in so we can get to it's content, and a directory to mount the USB flash drive, so let's create them. Launch a terminal and type:
Code:
mkdir -p work/{iso_mount,usb_mount}
What you call your directories doesn't matter, but I chose to create a directory called 'work' with the sub directories called 'iso_mount' and usb_mount inside it.

Change to the work directory an place a copy of the chosen Wolvix ISO inside it. How you choose to do this is up to you. Copy it from another place or download it from one of the mirrors. From now on I'll refer to the Wolvix ISO as 'wolvix.iso' regardless of which version and/or edition you use, replace the file name as appropriate in your code.
Code:
cd work
If you issue the 'ls' command now you should see something like this:
Code:
ls
Quote
iso_mount usb_mount  wolvix.iso


Now 'su' to the root user and mount the wolvix.iso in the iso_mount directory. (Only root can mount)
Code:
su
mount -o loop wolvix.iso iso_mount
if you look inside the iso_mount directory now you should see two sub directories. 'boot' and 'wolvix'
Code:
ls iso_mount
Quote
boot  wolvix


We'll copy these two directories (and their content) to the USB flash drive a bit later, but first we need to prepare the USB flash drive.

Perpare the USB flash drive: (Optional)

WARNING! The following steps will format your USB flash drive, so make sure there's nothing on it that you'd like to keep. Also make sure you get your device name right, or else you might format one of your hard drive partitions.

OK you have been warned, so if you loose important data or accidentally format your hard drive, it's your own fault. Also note that this step is optional.

Most USB flash drives comes pre-formated with the FAT16 file system which can't handle file names longer than 8 characters with a 3 character extension. (xxxxxxxx.xyz) So I always re-format it to FAT32. You don't have to do this. (FAT32 will "steal" a bit more space off the USB flash drive than FAT16, but this has been accounted for when I created the Wolvix 1.1.0 Hunter/Cub ISOs)

NOTE! Replace 'sdb1' with your actual USB flash drive partition. Mine is sdb1 as I have a SATA hard drive which claims the sda device name. Your flash drive partition might be sda1, sdb1, sdc1, sdd1, or what ever, depending on your hardware. Figure this out and double check your typing before you do this!
Code:
fdisk -l

Right let's get down to it. Insert your flash drive to a USB slot, but do not mount it just yet. Then format it to FAT32: (Do this as root)
Code:
mkdosfs -F 32 /dev/sdb1

Copying files from the ISO to the flash drive:

Hopefully no important data was lost and no hard drives got formated if you did the step above... So let's mount the flash drive.
Code:
mount /dev/sdb1 usb_mount
Again you need to replace 'sdb1' with what applies to your system.

Time to copy the files to the flash drive. This might take a good while and the indicator light on the flash drive (if it has one) might stop flashing, but do not remove the flash drive from the USB slot before it's unmounted again, as this might destroy the drive.
Code:
cp -a iso_mount/* usb_mount

When the copy process is done and you've verified that the files was actually copied over, you need to unmount the flash drive again. This might also take a while, as sometimes the copy process does not finish up before you unmount the drive.
Code:
umount usb_mount

Installing syslinux:

In order to make the USB flash drive bootable we need to install syslinux on it. This has to be done while the drive is unmounted. So make sure of that.

Obtain the latest syslinux archive from: http://www.kernel.org/pub/linux/utils/boot/syslinux/ At the time of writing, this is version 3.72 (You can do this as your regular user)
Code:
wget http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.72.tar.gz

Extract the archive.
Code:
tar -xvf syslinux-3.72.tar.gz

Change to the syslinux-3.72/linux directory.
Code:
cd syslinux-3.72/linux/

Install syslinux to the flash drive. (You need to do this as root)
Code:
./syslinux /dev/sdb1
Once again. Make sure you replace 'sdb1' with what applies to your system.

Cleaning up and rebooting:

Alright, we're done. What's left to do is just to clean up the work directory.

Unmount the ISO.
Code:
cd ../../
umount iso_mount

Remove any files you want with the 'rm' and any directories you want with 'rm -r'
Code:
rm foobar_file
rm -r foobar_dir

Now you can reboot your computer with the USB flash drive still in the USB port and hopefully Wolvix will boot like it should from the flash drive. If not, double check your BIOS boot settings and that your motherboard supports USB booting.


Title: Re: How to install Wolvix to a USB flash drive manually (running Linux)
Post by: martinultima on September 28, 2008, 01:24:42 AM
Just a tip -- for large flash drives (I think 2GB+, might be 512MB, I don't remember honestly) you need to create two partitions.  Some information (the instructions are specific to my LiveUSB scripts, but the general principle is the same for any distro): http://www.ultimalinux.com/wiki/Mkliveusb#Flash_drives_over_512MB