How to create a persistent usb?

How can I create a persistent USB from Command Line Interface on Ubuntu?

Is there any USB creator tool for making an USB persistent ?


Adding to @jpf137's answer, there is a way to make an existing live USB persistent.

  1. Make a file in the root of the live USB called casper-rw using dd like this:

    dd if=/dev/zero of=/path/to/casper-rw bs=1M count=512
    
  2. Make a filesystem in casper-rw like this:

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

Done.


Yes there is a USB creator tool for making persistent USB called mkusb that should satisfy your needs.

It has both a GUI version

sudo apt-get install mkusb

and a text only [CLI] version

sudo apt-get install mkusb-nox

I suppose the second one is what you want here.

It works very nicely and I have used it even on the current (as on 18-09-16) Ubuntu 16.04.

You can find the documentation here. If you want to give the GUI version a shot, check out these answers too.

  • https://askubuntu.com/a/815493/585316

  • https://askubuntu.com/a/753163/585316


use:

usb-creator-gtk

Look up your .iso and device to use, then choose "stored in reserved extra space" (instead of discarded on shutdown) to make the drive persistent.


mkusb-nox works in text mode and creates live-only USB boot drives (not persistent live drives).

mkusb (mkusb-dus) works in graphics mode and text mode and can create both live-only and persistent live USB boot drives.

There is new version of mkusb, with the name dus. It can create persistent live drives, when running in text mode. It has migrated from the testing phase to the stable PPA ppa:mkusb/ppa, when this update was written at mkusb version 12.1.5.

See the following link,

dus - a revamped interface of mkusb and mkusb-nox

Install from the normal (stable) mkusb PPA

Install from the unstable mkusb PPA