Linux.com

Home Linux Community Community Blogs General Linux Creating a Debian Live USB Flash Drive with Persistence for Non-Techies

Creating a Debian Live USB Flash Drive with Persistence for Non-Techies

This tutorial aims at showing a fast, straightforward way of creating a  USB flash drive with Debian live installed (on it) using the persistence feature. It means that you can automatically save changes back to the USB flash drive before shutting your machine down.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.
This tutorial aims at showing a fast, straightforward way of creating a  USB flash drive with Debian live installed (on it) using the persistence feature. It means that you can automatically save changes back to the USB flash drive before shutting your machine down.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.
 
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 and gparted. 
 
 
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 pendrive).
 
 
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. Gparted interface is very intuitive. 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 (To create a new partition). A new window opens.
 


 
8. Complete:
 
- Create as: Primary partition
 
-File System: ext2 
 
-label: live-rw
 
Select Add and then apply changes. You'll see something similar to this:




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 device. 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!!!!
 

Comments

Subscribe to Comments Feed
  • Quinn Said:

    Wow, thanks for that! I was trying to do this, and it was giving me problems. Just curious: would this work on Lubuntu as well?

  • Hobby Logic Said:

    For Quinn: The steps are corrects 100% For Author: The shortest and best article regarding the subject. Thanks!

  • Garry Conn Said:

    Thanks for creating the tutorial. Quick question -- why do you have type live persistent compared to just loading the Live option?

  • Oz Said:

    Hello. I've followed those instructions, but I cannot access a wireless network from the live install nor see the live-rw filesystem there. I downloaded the xfce4 version (that shouldn't matter, right?). Do you know what could be happening?? Thanks in advance!

  • Rulet Said:

    Hello chals. Do you know the working method of installing debian-installer on such a live-flash with Debian Wheezy?

  • Lúcio Said:

    Fiz esse procedimento com uma distro chamada SOluOS e funcionou perfeitamente. Gostaria de saber se esse procedimento funcionaria com uma distro baseada em Ubuntu. Obrigado.

  • Chinux Said:

    At the end the when it is rebooting, do we have to type live persistent each time we turn it on? or is it just one time? Thanks for the tutorial.

  • fenriv Said:

    You can create new menu section in /syslinux/live.cfg on top of other menu items: label persistent menu label Live persistent kernel /live/vmlinuz append initrd=/live/initrd.img boot=live persistent quiet

  • FBP Said:

    I've tried this with debian-live-7.0.0-i386-xfce-desktop.img. When I hit ESC to get the boot prompt and then type live persistent I get this error: Could not find kernel image: live Hmmm... The live usb boots OK, but I can't get the persistence to work. Ideas?

  • logan Said:

    Same exact thing literally that same EXACT problem try pressing tab at splash and adding "persistent" to the end of the string also try replacing your live.cfg with this one: https://docs.google.com/file/d/0B5-cDpAgfDfsMExwVjUwSTNlOWc/edit?usp=sharing

  • FBP Said:

    Thank you for your reply. I hit tab at splash, type persistent, hit enter. I get "Could not find ramdisk image: /live/initrd1.imgpersistent". Hmmm... Start over. So: I started with a FAT32-formatted flash drive. I did the dd command with debian-live-7.0.0-i386-xfce-desktop.iso. Then I made an ext2 partition labeled live-rw in the remaining space. This makes a bootable flash drive, but persistence doesn't work. Also I can't edit /syslinux/live.cfg when booted from the flash drive (no persistence), but when booted from another drive I can't mount the partition, /dev/sdb1, that the dd command created. It shows up in gparted as "File system unknown" and can't be mounted, so I can't edit /syslinux/live.cfg that way either. I'm confused :\

Upcoming Training Courses

  1. LF331 Developing Linux Device Drivers
    03 Jun » 07 Jun - Virtual
    Details
  2. LF411 Embedded Linux Development
    24 Jun » 28 Jun - Silicon Valley
    Details
  3. LF422 High Availability Linux Architecture
    15 Jul » 18 Jul - New York
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board