I want to make a persistent live Ubuntu USB drive with more than 4GB of storage.

I know there is an option of installing directly on the drive but I don't want to do this as it will restrict the drive from working on different computers.

One option is to make an additional partition with extra space but if I do this how can I get newly installed software to be stored on this partition?

  • 2
    Doing a Full install to USB drive will not restrict the drive from working on other computers unless proprietary drivers are installed, (Nvidia, etc). – C.S.Cameron Feb 8 '16 at 3:37
  • I agree that installing to the USB drive as if it was an internal drive is a non-solution. I tried it, in fact. First, Ubuntu installation is not intended for this mode. For example, it asks for the computer name, which makes little sense in this case. I imagine, some drivers can be configures, installed, or uninstalled, depending on the actual hardware. Second, this installation method on an UEFI system will overwrite the Ubuntu's dedicated EFI directory on the ESP, and to boot the Ubuntu on the internal hard drive, the GRUB loader on the USB drive would need to be used during boot. – Alexey Jan 28 at 22:13
up vote 32 down vote accepted

The current Unix USB Installers (e.g. Universal USB Installer from PenDriveLinux.com) create a persistent file on the boot partition together with the other files needed for booting. This boot partition is formatted with FAT32 and because of limitations in FAT32, the maximum size of this file is 4GB. To have more persistent storage, this file can be replaced by a partition. The size of such a partition is only limited by the size of the USB drive.

I used the GParted partition manager to resize the FAT32 partition and make space for a big EXT4 partition for the persistent storage. The persistent file can simply be deleted and at the next boot, the Ubuntu system will automatically use the bigger persistent partition. There is one complication, though: you need another Ubuntu system to do this because Ubuntu cannot modify its own active boot partition.

I used a 2nd USB drive with Ubuntu live. For the instructions below I used "32 bit Ubuntu 13.10 desktop" version.

  1. Install Ubuntu live on 2 USB drives. Configure a small persistent storage of around 100 MB for each of the USB drives.

  2. Boot Ubuntu from one of the USB drives. Make sure the other USB drive is unplugged.

  3. Start "GParted Partition Editor" from the Ubuntu Dash. This partition manager is default installed in 13.10.

  4. Insert the other USB drive, wait a short moment and do a refresh in GParted (Ctrl+R). You will notice that a new device is added at bottom of the list of devices. Check that the size matches with the target USB drive. Select this device (see example picture below, the device name can be different on your system).

  5. Check that the mount point (/media/ubuntu/UUI) is identical as in above picture.

  6. Open a terminal window (Ctrl+Alt+T) and remove the persistent file with the following command (adjust this command if the mount point is different in your case):

    rm -v /media/ubuntu/UUI/casper-rw
    
  7. Refresh GParted (Ctrl+R) and notice the change in "Used".

  8. Right-click on the partition and select unmount. You will notice that the Mount Point is no longer displayed.

  9. Right-click on the partition and select Resize/Move. Select New size: 1000. This will leave some space to store additional or updated files. Click "Resize/Move". An "unallocated" partion will appear

  10. Now create a new partition for the persistent storage. Select the unallocated partition and right click on New.

  11. Select file system “ext4“ and label casper-rw and click Add.

  12. Check if everything looks OK and click on the green check mark to apply all pending operations.

  13. Shut down Ubuntu, remove the first USB drive (this USB drive is no longer needed) and reboot from the second USB drive.

  14. Open a terminal (Ctrl+Alt+T) and type the following command:

    df . -h
    

    Check that the Avail size matches with the persistent partition size you created.

  • This worked to me up until clicking the check mark to apply all operations. Then I got an error message from linux, I forget the exact wording but the 'system detected an error would you like to report the problem' one. I went back into gparted and I am unable to mount, resize, create partition or do anything to the drive now. Should I just format it and start over? – user137717 Aug 18 '15 at 4:24
  • 1
    This method does not work with 64 bit Ubuntu 14.04 and later. – C.S.Cameron Feb 8 '16 at 11:45
  • @C.S.Cameron what part doesn't work? is it not persistent? – Matt G Aug 1 '16 at 18:43
  • 2
    This doesn't work for me either. After deleting casper-rw file it stuck at BusyBox screen on next boot. – kirtan403 Aug 30 '16 at 8:55
  • 1
    It seems to have stoped working in latest Ubuntu... – lf_araujo Sep 23 '16 at 1:07

I would like to expand on the answer by V Bota and sudodus.

I wrote much of this for another question but I think it would serve better here.

