From owner-freebsd-jail@FreeBSD.ORG Tue Apr 6 21:40:43 2010 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9724F106566B; Tue, 6 Apr 2010 21:40:43 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 610F08FC16; Tue, 6 Apr 2010 21:40:43 +0000 (UTC) Received: by pwi9 with SMTP id 9so416902pwi.13 for ; Tue, 06 Apr 2010 14:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=65eCvkwBuLxK2jvSRxoMjrgVm1+Pz2XSydz+YfMS9t0=; b=rcxvIINBhQspxU0hmZMte23LhxTq1uiJSmt35IwWEmyyL6s2AW3XQAB7Z+mEzY6GhS ealCsbjdgyBonpvNPBpnDK6/eirzz38IB77TWDig6XcGwuaW2TyDIe+bMu/ZE5Ma/wzS tzBZMLRWIzWoiYUJR/krWcqHJBvjImjR1WTZw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=JkAkscKkpXFpH/fG9kHlcCWiA/t2eFTykFi1ueWp1grrpk5YnIezBzbIz853uQAEoq kFvCQc29SpxJeM2LmBcRRInAsVu5yFCHq7bOnBCeZAjVNAGOZ/r7NTojtZRiXX0mZbno uLRsCi0c9HlSZUsMl/xPS87zKdn394jhFFOPQ= Received: by 10.140.57.7 with SMTP id f7mr6346549rva.201.1270590042847; Tue, 06 Apr 2010 14:40:42 -0700 (PDT) Received: from orion.hsd1.pa.comcast.net (c-71-230-240-241.hsd1.pa.comcast.net [71.230.240.241]) by mx.google.com with ESMTPS id p1sm5113361rvq.16.2010.04.06.14.40.38 (version=SSLv3 cipher=RC4-MD5); Tue, 06 Apr 2010 14:40:39 -0700 (PDT) Date: Tue, 6 Apr 2010 17:37:11 -0400 From: Glen Barber To: Dan Naumov Message-ID: <20100406213711.GA38637@orion.hsd1.pa.comcast.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-jail@freebsd.org, freebsd-questions@freebsd.org Subject: Re: bizarre mount_nullfs issue with jails / ezjail X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2010 21:40:43 -0000 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 34G 241M 34G 1% /usr/ports > cerberus/usr-ports-distfiles 34G 0B 34G 0% > /usr/ports/distfiles > cerberus/usr-ports-packages 34G 0B 34G 0% > /usr/ports/packages > /usr/ports 34G 241M 34G 1% /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 the jail). Breaking the link (from the host) allows the mount to work successfully. orion# ll usr/ports lrwxr-xr-x 1 root wheel 19 Mar 8 18:06 usr/ports -> /basejail/usr/ports orion# unlink usr/ports orion# mkdir usr/ports orion# mount_nullfs /usr/ports usr/ports orion# Regards, -- Glen Barber