A Linux live USB drive is normally an empty slate every time you start it. You can start it, install programs, save files and change settings. However, once you restart, all changes will be deleted and you will be returned to a new system. This can be useful. However, if you want to use a system that continues to work where you left off, you can create a live USB drive with persistent storage.
How Persistent Storage Works
Assign up to 4 GB of USB storage for a persistent overlay file. Any changes that you make to the system, such as For example, saving a file to your desktop, changing settings in an application, or installing a program are stored in the overlay file. If you boot the USB drive on any computer, your files, settings, and installed programs are there.
This is an ideal feature if you want to keep a live Linux system on a USB drive and use it on different PCs. You do not have to set up your system every time you start it. You do not require persistence if you only install Ubuntu from a USB drive and then run it from your hard drive.
There are some limitations. You can not change system files like the kernel. You can not perform major system upgrades. You also can not install any hardware drivers. However, you can install most applications. You can even update most installed applications so you can be sure your permanent USB drive has the latest version of the Web browser of your choice.
Persistence does not work with any Linux distribution. We tested it with the latest versions of Ubuntu ̵
How to create a Ubuntu USB permanent drive on Ubuntu
You need a computer that already runs Ubuntu to perform this operation. You also need a USB drive with enough storage capacity to set up persistence. We used a 16 GB drive, but an 8 GB drive would have worked too. The larger the drive, the more durable the memory can be.
The grub, boot, and Ubuntu partitions occupy less than 2 GB. The rest of the space on the USB drive is used for the partition
casper-rw is used for permanent storage. For example, the software and settings files you have installed are stored here.
usbdata is formatted with the NTFS file system. It will be available for Linux, Windows and MacOS. This partition is also available in Live Ubuntu on the USB drive. This means that any files copied from another computer to the partition
usbdata can be accessed on your Ubuntu.
In other words, the partition
usbdata acts as a "shared folder" between your Ubuntu and any other computer to which you connect your USB drive. That's pretty cool.
The following screenshot shows what the resulting partitions looked like on our 16 GB drive.
Although a 16 GB USB drive was used for investigating items, an 8 GB drive would work just as well. It just has less storage space.
First, you need to download the Ubuntu ISO file you want to put on the USB drive.
Second, the tool you want to use is
mkusb . It is not part of the standard Ubuntu installation. You have to install it. Enter the following three commands. The first command adds the repository
mkusb so Ubuntu knows where
mkusb needs to be installed.
sudo add-apt-repository ppa: mkusb / ppa
The next command forces Ubuntu to update its package lists for the registered repositories.
sudo apt-get update
We Now install the package
mkusb with the following command:
sudo apt install - -install-recommends mkusb mkusb-nox usb-pack-efi
mkusb does an excellent job of identifying USB drives. That's great, but there's nothing better than knowing it yourself. If
mkusb states that a specific drive is completely deleted, you can be sure that it is the USB drive you want to use, not another device in your system.
In a terminal window, type the following command. The command
lsblk lists the block devices on your computer. Each drive is assigned a block device.
The output of
lsblk displays the drives currently connected to your computer. On this computer there is an internal disk named
sda and a partition named
Connect your USB drive and re-use the command
lsblk . The edition of
lsblk has changed. The USB drive will now be listed in the output.
The list contains a new entry named
sdb . It has a partition called
sdb1 . This is the USB drive.
If your computer already has multiple drives, the name of your USB drive will be different. Regardless of the designation, the device that was not in the previous
lsblk listing must be the USB drive.
Once you know which device you have USB drive, you can start
mkusb . Press the Super (Windows) key and enter "mkusb". The symbol
mkusb is displayed. Click the icon or press Enter.
A dialog box will ask if you want to run the dus version (Do USB Stuff) of
mkusb . Click the "Yes" button.
A terminal window with a black background appears and a dialog box prompts for your password. Enter your password and click "OK".
Warning : This action deletes the contents of the USB drive!
Click Click "OK" in the warning dialog to confirm that you understand this.
Click the "Install (Create Boot Device)" entry in the list, and then click "OK Button.
Select the entry "Persistent live" – Debian and Ubuntu only in the list and click the "OK" button. 
A file browser dialog appears, navigate to the Ubuntu ISO file you downloaded and select it and click the green OK button.
In the screenshot below, select the Ubuntu 19.04 ISO Image from the Downloads folder.
A list of USB drives connected to your computer is displayed, allowing you to select the appropriate USB drive
To the one for the The test computer used was only one USB drive connected. As we confirmed above, it says
sdb . We have confirmed that this is the USB drive we want to use so we can be confident. Click the OK button".
When the dialog shown below appears, select the entry "usb-pack-efi (standard ISO from scratch)" in the list and Click the OK button".
You have another option to choose from. You can specify the percentage of disk space that should be used for persistent storage in partition
casper-rw . The rest is used for the
usbdata partition, which has the NTFS file system and can also be accessed from Windows PCs and Macs.
If you are happy to have the available space on the USB drive Equal to these two partitions, leave the slider at its default value and click the "OK" button.
Now we just have to specify
mkusb ] that we are satisfied with all our decisions and that it should continue.
To be clear, this is the last point where you can resign. If you are sure you want to continue, select the Go radio button and click the Go button.
A progress bar indicates how close the creation is. The process is complete.
The final phase of creation is to transfer the file system buffers to the USB drive. It is also recommended to wait for the phrase "work done" to be displayed. This indicates that the process is complete.
When the process is complete, a dialog box with the phrase "work done" will be highlighted in green. Click the OK button". If other dialog boxes appear, close them by clicking the Quit button.
A few more lines in the output window are traversed. You will be asked to press Enter when done.
When you press Enter, the terminal window closes. You can now either reboot your computer and boot from the USB drive, or disconnect the USB drive from the computer, transfer it to another computer, and boot.
RELATED: How to Start Your Computer from a CD or DVD USB Drive
Creating a permanent Ubuntu USB drive under Windows
Update : The following method (with Linux Live USB Creator) stops working with the latest versions of Ubuntu. You must use the method described above instead.
You need a large enough USB drive to set up persistence. Ubuntu itself states that it requires 2GB of space on the USB drive and you need extra storage for the persistent storage. So if you have a 4GB USB drive, you can only have 2GB of persistent storage. To get the maximum storage space, you need a USB drive that is at least 6 GB in size.
Unfortunately, Ubuntu's officially recommended Rufus tool for creating Ubuntu USB Live drives on Windows does not support creating systems with persistent storage. We recommend using Rufus to create most Ubuntu Live USB drives, but you will need to use a different tool for this particular job.
Download the Ubuntu ISO file that you want to save to the USB drive and the Linux Live USB Creator application.
Insert the desired USB drive into the USB port of your computer and start the just-installed "LiLi USB Creator" application.
Select the desired USB drive in "Step 1: Select your key from the box.
Enter your downloaded Ubuntu ISO file. Under "Step 2: Select a Source", click the "ISO / IMG / ZIP" button, navigate to the ISO file on your computer and double-click on it.
Use the options in the "Step 3: Persistence" section to determine how much space to use for persistent storage on the USB drive. Drag the slider all the way to the right to select the maximum memory size.
<img class = "alignnone wp-image-283630 size-full" data-pagespeed-lazy-src = "https://www.howtogeek.com/wp-content/uploads/2016/12/ximg_58473a973fc57.png .pagespeed.gp + jp + jw + pj + ws + js + rj + rp + rw + ri + cp + md.ic.ZviRbQB7za.jpg "alt =" Assigning persistent storage to Linux Live USB Creator "width =" 650 "height =" 114 "src =" /pagespeed_static / 1. JiBnMqyl6S.gif "onload =" pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); "onerror =" this.onerror = null; pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); configure To create your live persistent memory USB drive, click the flash icon under "Step 5: Create."
<img class = "alignnone wp-image-283633 size-full" data-pagespeed- lazy-src = "https://www.howtogeek.com/wp-content/uploads/2016/12/ximg_58473ae1b9f75.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri + cp + md.ic.P7uwlwab2B.jpg "alt =" Creating a Persistence Progress File in LiLi USB Creator "width =" 6 50 "height =" 257 "src =" /pagespeed_static/1.JiBnMqyl6S.gif "onload =" pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); "onerror =" this.onerror = null; pagespeed.lazyLoadImages.loadIfVisibleAndMay] Tool some time to create the drive. When the process is complete, the message "Your LinuxLive key is now active and ready!" Appears. Displayed. You can now either reboot your computer and boot from the USB drive, or disconnect the USB drive from the computer, transfer it to another computer, and boot.
<img class = "alignnone wp-image-283635 size-full" data-pagespeed-lazy-src = "https://www.howtogeek.com/wp-content/uploads/2016/12/ximg_58473d89e3cd7.png .pagespeed.gp + jp + jw + pj + ws + js + rj + rp + rw + ri + cp + md.ic.88LzpQ4etq.jpg "alt =" Linux live USB creation completed in LiLi "width =" 650 "height =" 152 "src =" /pagespeed_static/1.JiBnMqyl6S.gif "onload =" pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); " onerror = "this.onerror = null; pagespeed.lazyLoadImages.loadIfIfVisibleA 
To verify that permanent storage is working properly, start the USB drive and create a folder on the desktop, or save one File on the desktop, then shut down your system and reboot the live USB drive.You should see the folder or file you put on the desktop.