# [Closed] Accessing a ZFS snapshot problem



## CanOfBees (Apr 4, 2014)

Hi all, 

Up front I should say that I've probably made a number of mistakes in my attempt at creating a system snapshot & recovering data from said snapshot. I've reached a point where I've extracted the snapshot and have it on one of my drives, but I'm not able to access the data. Honestly, I'm not exactly sure what I need to do at this point. In other words, I'm not clear on which commands I need to execute in order to access my old home directory.

The snapshot is available:

```
# zfs list -t snapshot
NAME                                                                               USED  AVAIL  REFER  MOUNTPOINT
disk2/temp-for-backup@HappyBirthday                                                   0      -    31K  -
disk2/temp-for-backup/ROOT@HappyBirthday                                              0      -    31K  -
disk2/temp-for-backup/ROOT/default@HappyBirthday                                      0      -  33.7G  -
disk2/temp-for-backup/tmp@HappyBirthday                                               0      -  88.5K  -
disk2/temp-for-backup/usr@HappyBirthday                                               0      -    31K  -
disk2/temp-for-backup/usr/home@HappyBirthday                                          0      -    32K  -
disk2/temp-for-backup/usr/home/bridger@HappyBirthday                                  0      -  81.8G  -
disk2/temp-for-backup/usr/jails@HappyBirthday                                         0      -    37K  -
disk2/temp-for-backup/usr/jails/.warden-template-9.2-RELEASE-amd64@clean           850K      -   356M  -
disk2/temp-for-backup/usr/jails/.warden-template-9.2-RELEASE-amd64@HappyBirthday      0      -   356M  -
disk2/temp-for-backup/usr/jails/portJailbird@HappyBirthday                            0      -   706M  -
disk2/temp-for-backup/usr/obj@HappyBirthday                                           0      -    31K  -
disk2/temp-for-backup/usr/pbi@HappyBirthday                                           0      -  16.2G  -
disk2/temp-for-backup/usr/pbi/.pbi-world-amd64@clean                              6.29M      -  1.07G  -
disk2/temp-for-backup/usr/pbi/.pbi-world-amd64@HappyBirthday                          0      -  1.07G  -
disk2/temp-for-backup/usr/ports@HappyBirthday                                         0      -   374M  -
disk2/temp-for-backup/usr/ports/distfiles@HappyBirthday                               0      -  69.7M  -
disk2/temp-for-backup/usr/src@HappyBirthday                                           0      -    31K  -
disk2/temp-for-backup/var@HappyBirthday                                               0      -    31K  -
disk2/temp-for-backup/var/audit@HappyBirthday                                         0      -    33K  -
disk2/temp-for-backup/var/log@HappyBirthday                                           0      -   822K  -
disk2/temp-for-backup/var/tmp@HappyBirthday                                           0      -  7.73M  -
```

I tried to clone it, as I thought that was the next step but I'm either wrong, or I'm cloning it wrong (or both!).

```
# zfs clone disk2/temp-for-backup/usr/home/bridger@HappyBirthday disk2/temp-for-backup/usr/home/bridger
cannot create 'disk2/temp-for-backup/usr/home/bridger': dataset already exists
```

Could anyone suggest next steps or give me some hints as how to proceed? Thank you, in advance, for your time & trouble.
I know that the snapshot in question is from a PC-BSD box, however when I reinstalled last week I went with FreeBSD 10-RELEASE. I thought I'd be able to handle it - and, well, I'm partway there.


----------



## t1066 (Apr 4, 2014)

*Re: Accessing a ZFS snapshot problem*

By looking at the output of the USED column of `zfs list -t snapshot`, I can only see two snapshots that actually contain some data.

```
disk2/temp-for-backup/usr/jails/.warden-template-9.2-RELEASE-amd64@clean           850K      -   356M  -
disk2/temp-for-backup/usr/pbi/.pbi-world-amd64@clean                              6.29M      -  1.07G  -
```
If you are trying to recover data on /usr/home/bridger, I would suggest you show the output of `zpool history | grep bridger` here first. And please be prepare for the chance that you may not be able to recover your data.


----------



## CanOfBees (Apr 4, 2014)

*Re: Accessing a ZFS snapshot problem*

Hi @t1066 -

Thank you for that... horribly depressing news.  No, really - it's much appreciated. The output of `zpool history | grep bridger` indicates that I'm boned. 

Cheers,
CoB

Edited for formatting.


----------



## phoenix (Apr 4, 2014)

*Re: Accessing a ZFS snapshot problem*

You don't clone a snapshot in order to access the data in that snapshot.  You just navigate to the
/root-of-zfs-filesystem*/.zfs/snapshot/name-of-snapshot/*path-to-data/you/want/
directory and use normal cp command to copy data to where you want it.


----------



## CanOfBees (Apr 4, 2014)

*Re: Accessing a ZFS snapshot problem*

Hi all, 

I'm marking this thread as closed. I started the initial snapshot process off incorrectly and then made a series of poor decisions along the way. Thanks, all, for the suggestions.


----------

