How to access NFS snapshots

Status
Not open for further replies.

JayG30

Contributor
Joined
Jun 26, 2013
Messages
158
Hello,

I'm probably just doing something stupid here, but I haven't done much with NFS snapshots. I can't figure out how to view/read my snapshots. I tried to mount them from a linux machine and also locally on the freenas server, like this;
Code:
mount -t nfs freenas:/mnt/store/backups/seacoast/.zfs/snapshot/auto-20150507.2246-1w/ /var/spool/tempsnaps/

but both attempts end up with "permission denied" errors.

This is what the .zfs/snapshot directory looks like;
Code:
drwxrwx---  2 nobody  nobody  2 May  4 14:36 auto-20150504.2246-1w/
drwxrwx---  2 nobody  nobody  2 May  4 14:36 auto-20150505.2246-1w/
drwxrwx---  2 nobody  nobody  2 May  4 14:36 auto-20150506.2246-1w/
drwxrwx---  2 nobody  nobody  2 May  4 14:36 auto-20150507.2246-1w/
drwxrwx---  2 nobody  nobody  3 May  8 16:52 auto-20150508.2246-1w/
drwxrwx---  2 nobody  nobody  3 May  8 16:52 auto-20150509.2246-1w/
drwxrwx---  2 nobody  nobody  3 May  8 16:52 auto-20150510.2246-1w/


Here is the settings for the NFS share (very basic).
upload_2015-5-11_9-53-20.png


And the NFS settings (again, very basic).
upload_2015-5-11_9-54-22.png


Is this possible? Do I have to clone the snapshot and share out the resulting dataset?

Thanks.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Is this possible? Do I have to clone the snapshot and share out the resulting dataset?

That or roll back to the snapshot.

Here's a ZFS safety tip. If you are ever even thinking about going inside the snapshot directories (they are hidden for a bunch of *really* *really* *fscking* good reasons) you are probably fscking up. Going inside those directories can be a major nightmare and can be pretty devastating to your pool. So it is NOT something you should think of doing, ever.
 

mpfusion

Contributor
Joined
Jan 6, 2014
Messages
198
If you are ever even thinking about going inside the snapshot directories (they are hidden for a bunch of *really* *really* *fscking* good reasons) you are probably fscking up. Going inside those directories can be a major nightmare and can be pretty devastating to your pool. So it is NOT something you should think of doing, ever.

Care to elaborate why not?

What devestating can happen even going there? With going there I suppose you mean changing the current directory to a subdirectory of .zfs/snapshots/… Going there doesn't change a single file and shouldn't do any harm IMHO. But apparently I'm wrong with this one.

What can happen restoring files (copying files from within .zfs/snapshots/…) to the main file system?

Probably not within the realm of this thread, but: Why are the snapshots exposed in such a convenient way that invites users to enter those directories if you should “never think of doing this, ever”?
 

JayG30

Contributor
Joined
Jun 26, 2013
Messages
158
Thanks.

I will say that I've had issues with the way freenas/bsd handles snapshots in the past. This has caused me to have to go into this hidden folder.

For instance, in 9.2 release, if you changed the permissions on a dataset the snapshots folder would show you that older snapshots had 1 set of permissions while new snapshots had the new permissions. Ok, no big deal right? Well turns out that this causes all snapshots to no longer appear in Previous Version on a CIFS share.

Solution? Fix the permission on these snapshots or delete them so your snapshots only have 1 set of permissions.

Not sure if this has been addressed in 9.3, but needless to say it was a major headache for me.


On topic, note that OmniOS, Nexenta, I believe ZFSonLinux, and so on don't seem to have this issue with mounting snapshots. You can even mount snapshots from a remote Linux box. I believe this is a specific behavior to BSD implementation.
 
Status
Not open for further replies.
Top