How To Create Persistent Live USB On Ubuntu
There are many tools available to create bootable USB drive on Linux. We have already reviewed a few such tools, namely Etcher, Bootiso, and MultiCD. If you don’t want to use these third-party tools, there is a built-in command line tool called dd (Data Duplicator) available to create a bootable USB drives. Using the live bootable medium, we can test the Linux distributions without having to install them on the hard drive. We can also use the live cd for troubleshooting purposes as well. When you try the Live USB, you can do all sort of things, such as installing applications, downloading files, playing media, creating files and folders, customizing it as per your liking and a lot more. However once you reboot the system, all of the said changes will be lost. Because, you are working on a live OS. What if you want to make all changes remain intact even after rebooted the system? That’s what we are going to do now. This tutorial will teach you how to create persistent Live USB using Mkusb tool on Ubuntu and its variants.
You can use the persistent live USB as the way you use the regular Laptop/Desktop system. You can install applications, save files an folders, customize the system as you wish etc. All the changes you made in the live system will remain even after you reboot or shutdown it. To put this in simple words, the persistent storage Live USB will act like a portable computer. You can keep it with you all the time, plug it on any system and start using it the OS anywhere.
I tested this guide on Ubuntu 18.04 LTS desktop. I successfully created a persistent live USB drive with Ubuntu 18.04 LTS desktop.
What is mkusb?
Mkusb is a graphical utility to make bootable drives on Ubuntu Linux. It uses dd tool under the hood to create boot drives. Not just regular live bootable drives, Mkusb can also create persistent storage live USBs as well. The target device of Mkusb is not always a USB drive, but a mass storage device. Sometimes it could be an internal drive or an eSATA drive. But not to worry! It helps you to select the correct target device and avoid overwriting the other devices. Mkusb will use ‘the whole device’, actually only the head end (size of the iso file), but the rest of the device is not available.
The developer has created an official PPA for mkusb. So installation won’t be a big deal.
First, make sure you have enabled [Universe] repository:
$ sudo add-apt-repository universe
Then run the following commands one by one to install mkusb on Ubuntu and its derivatives like Linux mint.
$ sudo add-apt-repository ppa:mkusb/ppa
$ sudo apt update
$ sudo apt install --install-recommends mkusb mkusb-nox usb-pack-efi
Create Persistent Live USB On Ubuntu Using mkusb
Now, plug-in a USB drive and launch mkusb from the Dash or menu.
It will prompt you whether you want to run mkusb dus version. Dus is short for Do USB stuff. Click Yes to continue.
Mkusb requires sudo permissions in order to write the ISO to the target device. Enter your sudo password and click OK.
As stated already, Mkusb will use the whole target device and the target device will be completely overwritten. Click OK to continue.
In the next screen, you will the list of tasks the mkusb can do. Here is the main tasks that mkusb will do for you.
- Install (make a boot device),
- Restore to a standard storage device,
- Wipe a device,
- Backup persistent live home,
- Restore persistent live home
Choose the first option (i.e. Install (make a boot device)) to create persistent storage live USB device.
In the next screen, choose “Persistent live – only Debian and Ubuntu” option. Make sure you have inserted the USB drive.
Next choose the ISO that you want to write to the usb drive.
After choosing the ISO file, you will be presented with the following screen. If you have only one target device, Mkusb will automatically choose it for you. If you inserted multiple drives, choose the one from the list.
Double check the target device and click OK to continue. All data in the selected drive will be lost!
In the next screen, choose “upefi usb-pack-efi (default grub from ISO file)” option. This option will support UEFI bios with secure boot. If you don’t know what option to choose, just click “use default” option.
Next, select the percentage of the available space for persistence. The default value is 50%. The rest of the space will be used for storage. Again, if you don’t know what to choose, just leave the default value and click OK to continue.
Finally, double check if everything is correct (the target device, ISO file etc.) and choose “Go Yes, I want to go ahead” option from the list and click Go again to start creating persistent storage live USB.
Now, mkusb will start preparing the USb device to create persistent live usb drive. It will partition the USB device and copy all the files from ISO to the usb device. It will take a few minutes.
Once the live usb creation is completed successfully, you will be greeted with the following message.
Congratulations! We’ve just created a persistent storage live USB drive!! Click OK to close this message. And click Quit to close mkusb utility.
You can verify if the USB has been partitioned and ISO files have been copied to USB drive from the file manager.
Now, restart your system and boot it with the newly created USB system and start using the persistent live USB system.
Please note that if you have latest UEFI BIOS with secure boot, you may not able to boot the persistent USB. In that case, turn off secure boot from BIOS and try.
And also, when you boot from persistent USB, you will not see the Grub menu of the existing host OS. Because, the persistent live USB has its own GRUB now. You will see separate “Persistent live” and “live” options in the grub menu entries.
As stated already, you can use this USB device like a portable system. You can do whatever you want to do in the persistent USB live system. Install new applications, download files, create folders and customize the look of the live OS. All changes made in the live OS will remain intact.
To boot back into the host OS, simply remove the USb drive and reboot the system.
It worked! I created some files and folders, connected to Internet, and installed Vlc player on my Ubuntu 18.04 live system. Then I rebooted the live system to see if the changes are persistence. Yes, everything was there!! I have all the data and the changes made in the live system again.
Mkusb has made the creation of persistent live usb task much simpler and easier! It will be quite useful for those who wants to have a portable Ubuntu Linux in a thumb drive.
Give it a try, you won’t be disappointed.