How do I mount a ZFS snapshot?

I created a zpool and in it there is a zfs volume. I used that to backup data on another server using ISCSI. Now I have the data and want to take a snapshot so that I can view it on another machine that is not in production.

Here is what I have done

# zfs snapshot mat/vol_1@snap1
# zfs list -t snapshot
NAME              USED  AVAIL  REFER  MOUNTPOINT
mat/vol_1@snap1      0      -  3.35G  -
# zfs send mat/vol_1@snap1 | zfs receive mat/vol_2
cannot receive new filesystem stream: destination 'mat/vol_2' exists
must specify -F to overwrite it
# zfs send mat/vol_1@snap1 | zfs receive mat/vol_3
#
#
# zfs list -t snapshot
NAME              USED  AVAIL  REFER  MOUNTPOINT
mat/vol_1@snap1      0      -  3.35G  -
mat/vol_3@snap1      0      -  3.35G  -

Now I want to view the data so I

# zpool get listsnapshots mat
NAME  PROPERTY       VALUE      SOURCE
mat   listsnapshots  on         default
# zpool set listsnapshots=off mat
#  zpool get listsnapshots mat
NAME  PROPERTY       VALUE      SOURCE
mat   listsnapshots  off        local
# cd /mat
# ls
# cd /
# ls /mat/vol_3/.zfs/snapshot

But I cannot see the snapshots.

I think you are approaching it in a wrong way... If you want to make a copy of your volume, then you should use zfs clone using previously created snapshot.

Ok so I have

/mat/vol_1@snap1

you are saying to clone that

# zfs clone mat/vol_1@snap1 mat/vol_4
#

, then what do I do with it?

Then

zfs set mountpoint=/whatever mat/vol_4

and you have it mounted.

1 Like
# zfs set mountpoint=/mat mat/vol_4
cannot set property for 'mat/vol_4': 'mountpoint' does not apply to datasets of this type

And how are you using mat/vol_1 ?

I figured it out I turned ISCSI on for that volume and was able to view it back to another server.

Thanks for the help.