Advertisment

Booting Linux off USB Storage

author-image
PANKAJ
New Update

Live Linux distros that can boot directly from CDs, such as Knoppix and SuSe Live Eval, are already quite popular. But for a change, Puppy Linux is a new live distro that can boot directly from USB-based storage devices. You can run it from a CD, Compact Flash card or a USB Pendrive. But, whichever device you choose to boot it from, it must have more than 50 MB of storage capacity and must be able to emulate a USB hard drive. We’ll see how you can boot it off a 64 MB Iomega Mini Disk.

Advertisment

What you need are our this month’s PCQXtreme CD, a machine running PCQLinux 8 (with support for booting off a USB device in its BIOS) and a USB drive.

Don't let Puppy

Linux's small footprint deceive you. It packs in a lot of apps

       STEP

ONE 
           




Copy the file called cd-puppy.iso from the CD to your home directory and mount it as a loop back device in a blank folder, as below.

Advertisment



#cp cd-puppy.iso ~



#mkdir /puppy


#mount —o loop ~/cd-puppy.iso /puppy

       STEP

TWO 
           




This will make all the content of the iso file available in the /puppy directory.

Mount your USB drive to a blank folder and copy two files, vmlinuz and image.gz, from /puppy to the USB drive. Here vmlinuz is the customized kernel (it is just 1.1 MB) and image.gz is the image of the Linux partition, which will be completely mounted onto the RAM, so that you can remove the USB drive once Linux has loaded.

Advertisment
Mounting a usb drive
Linux recognizes a Flash device as a SCSI drive and recognizes it as the first free SCSI device. So, in a desktop PC the first USB drive will be allocated to the device /dev/sda1.



To mount the drive, make a new folder, such as /mnt/usb, and run the following command.


#mount /dev/sdax /mnt/usb


Replace the x from sdax with the partition number of the drive that you want to mount. 

       STEP

THREE 
           




Now you need to configure the boot loader by using syslinux. Create a configuration file for syslinux called syslinux.cfg by opening your text editor and save it to the USB drive (ie, /mnt/usb)by writing these lines.

default vmlinuz root=/dev/ram0 initrd=image.gz



append ramdisk_size=49152 PSLEEP=25 

Advertisment

Now run the commands as below. 

#umount /mnt/usb



#syslinux /dev/sda1

Finally, to boot the distro, restart your machine, enter its BIOS and set the first boot device to USB-HDD. The machine will now boot directly into Puppy Linux. This distro has a GUI with a lot of goodies such as Mozilla for browsing, Scribus for desktop publishing, LinNeighborhood for browsing the network and CD burning software. Enjoy your portable Linux.

Anindya Roy

Advertisment