The persistant usb drive uses a compressed read-only filesystem (squashfs) and overlays a writable filesystem layer on top that stores changed files. The writable filesystem is stored in a single file (like a zip file, but without the compression - it is actually ext3, but that is unimportant)
To put everything 'back together':
- Create the locations where things will go.
- Make the filesystems look like whole filesystems and not files (like they do at the moment.
- Join the filesystems together.
- Play around with the filesystem, like like chrooting
I am assuming the usb drive is mounted on
Change this to the directory that contains your persistant installation when you follow these instructions.
You need to be root, or prepend
sudo to every command
1. Creating stuff
Some directories need to be created:
/media/rootfs - Location where we will put the read-only filesystem
/media/cow - The location of the writable overlay
/media/persist_usb - The location where the two filesystems will be joined
this can be done with
2. Make files look like filesystems
First the compressed filesystem
mount -t squashfs -o loop,ro /media/usb/casper/filesystem.squashfs /media/rootfs
(Description: Mount the
filesystem.squashfs file on
/media/rootfs using squashfs)
Next the writable filesystem
mount -o loop,rw /media/usb/casper-rw /media/cow
(Description: Mount the file
casper-rw' on '/media/cow using a loop device)
3. Join the filesystems together
Now we are ready to join the two directories together
mount -t aufs -o dirs=/media/cow=rw:/media/rootfs=ro unionfs /media/persist_usb
(Description: Mount the union of the two directories using aufs (see unionfs) onto
/media/cow as writable and
/media/rootfs as readonly)
4. Play around
I'll leave that step up to you.
Once you have finished having fun with the installation (like chrooting) you need to get rid of the stuff that was created.
First to undo step 3:
Next to undo step 2. We can do both filesystem together:
Finally, to undo step 1:
The changes you have made to the filesystem have been kept and you can now unmount the USB drive (if you want to).