I too have previously tried many different instructions without success and had almost given up when I found a working method using the very nicely created mkusb tool.

Prior Considerations

I am assuming you have the .iso file (of Ubuntu 16.04/any *buntu) already downloaded. If not get it.

I have tried running these instructions from an installed Ubuntu system.

Note: There is currently a limitation that efi-enabled OSes wont work in BIOS mode. To bypass the restriction, run all these steps from another live system.

Installing mkusb

Boot into an existing Ubuntu or live-boot the secondary Ubuntu flash drive.

Open a terminal (Ctrl+Alt+T) and run the following commands one by one:

sudo add-apt-repository universe
sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update

sudo apt-get install mkusb usb-pack-efi

The last command might fail (though unlikely) as mkusb (GUI version) has some dependencies that are not preinstalled/active in the live version of Ubuntu.

No need to panic though, the developer has also created a text only version. Run:

sudo apt-get install mkusb-nox usb-pack-efi

Creating the persistent drive

I will focus on the main GUI version as that is the one I have used. So if you installed the default mkusb (GUI version) run:

dus

dus is an alias for the latest updated new-look of mkusb. It is a revamp of the old version and even more easy to use.

After you run the command the GUI will open. Follow these steps next:

  • Screen 1: Note the warning and click OK
  • Screen 2: Double-Click on the i option Install(make a boot device)
  • Screen 2: Double-Click on the p option Persistent Live and select the .iso file.
  • Screen 3: Tick the device you want to install to and click OK
  • Screen 4: Just click Use defaults and let mkusb decide what's best. (Or choose, but wisely.)
  • Screen 5: Enter the percentage of USB drive space you want to allot for persistence file-system. The remaining will later show up as portable storage device.
  • Screen 6: Double check you have selected the right device and settings. Tick the Go radio button and click Go.
  • Screens 7,8,: Just click Ok and let mkusb do its thing.

Done!

Now plug your newly made persistent drive in any system and check if it really stores data/settings across reboots (Mine does).

Screenshots

The whole process should look something like the following.

Run the command in terminal:

Run the command in terminal


Note the warning and click OK:

Welcome and Notice


Double-Click on the i option Install(make a boot device):

Task To Perform


Double-Click on the p option Persistent Live and select the .iso file:

Live-only or Persistent


Click on the USB drive to make persistent. I want to use my 32 GB one so I mark the radio button:

Select_target_device


Click Use Defaults to let mkusb choose default:

Custom options or default


Enter a percentage of the drive to reserve for persistence. Mine is a large (32GB) so I allot only 20% ~ 6GB. The remaining space will be turned into an empty portable drive:

Enter Space for Persistance


Double check very carefully and confirm. You don't want to mess up another drive.

Double check and confirm


If all goes well you will be greeted by a nice green finished screen:

Finished Successfully



Now plug your newly made persistent drive in any system and check if it really stores data/settings across reboots (Mine does).

References & Acknowledgenent

You can refer to a nice tutorial by Calvin Bui here to guide you through the GUI step by step or read through the detailed documentation https://help.ubuntu.com/community/mkusb

Thanks again to V Bota for this answer and andrea-lazzarotto for helping edit this one.

  • I wasn't able to get these instructions to work using the 32-bit version of Ubuntu 14.04.5 when I tried it from within Ubuntu 12.04. When I switched to the 64-bit version and ran mkusb from Ubuntu 16.04.1 it worked. Thank you @Harsh for putting together such a comprehensive guide. I'm surprised it doesn't have more upvotes. – Adam Jan 5 '17 at 19:47
  • 1
    Thank you @Adam for your encouragement. Personally I haven't experienced the problem myself. But I looked about and there seems to be an additional step for installing mkusb in Ubuntu 12.04 help.ubuntu.com/community/mkusb/install-to-ubuntu-12.04. – Harsh Jan 23 '17 at 12:35
  • @Harsh , Please consider updating your answer with screenshots from mkusb version 12 alias dus :-) - It is still possible to select mkusb version 11 when you have installed mkusb version 12. I think some people prefer version 11, but I think version 12 is easier to use, particularly for new users. – sudodus Feb 19 '17 at 7:49
  • @sudodus Sure , I'll update it soon. Although I'm in the middle of a very hectic week and don't have my Ubuntu PC handy so it might be a while. Thanks for the update though. :-) – Harsh Feb 19 '17 at 12:55
  • 1
    @sudodus I have made the changes for this answer to be applicable to dus. Took a bit longer than expected :-) – Harsh May 30 '17 at 19:11

