Sunday, September 13, 2009

How to mount Ubuntu LiveUSB

Recent Ubuntu releases have a LiveUSB creator that allows creation of a bootable USB flash device from the ISO CD images. It's also possible to make this LiveUSB persistent, thus allowing you to customise it once you've boot into it.

I use this as a tool to store Windows cleanup and maintenance tools. It's really useful that you can have a bootable device with a free Linux-based virus scanner and various Windows-based removal/cleanup tools stored in it. When a Windows computer is infected with a particularly hard to remove virus, just boot into the LiveUSB and remove it from there safely. The rest is simply copying the Windows-based tools stored in the LiveUSB to the mounted Windows partition, then continuing your work from within Windows itself.

Copying downloaded tools into an existing LiveUSB without booting into it is a simple mount away on Ubuntu. Simply make a mount point, and mount the squashfs image file. Persistent changes are stored in a file called casper-rw.

~$ sudo mkdir /media/liveusb
~$ sudo mount -o loop /media/disk/casper-rw /media/liveusb

Replace disk with the appropriate mount point Ubuntu selected. Just store your files in /media/liveusb/home/ubuntu/ and they will be available when you boot into the device. Once you're done, remember to unmount the image first before attempting to unmount the USB device:

~$ sudo umount /media/liveusb