How do I get a live-USB to use a partition for persistence?
This is very easy to do, although the "casper-rw" name will still show up once :)
-
Your target USB disk must have at least two partitions; I recommend using GParted to create a new partition table.
- The first partition must be vfat/FAT32, and minimum size 750 MB (or more if you are using a live DVD image).
- The second partition should be ext4, sized to whatever you want your persistent storage to be (no limits), but it must be labeled
casper-rw
(all lower case, no quotes)
- You can, of course, add third, fourth, extended/logical partitions, etc. if you would like to.
Note: I prefer to use UNetbootin because it makes editing the syslinux configuration easy. You can use your own USB creator, but you should then modify the below steps appropriately. Also note that GParted 0.18.0 seems to have problems partitioning the USB stick. So if you have the issue then use live GParted CD for partitioning.
-
Use UNetbootin to write your chosen live CD ISO to the first (vfat) USB partition.
- Put a tiny size for UNetbootin's persistence option (say, 10 MB) to make life easier; don't worry, we won't actually be using this casper-rw file.
Once everything is done, the final step is to delete the small
casper-rw
file created on the vfat partition you installed the live CD on, so that the large ext4casper-rw
partition is used instead. Mount this partition (here,sdb1
), and delete/casper-rw
.Persistence (via the
persistent
kernel option) should already be set up if you used UNetbootin, so safely eject the USB and you're ready to go!
PS: If you don't want to use UNetbootin and you are using the "Startup disk creator" in Ubuntu then you need to do some edits to your syslinux/txt.cfg
file as follows:
default live label live menu label ^Try Ubuntu without installing kernel /casper/vmlinuz.efi append file=/cdrom/preseed/ubuntu.seed boot=casper cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash -- label live-install menu label ^Install Ubuntu kernel /casper/vmlinuz.efi append file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash -- label check menu label ^Check disc for defects kernel /casper/vmlinuz.efi append boot=casper integrity-check cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash -- label memtest menu label Test ^memory kernel /install/mt86plus label hd menu label ^Boot from first hard disk localboot 0x80
Persistent partitions have not worked with syslinux type installs such as SDC, UNetbootin, Rufus, etc since 14.04, (unless the partition is located on a separate drive). An attempt boot will end with BusyBox.
Syslinux 6.03 offers full support for NTFS, (and many other fs), so there is no longer a 4GB persistent file size limit required to satisfy FAT32. YUMI uses Syslinux 6.03 as does RUFUS.
https://www.pendrivelinux.com/yumi-multiboot-usb-creator/
https://rufus.akeo.ie/
Mkusb is a grub2 type bootable flash drive maker that uses a FAT32 partition for boot, a write only ISO9660 partition for the OS, a ext4 casper-rw partition for persistence and a NTFS data partition accessible to both Linux and Windows.
https://help.ubuntu.com/community/mkusb
It should satisfy your specification.