After several failed attempts with Startup Disk Creator I finally succeeded with mkusb following the instructions from here: https://help.ubuntu.com/community/mkusb

or here: http://phillw.net/isos/linux-tools/mkusb/mkUSB-quick-start-manual.pdf

The following lines indicate the steps I tried and worked for me with Lubuntu 15.10 on the same OS.

  1. Install mkusb: If you run standard Ubuntu, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)

    sudo add-apt-repository universe  # only for standard Ubuntu
    
    sudo add-apt-repository ppa:mkusb/ppa  # and press Enter
    sudo apt-get update
    sudo apt-get install mkusb mkusb-nox usb-pack-efi
    

    Upgrading from version 11 to version 12 requires some special commands. See this link,

    help.ubuntu.com/community/mkusb/gui#Upgrading_from_mkusb_11_to_12

  2. If you do not have an official ubuntu (Lubuntu, Xubuntu, Kubuntu ...) ISO image download one.

  3. Run mkusb from Dash or the menu (depending on flavour of Ubuntu) or in a terminal window with one of the following command lines

    mkusb version 12 alias dus:

    dus                   # getting into the main menu 'Install/Restore/Wipe'
    dus file.iso          # specifying a source file directly
    dus /dev/sdx          # specifying a source device
    

    mkusb version 9-11:

    sudo -H mkusb             # to get to the main menu
    sudo -H mkusb file.iso p  # source file and persistence via parameters
    

    when the password is requested enter the admin password

  4. then in mkusb's main menu select the ISO image you have downloaded.

  5. I have also toggled the option to have a persistent drive created.
  6. Select the option to install the selected ISO image.
  7. Click OK and then select the Drive on witch to install (BE careful to select the correct drive!)
  8. Choose the amount of memory you want to use for persistent data
  9. Click OK and wait for install to finish
  10. Then reboot system.

If you did not check it until now make sure that the bios settings allow booting from USB before HDD.

  • 2
    Thanks for this. Although mine failed when I chose 100% for my persistent storage space. I chose 90% and it worked. :) – jbrock Aug 2 '16 at 0:36
  • 1
    Thanks for finding this bug :-) It will be fixed in mkusb 11.1.7 – sudodus Nov 20 '16 at 2:18
  • MKUSB DESTROYED MY USB, was a pain to install on LXLE, and even after format the USB never booted again. – user132992 Aug 15 '17 at 19:05
  • worked great for me, thanks – Joe Corneli Dec 1 '17 at 16:07
  • I tried running mkusb today. It succeeded at creating a bootable drive that contained a usbdata partition, but it doesn't seem to really be persistent: no settings or files (e.g. in ~) that I create on one usage are there for the next usage. This was with Ubuntu 18. I chose to create it persistent in mkusb, and chose persistent mode in the bootloader. Do you know if there's something I'm missing here? – Dave Pritchard Jun 30 at 23:42

Update Aug/2017 - Persistence files greater than 4GB

Syslinux started adding support for NTFS with version 4.06 but did not offer full support until version 6.03.

UNetbootin - 655 uses Syslinux 4.03 and is limited to 4GB persistence files per FAT32.

MultiBootUSB - 8.8 uses Syslinux 4.07 and will install on NTFS, persistence files are not limited to 4GB.

Rufus 2.16 uses Syslinux 6.03 and will install on NTFS, persistence files are not provided but can be added manually and are not limited to 4GB.

YUMI - 2.0.4.9, (MultiBoot USB), uses Syslinux 6.03 and will install on NTFS, persistence files are not limited to 4GB. Like MBUSB 8.8 it can have persistence files for each distro installed.

Mkusb is now my favorite Live/Persistent flash drive maker for Linux, however the OP has been misinformed about a Full install not working on multiple computers.

A Full install to USB will work on any computer a persistent install will work on as long as proprietary drivers have not been installed.

Not only that but a Full install has other advantages such as booting much faster, being updateable, etc.

https://ubuntuforums.org/showthread.php?t=1655412

  • I think what he meant is that a full install will be in ext4 and prevents the drive from being used as data drive on other Windows PCs. However that's easy to overcome – phuclv Mar 2 at 12:07
  • @Lưu Vĩnh Phúc Yes, as long as the first partition is a Windows compatible file system, (FAT32 or NTFS), the USB can be used as a data drive on Windows PCs, If it is a Windows 10 PC, it does not even need to be the first partition. – C.S.Cameron Mar 2 at 16:04

protected by Community Dec 17 '15 at 0:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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