How to Access Trapped Dataset Snapshot?

Status
Not open for further replies.

NASbox

Guru
Joined
May 8, 2012
Messages
644
I'm hoping that someone who has some experience with snapshots can help me.

I have saved a number of snapshots of datasets from pool TANK using zfs send/receive to a removable pool BACKUP01.
(TANK has grown too large for a single backup volume, so I need to back it up in pieces.)

Code:
NAME													  USED  AVAIL  REFER  MOUNTPOINT
BACKUP01												 6.23T   816G	88K  /BACKUP01
BACKUP01/TANK											6.23T   816G   230G  /BACKUP01/TANK
BACKUP01/TANK@__BKP01_VJQRCPRG_20171229_143300			111M	  -   230G  -
BACKUP01/TANK@__BKP01_VJQRCPRG__20180421_224503			  0	  -   230G  -
[Deleted for clarity]
BACKUP01/TANK/video									   836G   816G   836G  /BACKUP01/TANK/video
BACKUP01/TANK/video@__BKP01_VJQRCPRG_20171229_143300	  208K	  -   818G  -
BACKUP01/TANK/video@__BKP01_VJQRCPRG__20180421_224503		0	  -   836G  -
My problem is that the parent dataset TANK (which as expected contains none of the child datasets) is preventing me from accessing any of the child datasets that I have backed up.

For example if I try to access /BACKUP01/TANK/video it points to an empty directory in the parent dataset instead of the 836G of data that was backed up as a separate snapshot.

What is the best way to access the copy of BACKUP01/TANK/video that contains the data instead of the empty one.

Also if anyone has seen any good articles/videos that explain the finer points of handling snapshots of pools/child pools it would be much appreciated.
I've figured out how to save the data, now I have to figure out how I'm going to restore it if TANK ever gets corrupted.

Any hints/advice/assistance is much appreciated.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Last edited:

NASbox

Guru
Joined
May 8, 2012
Messages
644
You are going to want to mount the snapshot in order to see the content it holds:

Code:
mnt -t zfs BACKUP01/TANK/video@__BKP01_VJQRCPRG_20171229_143300 /mnt/videobackup


Assumes you have created the dir /mnt/videobackup first.

Credit to dpearcefl:
https://forums.freenas.org/index.php?threads/access-to-the-files-from-a-snapshot.36472/

Thanks @sretalla that helped me figure things out.

For the benefit of noobs who may not know this should be:
Code:
mount -t zfs BACKUP01/TANK/video@__BKP01_VJQRCPRG_20171229_143300 /mnt/videobackup


Now for an interesting follow up:

I chose to create /media/snap and mount the snapshot to that directory. After taking a quick look, I unmounted with umount /media/snap
and automagically ALL the child datasets backed up on BACKUP01 (there were 4) mounted themselves to /BACKUP01/TANK under the appropriated directory (since the directory exists).

I'm not complaining, but is this expected behaviour?

EDIT:
Follow up:
Just because I could (pool is a single disk in a removable drive caddy), I exported BACKUP01, and then imported it again, and everything was mounted as expected.

It appears that doing zfs send TANK/video@(oldsnapname) zfs send TANK/video@(newsnapname) | zfs recv BACKUP01/TANK/video

either unmounts the datasets or messes up the mount (not sure which). Exporting and Importing the Pool solves the problem. No need to mount any snapshots unless I need an old snapshot.

I thought the group might find this helpful.
 
Last edited:
Status
Not open for further replies.
Top