[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Homebuilt NAS Advice



On 2020-08-09 07:53, Stefan Monnier wrote:
it's convenient to make your latest backup readily accessible so
it's very easy to get back yesterday's version of a file in case your
fingers fumbled (which might be much more frequent than drive failures).

With ZFS and zfs-auto-snapshot, recovery can be done on the live server:

$ cp -p mountpoint/.zfs/snapshot/snapname/path/to/file mountpoint/path/to/file


This is my personal Samba directory:

2020-08-09 14:38:51 toor@f32020-08-09 14:55:11 toor@f3 ~
# du -A --si -s /jail/samba/var/local/samba/dpchrist
780G	/jail/samba/var/local/samba/dpchrist


From May 30, 2019, to the start of the last hour, I have 179 snapshots to choose from:

2020-08-09 14:37:35 toor@f3 ~
# zfs list -d 1 -t snapshot p3/ds2/samba/dpchrist | head -n 2
NAME USED AVAIL REFER MOUNTPOINT p3/ds2/samba/dpchrist@manual-20190530-1804 8.45M - 706G -

2020-08-09 14:37:50 toor@f3 ~
# zfs list -d 1 -t snapshot p3/ds2/samba/dpchrist | tail -n 1
p3/ds2/samba/dpchrist@zfs-auto-snap_h-2020-08-09-14h03 0 - 716G -

2020-08-09 14:38:35 toor@f3 ~
# zfs list -d 1 -t snapshot p3/ds2/samba/dpchrist | wc -l
     179


(This is too many snapshots. I need to thin them out and rework my replication scripts to handle source deletions.)


ZFS snapshots are essentially de-duplicated (185 to 1):

2020-08-09 14:51:36 toor@f3 ~
# du -A --si -s /jail/samba/var/local/samba/dpchrist/.zfs/snapshot
141T	/jail/samba/var/local/samba/dpchrist/.zfs/snapshot


David


Reply to: