From owner-svn-src-head@freebsd.org Mon Dec 14 19:37:21 2015 Return-Path: Delivered-To: svn-src-head@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 95569A437F2; Mon, 14 Dec 2015 19:37:21 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 805EF151D; Mon, 14 Dec 2015 19:37:21 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0NZD00HOJ5626B00@mr11p00im-asmtp003.me.com>; Mon, 14 Dec 2015 19:37:15 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-14_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1512140326 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Mon, 14 Dec 2015 11:37:12 -0800 Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ravi Pokala Sender: "Pokala, Ravi" To: Ian Lepore , Alexey Dokuchaev , "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <7C4EDA10-2CB9-4311-A3DB-952ED68E34E9@panasas.com> Thread-topic: svn commit: r292058 - head/sbin/geom/class/part References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> In-reply-to: <1449940829.1358.154.camel@freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 14 Dec 2015 19:37:21 -0000 -----Original Message----- From: on behalf of Ian Lepore Date: 2015-12-12, Saturday at 09:20 To: Alexey Dokuchaev , "Andrey V. Elsukov" Cc: , , Subject: Re: svn commit: r292058 - head/sbin/geom/class/part >I spent much of the last week fighting with "geom destroy" and trying >to prevent the ressurection of old geoms during the creation of new >ones. It's a Big Mess and it doesn't really work well at all. I came >to the conclusion that it's not geom destroy that needs a force flag so >much as geom create, where it would mean "it is okay to replace any >existing geom with the new one." > >For example if you have a freebsd slice da0s1 that contains freebsd >partitions within it, and you geom destroy -F da0 then that slice and >the partitions within it disappear. Then as soon as you create a new >geom for the device and add a slice that happens to fall on the same >sector that da0s1 used to live at, suddenly that whole geom tree comes >back to life and your next command to create a new geom da0s1 fails >because it already exists. At work, we frequently boot from LAN and do automated installs. The partitioning ~never changes, so we run into exactly the scenario you described. I ended up doing a horrible hack which parses the existing partition table (both slice/label and GPT), and zeros out the first and last few sectors of each partition. AND parse the partitioning info we're passing to the installer, and zeroing out the first and last sectors of the partitions we're ABOUT TO create. It's a medium-sized PITA, but it works. -Ravi (rpokala@)