The DistRogue

Monday, August 13, 2007

How to turn your USB key into a bootable PCLinuxOS system

If you're a hardcore Linux geek, you'll want to take Tux with you wherever you go. Even if you're a normal user, you probably wouldn't mind having a penguin in your pocket. These are 100%-tested instructions on installing PCLinuxOS 2007 or later (2007, at the time of writing, is the latest version) to a gigabyte-or-larger USB key.
1. Download the PCLinuxOS CD image and open it in an archive manager.
2. Mount your USB key. It has to have one partition on it with more than 700MB of free space left, but any type of filesystem works. I used FAT32 for my key. Also, make absolutely sure that the partition is bootable (you can use a partition manager like fdisk or GParted for this). That means that its boot flag should be on.
3. Extract the contents of the CD image to your USB key. Don't make a folder on your USB key and extract them into the folder; otherwise, it won't boot.
4. Run these commands from the terminal:

cd
sudo grub-install --no-floppy --root-directory=. /dev/sdX

!CAUTION! Be careful with that command; if you do it wrong (for instance, use /dev/sda on a newer system), you might screw up your MBR, in which case, you'd better have a live CD ready. If you did it wrong, just run "grub-install /dev/sda" from a live CD. You do have one, right?
5. Make a file under the boot/grub folder in your USB key called menu.lst, with this in it:

title PCLinuxOS 2007
root (hd0,0)
kernel /isolinux/vmlinuz bootfrom=/dev/sda1 root=/dev/rd/3 acpi=on vga=788 keyb=us splash=silent fstab=rw,noauto
initrd /isolinux/initrd.gz
boot

6. Reboot and enable USB-HDD or USB-ZIP booting in your computer's BIOS if it isn't already enabled.
7. Enjoy.
I used PCLinuxOS for this, but it probably works with other distros, with some minor tweaking in menu.lst. The original tutorial can be found here, written for Damn Small Linux.
From PCLinuxOS 2007,
The DistRogue.

Labels: , , ,

3 Comments:

Anonymous Anonymous said...

Thanks for the instructions. I will try them soon my PC. Please note that PCLinuxOS doesn't use the sudo command, but it uses the su command instead. So you may change the post accordingly to make it really 100% :)

9:00 AM  
Blogger DJ Gentoo said...

Although PCLinuxOS is the OS being put on the key, it might not be the OS you're doing it from... ;)

9:57 AM  
Blogger Kyle said...

I ran into some issues with this. I followed your instructions on my pclos machine and everything went smoothly. I then attempted to load from my flash drive and is prints Grub on the screen and then hangs.

I did use a customized version of pclos that I created but I don't think that would effect bootup, since the customizations are all post boot. I'm currently downloading the stock version of pclos to check if my version is the cause of this error. Any input would be appreciated.

12:43 AM  

Post a Comment

<< Home