How to backup (make a copy of) LiveCD changes

backupfilesystemslivecdoverlayfs

Many LiveCD distributions (for example Lubuntu 12.10 I use) allow making changes, for example updating timezone, logging in to Google Chrome, updating and installing additional packages such as OpenVPN. They do that by overlaying read-write filesystem, in my case RAM-based tmpfs (or ramdisk, or ramfs, or USB pendrive), over CD-ROM based filesystem, in my case system image via squashfs but might be iso9660 or udf directly, using some union filesystem, in my case overlayfs (or unionfs, or aufs).

I'd like to make copy of changes (e.g. using dd) and only changes of an existing running LiveCD (e.g. Lubuntu 12.10) and I don't want to make copy of whole '/' mountpoint, including both changes and original CD-ROM. How can I find device or mountpoint which I can point e.g. dd to?

mount shows the following (excerpt):

/cow on / type overlayfs (rw)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)

Original question: Persisting changes on Lubuntu 12.10 run from LiveCD on Ask Ubuntu (no answers as of posting this one).

Best Answer

On Ubuntu sticks, look for a file called casper-rw while the stick is not booted. That file should contain the changes.

Related Question