[lug] /etc backup and unionfs(?)

Michael J. Hammel mjhammel at graphics-muse.org
Fri Jun 8 09:39:57 MDT 2007


On Fri, 2007-06-08 at 09:04 -0600, Bear Giles wrote:
> Live CDs are now able to run off a root image on the cd media.  It looks 
> like there's a unionfs that allows a ramdisk to overlay the read-only disk.
> 
> That made me think -- what if the hard disk's / image is solely what's 
> in the distribution packages and is read-only, and you overlay it with a 
> read-write partition?  Wouldn't that mean that all configuration changes 
> are in that overlay partition and easily backed up and restored?  It 
> would also be easy to check for unwanted modifications, e.g., attempts 
> to install compromised binaries.

Not sure I'm following this.  You're overlaying the root partition,
which is mounted read-only, with a read-write partition so that you can
easily do backups of the overlay?  I'm not clear on what that's buying
you.

However, a similar mechanism is already used by several live CDs in
order to save configuration data (I think SLAX does it, probably a few
others).  The idea is that the files that need to be modified at run
time are mounted on an overlay that maps to a USB stick.  If you're
lucky, the USB stick is also bootable (and thus carries the LiveCD
instead of on a CDROM).  This would be very similar to what you propose
in that, with a DVD or USB stick to boot from, you could easily carry
the root partition from a full distribution (compressed).  There
wouldn't be a "backup" per se, but rather a simple writing of the
configuration data to the USB stick (the one acting as your read-write
overlay space) at run time.  When you're done, yank the USB stick and go
on your merry way, modified configs in hand.

> (Okay, you would need to make a few changes in /etc, but only those 
> required to boot the system.  Maybe nothing more than setting up 
> /etc/fstab to load the overlay.)

Possibly, although the LiveCDs I've seen all do it from an rc script at
boot time from the initial ramdisk image.

> Two additional benefits: restoration would be trivial since the root 
> partition would depend on nothing but the standard packages, and you 
> could even boot from a live CD that's been modified to load the disk 
> overlay instead of a ramdisk.

The implementations I've seen actually load the ramdisk first and then
mount the modified stuff as the overlay, right in place, before starting
the rest of the system.  
-- 
Michael J. Hammel                                    Senior Software Engineer
mjhammel at graphics-muse.org                           http://graphics-muse.org
------------------------------------------------------------------------------
When C++ is your hammer, everything looks like a thumb.
              -- Steven M. Haflich




More information about the LUG mailing list