Hello, I have boxed myself into a mental corner and need some help getting out. I am confused about working with ZFS file systems. Here is a simple example of what has me confused: Let''s say I create the ZFS file system tank/nfs and share that over NFS. Then I create the ZFS file systems tank/nfs/foo1 and tank/nfs/foo2. I want to manage snapshots independently for foo1 and foo2, but I would like to be able to access both from the single NFS share for tank/nfs. Here are my questions: 1. Can I in fact access foo1 and foo2 through the NFS share of tank/nfs or do I need to create separate NFS shares for each of them? 2. Is there any difference in interacting with foo1 and foo2 through the tank/nfs share versus interacting with them directly? I don''t even know if that question makes sense, but it''s at the heart of my confusion - nesting file systems. 3. If I make a snapshot of tank/nfs, does it include the data in foo1 and foo2 or are they excluded since they are separate ZFS file systems? Thanks for your help. Regards, Chris Dunbar
2010/3/24 Chris Dunbar <cdunbar at earthside.net>> I have boxed myself into a mental corner and need some help getting out. I > am confused about working with ZFS file systems. Here is a simple example of > what has me confused: Let''s say I create the ZFS file system tank/nfs and > share that over NFS. Then I create the ZFS file systems tank/nfs/foo1 and > tank/nfs/foo2. I want to manage snapshots independently for foo1 and foo2, > but I would like to be able to access both from the single NFS share for > tank/nfs. Here are my questions: > > 1. Can I in fact access foo1 and foo2 through the NFS share of tank/nfs or > do I need to create separate NFS shares for each of them? >No, but sort of yes. If you mount server:/nfs on another host, it will not include server:/nfs/foo1 or server:/nfs/foo2. Some nfs clients (notably Solaris''s) will attempt to mount the foo1 & foo2 datasets automatically, so it looks like you''ve exported everything under server:/nfs. Linux clients don''t behave in the same fashion, you''ll have to separately mount all the exports. The sharenfs property will be inherited by the descendant datasets, so if you set it on tank/nfs, tank/nfs/foo1 will have the same settings. 2. Is there any difference in interacting with foo1 and foo2 through the> tank/nfs share versus interacting with them directly? I don''t even know if > that question makes sense, but it''s at the heart of my confusion - nesting > file systems. >There are some functions that are unavailable, such as retrieving the zfs settings, etc. I''m not really sure about specifics. Depending on the client nfs version, you may not be able to manipulate acls from clients.> 3. If I make a snapshot of tank/nfs, does it include the data in foo1 and > foo2 or are they excluded since they are separate ZFS file systems? >No, foo1 and foo2 are separate datasets and have completely independent snapshots. You can do ''zfs snapshot -r tank/nfs'' which will make a recursive snapshot. All the datasets under tank/nfs will have a snapshot taken at the exact same transaction. I''m guessing that''s what you''d want? -B -- Brandon High : bhigh at freaks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100324/5df180e7/attachment.html>
Brandon, Thank you for the explanation. It looks like I will have to share out each file system. I was trying to keep the number of shares manageable, but it sounds like that won''t work. Regards, Chris On Mar 24, 2010, at 9:36 PM, Brandon High wrote:> 2010/3/24 Chris Dunbar <cdunbar at earthside.net> > I have boxed myself into a mental corner and need some help getting out. I am confused about working with ZFS file systems. Here is a simple example of what has me confused: Let''s say I create the ZFS file system tank/nfs and share that over NFS. Then I create the ZFS file systems tank/nfs/foo1 and tank/nfs/foo2. I want to manage snapshots independently for foo1 and foo2, but I would like to be able to access both from the single NFS share for tank/nfs. Here are my questions: > > 1. Can I in fact access foo1 and foo2 through the NFS share of tank/nfs or do I need to create separate NFS shares for each of them? > > No, but sort of yes. > > If you mount server:/nfs on another host, it will not include server:/nfs/foo1 or server:/nfs/foo2. Some nfs clients (notably Solaris''s) will attempt to mount the foo1 & foo2 datasets automatically, so it looks like you''ve exported everything under server:/nfs. Linux clients don''t behave in the same fashion, you''ll have to separately mount all the exports. > > The sharenfs property will be inherited by the descendant datasets, so if you set it on tank/nfs, tank/nfs/foo1 will have the same settings. > > 2. Is there any difference in interacting with foo1 and foo2 through the tank/nfs share versus interacting with them directly? I don''t even know if that question makes sense, but it''s at the heart of my confusion - nesting file systems. > > There are some functions that are unavailable, such as retrieving the zfs settings, etc. I''m not really sure about specifics. > > Depending on the client nfs version, you may not be able to manipulate acls from clients. > > 3. If I make a snapshot of tank/nfs, does it include the data in foo1 and foo2 or are they excluded since they are separate ZFS file systems? > > No, foo1 and foo2 are separate datasets and have completely independent snapshots. > > You can do ''zfs snapshot -r tank/nfs'' which will make a recursive snapshot. All the datasets under tank/nfs will have a snapshot taken at the exact same transaction. I''m guessing that''s what you''d want? > > -B > > -- > Brandon High : bhigh at freaks.com > eSoft SpamFilter Training Tool > Train as Spam > Blacklist for All Users > Whitelist for All Users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100324/7351e3ac/attachment.html>
On Wed, Mar 24, 2010 at 6:39 PM, Chris Dunbar <cdunbar at earthside.net> wrote:> Thank you for the explanation. It looks like I will have to share out each > file system. I was trying to keep the number of shares manageable, but it > sounds like that won''t work. >Thanks to inheritance, it''s easier than you think when you''ve laid out your datasets properly. If all the datasets you want to export are descendant from the same starting point, you''ll only need to set sharenfs once. Management on the opensolaris box is easy, but you may have to do some clever automounter configs on other hosts. -B -- Brandon High : bhigh at freaks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100324/4d1cc7c5/attachment.html>
Chris Dunbar wrote:> Let''s say I create the ZFS file system tank/nfs and > share that over NFS. Then I create the ZFS file systems tank/nfs/foo1 and > tank/nfs/foo2. I want to manage snapshots independently for foo1 and foo2, > but I would like to be able to access both from the single NFS share for > tank/nfs. Here are my questions: > > 1. Can I in fact access foo1 and foo2 through the NFS share of tank/nfs or do > I need to create separate NFS shares for each of them?They will be separate shares, but you should be able to avoid having to touch this with ZFS inheritance, as long as the subshares should all be shared the same way as the parent.> 2. Is there any difference in interacting with foo1 and foo2 through the > tank/nfs share versus interacting with them directly? I don''t even know if > that question makes sense, but it''s at the heart of my confusion - nesting > file systems.Since they''re separate-but-related shares, the client needs code to detect and handle mounting of the subshares, ideally without the client user do anything. If you are using modern Nevada or OpenSolaris, this is done, but Solaris 10 does not do it.> 3. If I make a snapshot of tank/nfs, does it include the data in foo1 and > foo2 or are they excluded since they are separate ZFS file systems?They''re separate, but "zfs snapshot -r" will do them all at once. Rob T
Brandon High wrote:> If you mount server:/nfs on another host, it will not include > server:/nfs/foo1 or server:/nfs/foo2. Some nfs clients (notably > Solaris''s) will attempt to mount the foo1 & foo2 datasets automatically, > so it looks like you''ve exported everything under server:/nfs. Linux > clients don''t behave in the same fashion, you''ll have to separately > mount all the exports.Hi Brendan, I believe this is incorrect - Solaris Nevada has supported this automatic subshare mounting (we call it "mirror mounts") since build 77, but it''s not in Solaris 10, while I believe Linux has had it for a longer time. Is this not what you see on current Linux? Rob T
On 25 Mar 2010, at 11:58, Robert Thurlow wrote:> Brandon High wrote: > >> If you mount server:/nfs on another host, it will not include >> server:/nfs/foo1 or server:/nfs/foo2. Some nfs clients (notably >> Solaris''s) will attempt to mount the foo1 & foo2 datasets >> automatically, so it looks like you''ve exported everything under >> server:/nfs. Linux clients don''t behave in the same fashion, you''ll >> have to separately mount all the exports. > > Hi Brendan, > > I believe this is incorrect - Solaris Nevada has supported > this automatic subshare mounting (we call it "mirror mounts") > since build 77, but it''s not in Solaris 10, while I believe > Linux has had it for a longer time. Is this not what you > see on current Linux? > > Rob TOn debian linux (lenny), the nfs4 client automatically mounts subshares, but the nfs3 client doesn''t (May not be right in all cases, just my experience). Best regards, Stefan
Stefan Walk wrote:> On debian linux (lenny), the nfs4 client automatically mounts subshares, > but the nfs3 client doesn''t (May not be right in all cases, just my > experience).NFSv3 has no way to do this in the protocol, so this is as designed (and the same as current Solaris/OpenSolaris). Rob T
NFSv4 has a concept of a root of the overall exported filesystem (Pseudofilesystem). FileHandle 0 in terms of Linux it is setting fsid=0 when exporting. Which would explain why someone said Linux (NFSv4) automounts an exported filesystem under another exported filesystem ie mount servername:/ and be able to browes all exported/shared file systems you have access to. I don''t think this made it into Solaris NFSv4 server. -- This message posted from opensolaris.org
Damon Atkins wrote:> NFSv4 has a concept of a root of the overall exported filesystem (Pseudofilesystem). > > FileHandle 0 in terms of Linux it is setting fsid=0 when exporting. > > Which would explain why someone said Linux (NFSv4) automounts an exported filesystem under another exported filesystem > > ie mount servername:/ and be able to browes all exported/shared file systems you have access to. > > I don''t think this made it into Solaris NFSv4 server.Correct, we believe the client should do the work here, not the server. The tough problem with letting the server pretend all subshares are part of one big filesystem is that there can be fileid/inode number collisions between objects in separate underlying filesystems, and Posix applications can do bad things in those cases. There''s no graceful way to do this in NFSv2/v3, but v4 solves it. Rob T
On Thu, Mar 25, 2010 at 3:58 AM, Robert Thurlow <robert.thurlow at sun.com>wrote:> Linux has had it for a longer time. Is this not what you > see on current Linux? >All of my linux clients are using nfs3. CentOS 5 had trouble with nfs4, and the ancient version of debian I''m running doesn''t support it at all. -B -- Brandon High : bhigh at freaks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100325/55f728b7/attachment.html>