Snapshots accessible without mounting them?

Moderators: jhartley, MSR734, nola

Snapshots accessible without mounting them?

Post by Smolk » Sun Sep 16, 2012 8:45 am

Browsing snapshots using the Finder auto-mounts the snapshot as a read-only file system. This feels very "Maccy" and is a good thing, so two thumbs up!

When using ls (in a terminal), the snapshot directories on a ZFS filesystem appears to be empty. Is there a way to enable shell access to the directory contents of the snapshot without mounting it? I could really use this.
Smolk Offline


 
Posts: 4
Joined: Sat Sep 15, 2012 12:04 am

Re: Snapshots accessible without mounting them?

Post by si-ghan-bi » Sun Sep 16, 2012 1:15 pm

How do you auto mount the snapshots? Is it mentioned in the quickstart guide?
si-ghan-bi Offline


 
Posts: 145
Joined: Sat Sep 15, 2012 5:55 am

Re: Snapshots accessible without mounting them?

Post by grahamperrin » Sun Sep 16, 2012 3:21 pm

Smolk wrote:When using ls (in a terminal), the snapshot directories on a ZFS filesystem appears to be empty.


Re http://zevo.getgreenbytes.com/wiki/pmwi ... otBrowsing I guess that
ls
without options is not sufficient to automatically mount.

ls -al
seems to not work as expected on first attempt,
succeeds on the second attempt. Example:

Code: Select all
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215 | grep Desktop
macbookpro08-centrim:~ gjp22$ ls -l /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215 | grep Desktop
macbookpro08-centrim:~ gjp22$ ls -al /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215 | grep Desktop
macbookpro08-centrim:~ gjp22$ ls -al /Volumes/gjp22/.zfs/snapshot/2012-08-20-114215 | grep Desktop
drwx------  163 gjp22  wheel      551 18 Aug 07:37 Desktop
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Snapshots accessible without mounting them?

Post by grahamperrin » Mon Oct 01, 2012 2:20 am

Taking advice from viewtopic.php?p=545#p545 under the snapshot browsing example in the knowledge base

With a ZEVO dataset for my home directory 'gjp22':

Code: Select all
macbookpro08-centrim:~ gjp22$ zfs list -t snapshot | grep 2012-10-01
gjp22@2012-10-01-042926                        148Mi       -   304Gi  -
gjp22@2012-10-01-052925                        124Mi       -   304Gi  -
gjp22@2012-10-01-062926                        113Mi       -   304Gi  -
gjp22@2012-10-01-072925                        112Mi       -   304Gi  -


… of the commands below, only the last one listed the contents of the (snapshot) directory.

Code: Select all
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/ | less
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/ | less
macbookpro08-centrim:~ gjp22$ ls ~/.zfs/snapshot/2012-10-01-042926/. | less


With reference to the subject line of this topic,

Snapshots accessible without mounting them?

– we should note that:

  • a command line directory listing does result in a mount
- in other words, no access without mounting.

Additionally, by design:

  • mount points of snapshots are not volumes at the Computer level in Finder
  • mount points of snapshots are not volumes at /Volumes
  • mount points of snapshots are not DEVICES in the sidebar of OS X Mountain Lion
  • mount points of snapshots may be FAVORITES in the sidebar of OS X Lion or Mountain Lion.

Last but not least, this is unrelated to ZEVO and feels horribly buggy:

  • Lion and Mountain Lion will lose sidebar favourites for any volume that is ejected (bug reported to Apple against Lion).
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Snapshots accessible without mounting them?

Post by /dev/null » Mon Oct 01, 2012 12:19 pm

Normal ls works for me (10.8.1).

Terminal:
Code: Select all
Last login: Mon Oct  1 19:50:51 on ttys000
Hacke:~ toin$ alias ls=ls
Hacke:~ toin$ cd /Volumes/Fort\ Knox/.zfs/snapshot/2012-09-30/
Hacke:2012-09-30 toin$ ls | grep Inbox
Inbox


Console:
Code: Select all
01.10.12 19:51:13,000 kernel[0]: zfsx_mount: '/Volumes/Fort Knox/.zfs/snapshot/2012-09-30'


Problem was more trivial for me. After changing the visibility of the .zfs folder, it didn't worked as expected.
But after a restart of the system, now it works every time on the first try.
Maybe the mounting-deamon doesn't get notified, if the visible property changed from hidden to visible and just loads this setting once when the deamon is started?
/dev/null Offline


 
Posts: 16
Joined: Sat Sep 15, 2012 7:13 am

Re: Snapshots accessible without mounting them?

Post by grahamperrin » Mon Oct 01, 2012 2:35 pm

/dev/null wrote:Normal ls works for me (10.8.1). …


Preceding your use of ls,
cd resulted in the mount.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: ilovezfs and 1 guest

cron