Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jun 2011 10:02:58 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Storing revisions of large files using ZFS snapshots
Message-ID:  <20110601100258.13973yayckqlukvm@webmail.leidinger.net>
In-Reply-To: <20110601005219.GA11776@icarus.home.lan>
References:  <FFD730CF-2454-4A07-BA26-0C3B7257780E@itassistans.se> <20110601005219.GA11776@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Jeremy Chadwick <freebsd@jdc.parodius.com> (from Tue, 31 May  
2011 17:52:19 -0700):

> Speaking strictly about ZFS snapshots:
>
> The mentality of ZFS snapshots seems very similar to that of UFS
> snapshots, in the sense that the design/model seems to be oriented
> towards "bare-metal" restoration.
>
> That works generally okay (depends on your view) for administrators,
> but depending on your demographic, it almost certainly won't work for
> users.
>
> We've found that in most cases, a user will overwrite or rm a file which
> they didn't mean to and wish to restore just that file.  They need to do
> so quickly and easily.  ZFS and UFS snapshots don't make this easy for
> them to accomplish (ZFS is easier than UFS in this regard, absolutely).

What's hard about doing a
cp /path/to/fs/.zfs/snapshot/snap_name/subdir/file /path/to/fs/subdir/
?

If it is hard for the user to determine what is the base dataset for  
his current place, you could provide a zfs restore script (requirement  
of the following, feel free to adapt: user is in the dir where he  
wants to restore, commands not really tested, errors not handled):
  - zfsrestore list
    -> base=$(df . | awk '/Mounted on/ {next} {print $6}')
    -> echo Available snapshots
    -> ls -1 ${base}/.zfs/snapshot
  - zfs restore <snapshot> <file>
    -> base=$(df . | awk '/Mounted on/ {next} {print $6}')
    -> reminder=$(echo $PWD | sed -e "s:${base}/::g")
    -> cp -v ${base}/.zfs/snapshot/$arg1/${reminder}/$arg2 .

Bye,
Alexander.

-- 
http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110601100258.13973yayckqlukvm>