Request for Review: UFS2 Snapshot Management Environment

Ralf S. Engelschall rse at FreeBSD.org
Fri Sep 3 08:19:54 PDT 2004


Recently I was a little bit bored that ONTAP WAFL's .snapshot feature
is such easy to use since years while on my FreeBSD 5 boxes the
unprivileged users were not able to as easily use snapshots for
retrieving old stages of their files.

Hence I implemented a little snapshot management environment for FreeBSD
around mount(8), mdconfig(8), amd(8) and cron(8) which lets me provide a
similar environment than what people are used to from WAFL. To illustate
the solution, let's give an example:

On ONTAP WAFL filesystems users already can do:

| $ cd /home/rse
| $ echo "before" >foo.txt; sleep 3601
| $ echo "middle" >foo.txt; sleep 3601
| $ echo "after"  >foo.txt
| $ ls -la | fgrep .snapshot
| $ cat .snapshot/hourly.1/foo.txt .snapshot/hourly.0/foo.txt foo.txt
| before
| middle
| after

On FreeBSD UFS2 filesystems users now also can do:

| $ cd /home/rse
| $ echo "before" >foo.txt; sleep 3601
| $ echo "middle" >foo.txt; sleep 3601
| $ echo "after"  >foo.txt
| $ ls -la /snap | grep hourly
| $ cat /snap/home:hourly.1/rse/foo.txt /snap/home:hourly.0/rse/foo.txt foo.txt
| before
| middle
| after

Because it certainly is useful also for others, I've now packed the
stuff together, added a little Makefile for ad-hoc "make install"
and "make uninstall" and wrote both manual pages for the implemented
commands plus a little summary and background article under

  http://people.freebsd.org/~rse/snapshot/

Now, enjoy happy snapshooting!
And feel free to give me feedback, please... ;-)

Yours,
                                       Ralf S. Engelschall
                                       rse at engelschall.com
                                       rse at FreeBSD.org



More information about the freebsd-hackers mailing list