I am currently using Ubuntu directly from the USB drive because I have problems with my hard drive. I would like to know how to backup my bootable USB drive after each use so that I can save files and programs without uploading them to a cloud service.

In other words, is there a way that I can save programs and/or files using the bootable USB if my hard drive is not usable?


The feature you want is called Persistence.

If you want to make a new USB, with persistence:

Many Linux USB creators offer an option to enable Persistence.

In Ubuntu's USB creator:

Ubuntu's USB Creator - Persistence

And Unetbootin (Windows tool to create Linux bootable USBs):


If you want to make your existing USB Persistent:

  1. Create an empty file called casper-rw in the USB's root using the disk-writing tool dd.

    dd if=/dev/zero of=/path/to/usb/casper-rw bs=2G count=1

    This will create 2 GB of storage for your files and programs. To increase it, modify the 2G in the command to increase. (For example, to get 4 GB of storage, 2G would be replaced with 4G)

    Replace /path/to/usb with the path to your USB (usually along the lines of /media/USERNAME/USB_NAME

  2. Make a filesystem on that file:

    mkfs.ext4 /path/to/usb/casper-rw
  3. Edit the boot/grub/grub.cfg file in your pen-drive's root. Look for the line starting with linux. Before the -- at the end, add persistent; so that the line's ending looks like: persistent --.

Now whatever changes you make, they'll be saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.