Thought I'd pass on a tip for new users or those unfamiliar with
unionfs.
It's great for pre-checking what changes will be made to your system. For example, I recently installed some things (manually compiled) and the instructions said you must run as root. It was not obvious why this was necessary, so I used unionfs to see what the installation would do with it's root permissions
before I actually modified my system. Make sure to set / as readonly on the unionfs mount command, and don't forget to do the chroot!
Code:
$ su -
# mkdir /var/write-layer
# mkdir /var/fake-root
# mount -t unionfs -o dirs=/var/write-layer:/=ro none /var/fake-root
# chroot /var/fake-root
# *** Do whatever you want as root, all updates will be to /var/write-layer ***
# *** Leave the chroot environment with a call to "exit" ***
# exit
# rmdir /var/fake-root
# cd /var/write-layer
# *** Look around to see what has changed, make sure to list hidden files ***
# *** A hidden file named like ".wh*" is a "whiteout" (deletion) file ***
# rm -rf /var/write-layer
# exit
$ exit
Note: You're logged in as root, and root can break out of a chroot jail, so this is
not meant to test things that might try to escape chroot for malicious purposes!