Pages

04 March 2011

Creating a Debian live USB flash drive with persistence for non-techies

Foreword: "for non-techies" should perhaps be "for dummies" but it sounds better.

This tutorial aims at showing a fast, straightforward way of creating a  USB flash drive with Debian live installed using the persistence feature. It means that you can save changes back to the usb flash drive after you reboot your machine. It is written and carried out on a linux box, that is why I recommend using linux. There are many more options not covered in this article which are explained in detail in Debian-live's manual. You can find it here:

http://live.debian.net/manual/en/html/live-manual.html


In order to follow this tutorial you need:

-A machine with linux installed.
-A FAT  formatted usb flash drive of 4 GB (2GB will do since the image is 1.1 GB but this leaves little free space for persistence)
-A good internet connection to download an image of 1.1 GB.
-A basic knowledge of the command line.
-Sudo access to your machine. You must be in the sudoers file.
-Software/commands: bash, wget, mount, dd, gparted or alternatively fdisk (fdisk usage is not explained here)

1. Download a usb-hdd image from live.debian.net  A direct link to the latest stable release is here
In order to achieve that, open a terminal. Type:

$ wget http://cdimage.debian.org/cdimage/release/current-live/i386/usb-hdd/debian-live-6.0.0-i386-gnome-desktop.img





With a fairly good connection it should not take longer than 20 or 30 minutes.

2. Plug in the flash drive and open a terminal. Type:

$ mount (In order to know the device name of your flash drive).

There should be an entry similar to this one:


/dev/sdc1 on /media/Kingston DataTraveler G2: 4.0 GB Filesystem type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)

Here is important to remember /dev/sdc (your device name can be different like for example /dev/sdb) Just make sure that the name belongs to the usb you want to copy the live image to. Otherwise you risk losing important data.

3. Once the download is finished. Copy the image to the usb flash drive. In order to do that open a terminal and type:

$  dd if=debian-live-6.0.0-i386-gnome-desktop.img of=/dev/sdc (Remember to replace sdc with the actual name of your device.)



4. Wait for it to finish. (It might take a while)




5. It is time to make a new partition to use the space left on the flash drive to save changes. Then type:

$ sudo gparted


gparted interface looks like this:




6. Select the device from the drop down menu. Remember in this tutorial it is /dev/sdc
You must unmount the device. So first right click on it and select unmount.

7. Right click on the device and select new. A new window opens.



8. Complete:
-Primary partition
-ext2
-label: live-rw
Select Add and then apply changes. Unplug. Now you can boot from the usb flash drive using persistence.

9. In order to use persistence you have to boot a machine from the usb. You must first ensure that your bios is capable of booting from usb. Enter the bios and check that.

First thing you will be presented with the splash screen:



10. Press ESC to see the boot prompt and type "live persistent" (Without quotes)



You are done. You can now use the system as you like and all the changes that you make will be saved in the partition you've created.



Only one thing left to say: ENJOY!!!!