Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Ubuntu server with both samba and nfs-server.

The server does snapshotting for the exported directory and the samba server uses the snapshots to emulate shadow copies. ( vfs objects = shadow_copy )

When I export the same directory via NFS, the clients see the snapshot directories. Thus, a NFS client gets a messed-up directory listing containing lots of entries like @GMT-2012.01.31-13.00.01

How can I hide those subdirectories from NFS clients?

Thanks!

share|improve this question
    
How much control do you have over the NFS clients? –  Joel E Salas Feb 11 '12 at 0:57
1  
What is doing the 'snapshotting' ? –  LVLAaron Feb 11 '12 at 22:34
    
I have full control over the NFS clients. Snapshotting is done with btrfs –  Black Feb 15 '12 at 7:44
add comment

2 Answers

up vote 3 down vote accepted
+50

It's more of a hindsight suggestion, but in general you should place snapshots of directory dir residing in a parentdir in parentdir or in subdirectory of parentdir, not in dir. So that you'd have directory hierarchy similar to this:

parentdir
├── dir
│   ├── Apps
│   └── Clients
└── snapshots
    ├── @GMT-2012.01.30-13.00.01
    │   ├── Apps
    │   └── Clients
    └── @GMT-2012.01.31-13.00.01
        ├── Apps
        └── Clients

shadow_copy2 from Samba does support setting where the directory with snapshots resides, so you can redirect it to parentdir/snapshots, like this:

[share]
...
path = parentdir/dir
vfs object = shadow_copy2
shadow:snapdir = parentdir/snapshot
shadow:basedir = parentdir/dir

or if you want to export Apps from the above example as a share, then you can use configuration like this:

[Apps]
...
path = parentdir/dir/Apps
vfs object = shadow_copy2
shadow:snapdir = parentdir/snapshot
shadow:basedir = parentdir/dir
share|improve this answer
    
Works like a charm. :) –  Black Feb 15 '12 at 7:45
add comment

I do not think you'll be able to get what you want.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.