From owner-svn-src-head@FreeBSD.ORG Mon Dec 16 19:51:11 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTPS id 96088822; Mon, 16 Dec 2013 19:51:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 822091438; Mon, 16 Dec 2013 19:51:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJpB9W090590; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJpBtQ090589; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161951.rBGJpBtQ090589@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259480 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:51:11 -0000 Author: dteske Date: Mon Dec 16 19:51:11 2013 New Revision: 259480 URL: http://svnweb.freebsd.org/changeset/base/259480 Log: Fix a long-standing edge-case that would result in a ghosted `zroot' pool and subsequent headaches caused by multiple pools with the same name. Specifically, blast away any labels on the designated swap partition. Problem was when you install to a given layout *with* swap and then turn around and re-install the same layout *without* swap (we weren't doing a labelclear for the swap device, so would end up with an "UNAVAIL" status zroot pool that may only exist in the pool cache). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:51:11 2013 (r259480) @@ -745,6 +745,9 @@ zfs_create_diskpart() "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ freebsd-swap ${swapsize}b $disk || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/gpt/swap$index # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/gpt/swap$index none swap sw 0 0 \ @@ -818,6 +821,9 @@ zfs_create_diskpart() "$GPART_ADD_INDEX_WITH_SIZE" 2 \ freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1b # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/${disk}s1b none swap sw 0 0 \