Antoine Jacoutot wrote:
> On Tue, 6 Nov 2007, Nick Holland wrote:
>> what benefit do you see in having /altroot on the same disk as / ?
> 
> See the thread "Regenerating damaged /etc" ;)
> 

see /var/backup. :)

Really.  /altroot is useful for certain things, but ONLY certain
things.  Don't call it a backup, as it isn't rotated.  You have
less than 24 hours to actually decide "oh, I screwed up!" and get
your data back.  It generates an unclean file system, and the
cleanup of that file system leaves strange looking error messages
in your daily report.  AND on a single disk, it is blatantly not
bootable -- the pbr tries to pull /boot from 'a', where it was
installed to.  That's why the ROOTBACKUP process uses 'dd', to
make sure the file system is IDENTICAL in layout.  And / is hardly
the only place where important files reside.

Here's a script I've used:

====
/etc $ more daily.local
#!/bin/sh

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

TGZFILE=/backup/`date "+backup%Y-%m-%d"`.tgz

cd /
tar czf $TGZFILE etc var
ls -l $TGZFILE  # Verify it worked.

# Restore to second drive.  Delete if no second drive.
mount /dev/wd1a /mnt      # second drive root
mount /dev/wd1f /mnt/var  # second drive /var
cd /mnt
tar xzpf $TGZFILE
cd /
umount /mnt/var
umount /mnt
====

if you /backup is "finite", you will need a purge step in there,
but in the system I implemented this in looked like it could go
ten or more years before filling /backup. :)

yes, this restores /etc just before the ROOTBACKUP process
overwrites it, but this is just a couple seconds of wasted effort.

Nick.

Reply via email to