From owner-freebsd-jail@freebsd.org Thu Dec 8 14:22:48 2016 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5016BC6DCD4 for ; Thu, 8 Dec 2016 14:22:48 +0000 (UTC) (envelope-from fbstable@cps-intl.org) Received: from berkeley.cps-intl.org (websense.cps-intl.org [81.137.176.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11C6B695 for ; Thu, 8 Dec 2016 14:22:47 +0000 (UTC) (envelope-from fbstable@cps-intl.org) Received: from [172.16.0.79] (helo=bdLL65j) by berkeley.cps-intl.org with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1cEzat-000APn-PL for freebsd-jail@freebsd.org; Thu, 08 Dec 2016 14:22:44 +0000 From: SK To: freebsd-jail Message-ID: Date: Thu, 8 Dec 2016 14:22:25 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.0.79 X-SA-Exim-Mail-From: fbstable@cps-intl.org X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on berkeley.lan.cps-intl.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=10.0 tests=ALL_TRUSTED autolearn=ham autolearn_force=no version=3.4.0 Subject: ZFS and Jail :: nullfs mount :: nothing visible from host X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on berkeley.cps-intl.org) X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 14:22:48 -0000 Hello I am trying to set up a bunch of jails (vimage, vtnet) on FreeBSD 11 Stable. I have created a tank/Jail dataset, and created mroot and other staff inside that (regular folders) The jails are using those folders using nullfs -- so far so good. I also have a few zfs datasets, like tank/users, tank/emails and so on which are null-mounted inside the jail a typical fstab.jail looks like below # Device MountPoint FSType Options Dump Pass /jails/mroot /jails/testJail nullfs ro 0 0 /jails/RWs/testJail /jails/testJail/RWs nullfs rw 0 0 ### zfs nullmount /tank/users /JailS/RWs/testJail/users nullfs rw 0 0 /tank/emails /JailS/RWs/testJail/emails nullfs rw 0 0 ### for Bash etc #Device MountPoint FSType Options Dump Pass fdesc /dev/fd fdescfs rw 0 0 proc /proc procfs rw 0 0 Now, I am able to write files into /mails and /users, and they are visible from within the jail. From the host -- these datasets are all empty! ls -lah /tank/users shows no files in them, even though from within the jail I can see that there are many folders available. This makes managing them from the host a bit difficult. And I have not been able to find any good documentation that can outline how I can setup zfs so I can manage it from within the jails. What I would really like to do is to have the zfs inside the jail, and be able to create snapshots, use other features, etc. Failing to do that, I should at least be able to do it from the host. But I cannot find any good pointer (I had been searching for quite some time now -- maybe my search skills are not that good) which can help in setting things up that way. I found one document that hinted that I might be able to achieve this using ezjail, but I would prefer to do it the "raw" way, i.e., use the base features with as little from ports as possible. I am using vtnet/vimage, so all my jails are currently on a different subnet than the lan and they are working alright except for this disc management issue. Final goal is to have samba running on one final jail, using zfs and managing zfs features from within the jail, so that I can create datasets as needed and take snapshots, make clones, etc. So far I have tried to follow as many google results as possible using jail, zfs, mountpoint, nullfs, manage zfs and so on. There were a few sites coming up again and again but they were talking about ezjail (not that I have anything against it, but I would prefer to be able to use the base system as it is -- might help me learn a few things that ezjail will hide from me :D) Any good how-to/documentation/pointer will be greatly appreciated. Thanks and regards SK