You can easily put the writable filesystem (in the casper-rw file)
for a live media onto a hard disk. The limitation is that the
casper-rw file must go on a FAT partition. Newer machines (UEFI)
all have a FAT EFI partition, but that's typically too small to hold
a 1G-4G casper-rw file. On another big enough FAT partition, you can
make directories, each holding a casper-rw file for possibly different live medias.
Suppose sda11 is 10G and has a 10G FAT filesystem, mounted at /mnt/sda11,on which there are directories /A , /B , /C , /D , and /E. Assume we will use /A for our persistent media, putting a casper-rw there.
cd /mnt/sda11/A
dd if=/dev/zero of=casper-rw bs=1M count=4096
mkfs.ext4 -F -O^has_journal -L casper-rw casper-rw
Take your live media created with persistence, and edit the /boot/grub/grub.cfg file and the /syslinux/txt.cfg file, adding after the word "persistent"
"persistent-path=/A"
/boot/grub/grub.cfg
...
menuentry "Try Ubuntu without installing" {
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --- cdrom-detect/try-usb=true noprompt persistent persistent-path=/A
initrd /casper/initrd.lz
}
/syslinux/txt.cfg
default live
label live
menu label ^Try Ubuntu without installing
kernel /casper/vmlinuz.efi
append noprompt cdrom-detect/try-usb=true persistent persistent-path=/A file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash ---
label live-install
...
That's it. You don't even need to rename/remove the casper-rw file on the USB media.
If there's room on the USB media, you can even copy the hard disk's casper-rw back to the USB, and take your changes with you.
The persistent-path does not allow any explicit disk reference, so should be unique across all FAT partitions. Tested with 1 or 2 FAT partitions (one being the EFI partition). Will not work on an ext2 or ntfs filesystem instead of FAT. If you also add the "toram" word on the same line as "persistent", your compressed filesystem on the slow USB will be copied into ram and give much better performance, however,
there seems to be a shutdown issue, with the FAT partition not being cleanly unmounted (which does not seem to cause any problems but...)
Best Answer
Persistence is saved in a file or partition named casper-rw, a persistent home file or partition named home-rw is also possible. A persistent install will save data, program installs, customized desktops, just about everything except some drivers which are loaded before the persistence file is read during boot, (NVidia graphics).
In a syslinux type install, (SDC, Unetbootin, Universal, Rufus, etc), the system resides in the root of the drive as does the casper-rw file. The filesystem for this partition is FAT32 thus maximum size for the persistence file is 4GB.
Prior to 14.04 syslinux type installs could also use a persistent casper-rw and home-rw partition. Persistent partitions no longer work except with grub2 type installs, (mkusb and the original MultiBootUSB).
Mkusb is easy to use, safe, versatile and will make a persistent partition of whatever size you want, it will then use remaining disk space to make a NTFS partition that is visible to both Linux and Windows.
Limitations, well you don't want to unplug a persistent pendrive while data is being written to persistence, luckily mkusb comes with persistence backup tools.