Versioning & Windows User File Access? Incremental Snapshots with Samba Share?

consultant

Dabbler
Joined
Jan 7, 2019
Messages
13
I need to do hourly incremental backups of an Ubuntu File Server with a USB attached NAS (yet to be purchased.) I want to give end users easy access to browse the different file versions and copy the version they want to their Windows workstation themselves. I think the easiest for users would be to map a drive for them to the backup files.

My understanding is FreeNAS snapshots can show up as previous versions in Windows explorer. It's a Samba option in FreeNAS that makes it seamless to the end user. Before deciding to go with FreeNAS I'm curious as to how it shows up in Windows Explorer to the users when they are browsing the Samba share? I can't find any information or screenshots. Any help would be appreciated!
 

RickH

Explorer
Joined
Oct 31, 2014
Messages
61
This is pretty easy to set up, in the SMB settings you enter the following line into the Auxiliary Parameters field:
zfsacl:expose_snapdir=True

Once you have that configured the snapshots show up in a hidden directory within your share.
Example:
If you primary share is at: \\server\share\
The snapshot directory would be at: \\server\share\.zfs\snapshot NOTE: the \.zfs folder is not directly browsible so you'll need to enter the full \.zfs\snapshot path in order to browse the snapshots.

Each individual snapshot (both automatic and manual ones) will show up in a separate folder named with the snapshot name as it shows in the GUI.

Users who have access to the standard share should also have access to the hidden folder; however, all access is ready-only
 

consultant

Dabbler
Joined
Jan 7, 2019
Messages
13
So basically I'd map a drive for user restore purposes to \\server\share\.zfs then.

What are the folder names for each snapshot - something like the date of the snapshot so the user can easily tell which snap shot was taken when or an incremental number and they look to the directory date-time stamp to determine when it was taken?

I assume each snapshot shows ALL files whether they've been changed or not and then there's either server-side deduplication transparent to the user via block-level deduplication or using symbolic linking for files that haven't changed since the last backup?
 

consultant

Dabbler
Joined
Jan 7, 2019
Messages
13
If you have snapshots in place, just right click the folder and use restore old versions. No need to set anything or show hidden dirs.

EDIT: on windows, that is.

Maybe you misunderstand the end-user restore functionality goal I previously stated? Wouldn't this require software installation on the User's Windows Workstations? As right clicking on a folder in Windows Explorer isn't go to bring up 'Restore Old Versions' unless some software is installed on the user's Windows workstation - which I want to avoid. That's why we are talking about SAMBA share access to the files. The snapshots are being taken of the Linux File Server, not the user's workstation.
 

millst

Contributor
Joined
Feb 2, 2015
Messages
141
The "Previous Versions" tab is built in to Windows Explorer and doesn't require additional software. I've used it on occasion to recover from mistakes.
 

consultant

Dabbler
Joined
Jan 7, 2019
Messages
13
The "Previous Versions" tab is built in to Windows Explorer and doesn't require additional software. I've used it on occasion to recover from mistakes.

Wow, this is news to me!? Guess I never noticed after all these uses a 'restore previous versions' function in Windows Explorer. So are you saying FreeNAS uses an incremental snapshot file storage scheme that is compatible with the 'restore previous versions' function native to Windows Explorer when accessing a SAMBA network drive share, even though the files were written by FreeNAS and not the Windows workstation? I'm really surprised.
 

RickH

Explorer
Joined
Oct 31, 2014
Messages
61
If you have snapshots in place, just right click the folder and use restore old versions. No need to set anything or show hidden dirs.

EDIT: on windows, that is.

This can be set up in FreeNAS when you configure the SMB share - there is drop-down for periodic snapshot task where you can select the automated snapshot task that will be exposed through the 'Previous Versions' tab in Windows. The limitation with using this method is that you can only select a single periodic snapshot to be exposed - this may work fine for some people; however it was a limitation in my environment. I run snapshots ever 2 hours that have a 3 day retention and nightly snapshots that I keep for 1 month. Using the 'Previous Versions' method I would not be able to see both the 2-hour and the nightly versions.
 

RickH

Explorer
Joined
Oct 31, 2014
Messages
61
So basically I'd map a drive for user restore purposes to \\server\share\.zfs then.

What are the folder names for each snapshot - something like the date of the snapshot so the user can easily tell which snap shot was taken when or an incremental number and they look to the directory date-time stamp to determine when it was taken?

I assume each snapshot shows ALL files whether they've been changed or not and then there's either server-side deduplication transparent to the user via block-level deduplication or using symbolic linking for files that haven't changed since the last backup?

The folder names within the snapshot folder are named with the snapshot name which includes the date:
EXAMPLE: auto-20190108.0600-3d (automated snapshot taken on 2019-01-08 at 6AM with a 3 day retention)

The snapshot shows all files that existed in the directory at the time the snapshot was taken; however, t's not exactly de-duplication or symbolic links that make this work... ZFS is a copy on write file system - that means when you make a modification to a file, the changed blocks are written to a new location on the drive and the originals are left in place. What the snapshot does is preserve the file metadata at the time the snapshot was taken and prevent the original blocks from being overwritten until the snapshot retention has been met. This means that each individual snapshot only takes the amount of space equal to the original blocks that were changed or files that have been deleted. For large files (VM virtual disks for example) the snapshot only takes up the amount of space equal to the file blocks that have been changed or updated - not the entire size of the file.
 

millst

Contributor
Joined
Feb 2, 2015
Messages
141
Good info.

OP, see section 11.4.3 in the latest FreeNAS manual for more details.
 
Top