From owner-freebsd-questions@FreeBSD.ORG Wed Apr 7 04:14:05 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 007B61065672 for ; Wed, 7 Apr 2010 04:14:05 +0000 (UTC) (envelope-from spry@anarchy.in.the.ph) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id D33A08FC0A for ; Wed, 7 Apr 2010 04:14:04 +0000 (UTC) Received: by pwi9 with SMTP id 9so615007pwi.13 for ; Tue, 06 Apr 2010 21:14:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.76.10 with HTTP; Tue, 6 Apr 2010 20:49:12 -0700 (PDT) In-Reply-To: References: <20100406213711.GA38637@orion.hsd1.pa.comcast.net> Date: Wed, 7 Apr 2010 11:49:12 +0800 Received: by 10.114.253.33 with SMTP id a33mr4328010wai.143.1270612152257; Tue, 06 Apr 2010 20:49:12 -0700 (PDT) Message-ID: From: Mars G Miro To: Dan Naumov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-jail@freebsd.org, Glen Barber , freebsd-questions@freebsd.org Subject: Re: bizarre mount_nullfs issue with jails / ezjail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2010 04:14:05 -0000 On Wed, Apr 7, 2010 at 5:43 AM, Dan Naumov wrote: > On Wed, Apr 7, 2010 at 12:37 AM, Glen Barber wr= ote: >> Hi Dan, >> >> Dan Naumov wrote: >>> So, I want the basejail to only contain the world and link the ports >>> tree from the host into each individual jail when it's time to update >>> the ports inside them, but I am running into a bit of a bizarre issue: >>> I can mount_nullfs /usr/ports elsewhere on the host just fine, but it >>> doesn't work if I try to mount_nullfs it to /usr/ports inside the >>> jail: >>> >>> mount_nullfs /usr/ports/ /usr/ports2 >>> >>> df -H | grep ports >>> cerberus/usr-ports =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A034G =A0 =A0241M =A0 = =A0 34G =A0 =A0 1% =A0 =A0/usr/ports >>> cerberus/usr-ports-distfiles =A0 =A0 =A034G =A0 =A0 =A00B =A0 =A0 34G = =A0 =A0 0% >>> /usr/ports/distfiles >>> cerberus/usr-ports-packages =A0 =A0 =A0 34G =A0 =A0 =A00B =A0 =A0 34G = =A0 =A0 0% >>> /usr/ports/packages >>> /usr/ports =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A034G =A0 =A024= 1M =A0 =A0 34G =A0 =A0 1% =A0 =A0/usr/ports2 >>> >>> mount | grep ports >>> cerberus/usr-ports on /usr/ports (zfs, local) >>> cerberus/usr-ports-distfiles on /usr/ports/distfiles (zfs, local) >>> cerberus/usr-ports-packages on /usr/ports/packages (zfs, local) >>> /usr/ports on /usr/ports2 (nullfs, local) >>> >>> mount_nullfs /usr/ports/ /usr/jails/semipublic/usr/ports >>> mount_nullfs: /basejail: No such file or directory >>> >>> What is going on here? I also note that the error actually wants a >>> /basejail on the host, which is even more bizarre: >>> >>> mount_nullfs /usr/ports/ /usr/jails/semipublic/usr/ports >>> mount_nullfs: /basejail: No such file or directory >>> >>> mkdir /basejail >>> >>> mount_nullfs /usr/ports/ /usr/jails/semipublic/usr/ports >>> mount_nullfs: /basejail/usr: No such file or directory >>> >>> Yet, this works: >>> >>> mkdir /usr/jails/semipublic/test >>> mount_nullfs /usr/ports/ /usr/jails/semipublic/test >>> umount /usr/jails/semipublic/test >>> >>> Any ideas? >>> >>> >> >> The ports directory in an ezjail is a link to /basejail/usr/ports (in th= e >> jail). >> >> Breaking the link (from the host) allows the mount to work successfully. >> >> orion# ll usr/ports >> lrwxr-xr-x =A01 root =A0wheel =A019 Mar =A08 18:06 usr/ports -> /basejai= l/usr/ports >> orion# unlink usr/ports >> orion# mkdir usr/ports >> orion# mount_nullfs /usr/ports usr/ports >> orion# >> >> Regards, >> >> -- >> Glen Barber > > Thanks for the tip. > > An additional question: how come "sade" and "sysinstall" which are run > inside the jail can see (and I can only assume they can also operate > on and damage) the real underlying disks of the host? > Disks (as well as others you have in your host's /dev) aren't visible inside jails. > - Sincerely > Dan Naumov > _______________________________________________ > freebsd-jail@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-jail > To unsubscribe, send any mail to "freebsd-jail-unsubscribe@freebsd.org" > --=20 cheers mars -----