From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 5 18:50:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 989D2E5C for ; Thu, 5 Sep 2013 18:50:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78F2B2884 for ; Thu, 5 Sep 2013 18:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r85Io09j047723 for ; Thu, 5 Sep 2013 18:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r85Io0Lf047722; Thu, 5 Sep 2013 18:50:00 GMT (envelope-from gnats) Resent-Date: Thu, 5 Sep 2013 18:50:00 GMT Resent-Message-Id: <201309051850.r85Io0Lf047722@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, ShelLuser Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 318D2E42 for ; Thu, 5 Sep 2013 18:48:21 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 048D02875 for ; Thu, 5 Sep 2013 18:48:21 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r85ImKY0046109 for ; Thu, 5 Sep 2013 18:48:20 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r85ImK7s046104; Thu, 5 Sep 2013 18:48:20 GMT (envelope-from nobody) Message-Id: <201309051848.r85ImK7s046104@oldred.freebsd.org> Date: Thu, 5 Sep 2013 18:48:20 GMT From: ShelLuser To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/181847: zpool sets wrong mountpoint when using altroot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 18:50:00 -0000 >Number: 181847 >Category: bin >Synopsis: zpool sets wrong mountpoint when using altroot >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 05 18:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: ShelLuser >Release: 9.2-RC3 >Organization: >Environment: FreeBSD fbsd.intranet.lan 9.2-RC3 FreeBSD 9.2-RC3 #0 r254795: Sun Aug 25 00:42:01 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC i306 >Description: Being curious I downloaded FreeBSD-9.2-RC3-i386-bootonly, setup a FreeBSD virtual machine using VirtualBox 4.2.16 and then followed the procedure explained here to setup a ZFS only system: http://forums.freebsd.org/showthread.php?t=31557 I've followed this procedure several times on FreeBSD 9.1-RELEASE and can confirm that it works. However, when I try to create the ZFS pool the command now complains that it cannot create the mount point: # zpool create -f -o altroot=/mnt -o cachefile=/var/tmp/zpool.cache zroot /dev/gpt/disk0 cannot mount '/mnt/zroot': failed to create mountpoint Which I think is not the way it's suppose to behave. When looking at the current ZFS filesystem you'll notice that it tried to mount the filesystem on /zroot instead of / : # zfs list -o name,mountpoint NAME MOUNTPOINT zroot /mnt/zroot The reason why I think this to be incorrect: by default (so without using -R) the mountpoint for a new pool is /pool (where 'pool' is the name of the pool itself). But if you specify a different mountpoint wouldn't it make more sense that it replaces the default mountpoint instead of being prepended to it? At least when you're using zpool instead of zfs. This is also mentioned in the zpool manualpage under the 'create' option (I quote): "Unless the -R option is specified, the default mount point is "/pool". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the -m option." I wasn't sure if I should report it, but because the behaviour of zpool changed so drastically I figured I'd better do so anyway, at the risk that this behaviour is intended. (I did not write this PR on a whim). >How-To-Repeat: Install FreeBSD as normal and follow the instructions in this thread: http://forums.freebsd.org/showthread.php?t=31557 Or simply create a new ZFS pool and specify an altroot, either using -o altroot=/altroot or by using -R /altroot. Previously the newly created filesystem would get assigned to / as the mountpoint, now it always uses the default mountpoint. >Fix: # zpool create -R /mnt -m / zroot /dev/gpt/disk0 Instead of the previously mentioned: # zpool create -R /mnt zroot /dev/gpt/disk0 Or if you already experienced the error message then the previous behaviour can be achieved by changing the mountpoint for the newly created filesystem to /. # zfs set mountpoint=/ zroot >Release-Note: >Audit-Trail: >Unformatted: