Installing any Live Linux distribution onto a USB pendrive

From mi-linux
Revision as of 13:47, 14 February 2007 by 0608230 (talk | contribs)
Jump to navigationJump to search

posted by Andy Fletcher, 0608230

Installing any Live Linux distribution onto a USB pendrive

Using syslinux, you can now install any Live Linux distribution onto a USB pendrive. This tutorial assumes that you have at least read and understood the Installing Slax Linux onto a USB pendrive tutorial, and have a basic understanding of the command line features of either Windows or Linux.

Some of the steps in this tutorial that were covered in the Installing Slax Linux onto a USB pendrive tutorial are only explained briefly in this tutorial, so if you become stuck, go back and read the Slax tutorial again.

Basic Essentials

System Requirements

Please ensure that you sufficient hardware to support your chosen OS. Also ensure that your BIOS supports booting from USB mass storage device. You can view your systems specifications by clicking Start>Run and entering "DXDIAG" followed by "Enter". Refer to your motherboard handbook, or load the BIOS (see #6 of the Installing Slax Linux onto a USB pendrive tutorial for instructions) to check that it allows USB booting.

Tutorial

It is recommended that you read through this tutorial fully before attempting any of the steps. For this tutorial, i will be using the Knoppix Linux Live distribution. You may use whichever distribution suits your tastes and needs, however, before we begin, beware that when i booted Ubuntu from my pendrive, it was very slow and unstable. Plus, the notoriously slow initial boot time of Ubuntu renders it unsuitable for pendrive booting, in which you may be switching between Linux and Windows on a regular basis. Knoppix, on the other hand, ran much more smoothly for me, and features persistent image and save state functions that allow you to easily save and load your settings and files each time you boot. Choose whichever distribution you wish to use first, and then if it doesn't run all that well, try another, and add your experiences to the Compatibility Thread below.

Different sections of this tutorial can be completed in either Windows, or from the Ubuntu Live CD. Some sections are easier in Windows, and other in Linux, so if you get stuck, try loading Ubuntu carrying out the steps from there.

1. Ensure you'r pendrive has space to store your chosen OS, files and settings (100MB or so) plus any Windows files you may also want to store. Format your pendrive in FAT or FAT16. As usual, backup any important data, as it will be erased.

2. You can complete this step in either Windows or Linux-if you receive an error using Windows, then follow the steps for using Ubuntu. You don't need to carry out the steps twice, just once in your preffered OS:

Windows

Download the latest release of SYSLINUX and extract the contents to a folder named "syslinux" on the root of your C:\ drive. Hit Start>Run and enter "cmd" follwed by enter. The command prompt will open, displaying something like "C:\Documents and Settings\YOURNAME". enter "cd .." followed by enter a number of time until the command line reads "C:\". Type "cd syslinux" to jump to the syslinux folder. The command line should now read "C:\syslinux\". Enter "syslinux.exe X:" where X represents the drive letter of your pendrive. Make sure that you enter the correct drive letter, else you may screw up your Windows installation.

If this has been sucessful, carry on to the next step. If you have received an error message, ensure that you have selected the correct directory and that syslinux.exe is spelt correctly. Boot into Linux if you cannot get it to work.

Ubuntu Linux

Burn the Ubuntu Live Linux distribution to CD or DVD, and set your BIOS to boot from it. Using the Synaptic Package Manager (go to System>Administration>Synaptic package manager) install "mtools" and "syslinux". Then open a command prompt. type "sufo fdisk -l" to list the your drives. Your HDD's should show up as "hda" or similar, and your pendrive should appears as either "sda" or "sde". You can check by mounting and unmounting your pendrive through the command prompt and checking its status in the file browser. mount or unmount the pendrive by entering "sudo umount /dev/YOURPENDRIVESNAME(e.g sda)" and "sudo mount /dev/YOURPENDRIVESNAME(e.g sda)". If your pendrive mounts and unmounts as you enter these commands, you can be sure that you have the correct device. Another method is to compare the size of your drives as displayed in the command prompt-your pendrive is probably considerably smaller than your HDD's.

Now, enter "cd ~" followed by enter and "sudo umount /dev/YOURPENDRIVESNAME(e.g sda)". This command will install the bootloader on your pendrive: "syslinux /dev/YOURPENDRIVESNAME(e.g sda)".

3. Shut down your OS and reboot. Set the boot priority to boot from USB-HDD or USB-ZIP. Your pendrive should be listed somewhere in the text that appears as your PC boots, and your pendrives status LED should flash (if it has one). If it doesnt, reboot and/or remove and re-insert until it does. You should see the follwoing message: "SYSLINUX 3.11 2005-09-02 EBIOS Copyright (C) 1994-2005 H. Peter Anvin Could not find kernel image: linux boot:". Congratulations-you've just made your pendrive bootable! If not, check to make sure that the file "ldlinux.sys" is present in the root.

4. Boot into either Ubuntu (from the Live CD) or Windows, your choice. Now comes the fun part. Copy all of the files from your chosen distribution into the root of your pendrive.

5. Open the ".boot" or "boot" folder and copy all of the files into the root of your pendrive. You can now delete the ".boot" or "boot" folder.

6. Rename "ioslinux" to "syslinux", ensuring not to rename it to "syslinux.cfg-it is already a .cfg file, so just call it "syslinux".

7. Boot into Linux. Click the penguin icon