Tsur wrote:Thanks for the help.
But I guess I was wondering (hoping) if there's some sort of snapshot "viewer" functionality or utility - an easier way to browse the contents of multiple snapshots.
--Sorry for resurrecting an old thread, but I just ran into this myself and have a decent solution. (I'm used to snapshots auto-mounting on the Linux side of things.) If you have Homebrew installed, '
brew install mc ' (midnight commander) and you can use these scripts I created to help:
BEGIN zfs-osx-mount-snapshot.sh
- Code: Select all
#!/bin/bash
# REF: https://openzfsonosx.org/wiki/FAQ#Q.29_How_can_I_access_the_.zfs_snapshot_directories.3F
# Auto-set snapshot dir as visible on all (mounted/imported) pools
for zds in `zpool list |grep -v ALLOC |awk '{print $1}'`; do
zfs set snapdir=visible $zds
done
# EDITME - modify the part after grep to search for and mount what you want to work on
for zds in `zfs list -r -t snapshot -o name,used,refer,mountpoint,creation |grep virtbox |awk '{print $1}'`; do
zfs mount $zds
done
df -h
exit;
--As of 2019.0316, zfs for osx v1.8.2:
How can I access the .zfs snapshot directories?
A) You need to set snapdir visible and manually mount a snapshot.
$ sudo zfs set snapdir=visible tank/bob
$ sudo zfs mount tank/bob@yesterday
$ ls -l /tank/bob/.zfs/snapshot/yesterday/
You can see existing snapshots via:
$ zfs list -t snapshot
Q) Is .zfs snapdir auto-mounting supported?
A) No, not at this time. You must manually "zfs mount" snapshots manually to see them in the snapdir.
Q) OK, I manually mounted my snapshot but still cannot see it in Finder. What gives?
A) Currently mounted snapshots are only visible from Terminal, not from Finder.
--Once you have edited the script (run it as root and don't forget to
chmod +x it) you can fire up '
mc /Volumes ' and use a text-based dual-pane interface to browse your snapshot(s) and copy file(s) from one pane to the other (use Tab to switch panes.) When done messing around with snapshots:
BEGIN zfs-osx-unmount-snapshots.sh
- Code: Select all
#!/bin/bash
for zds in `df|grep '.zfs' |awk '{print $1}'`; do
zfs umount $zds
done
df -h
exit;
HTH - I recommend running the scripts from root/bin directory ( /var/root/bin/) and use '
sudo su - '