From owner-freebsd-current@FreeBSD.ORG Mon Feb 18 01:01:13 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D44F672D for ; Mon, 18 Feb 2013 01:01:13 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) by mx1.freebsd.org (Postfix) with ESMTP id 8E8F114E for ; Mon, 18 Feb 2013 01:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=zhIKuuMFJWugSysTCNTKQLUpqNBao4CPyb3IzixSgdg=; b=pDEzuzZm8jHWEYW3L8QohVilUsKn23FL7OM4w8pJhAB5lK+DKZx/b9pQAIRlBylbePE3goMSWvWCElnSoox9hixPi/VkZFiGkE76vmKpkmcUB0xGBeqbHs6t8D3l/e6o; Received: from [122.129.203.50] (port=45721 helo=X220.ovitrap.com) by sl-508-2.slc.westdc.net with esmtpsa (SSLv3:DHE-RSA-AES128-SHA:128) (Exim 4.80) (envelope-from ) id 1U7F6V-001Hm0-FI; Sun, 17 Feb 2013 18:01:12 -0700 Date: Mon, 18 Feb 2013 08:01:07 +0700 From: Erich Dollansky To: Warren Block Subject: Re: gpart, slice starts at 0 Message-ID: <20130218080107.07e74f64@X220.ovitrap.com> In-Reply-To: References: <20130216145122.3db70652@X220.ovitrap.com> <20130217080412.205899fd@X220.ovitrap.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 01:01:13 -0000 Hi, On Sun, 17 Feb 2013 09:11:48 -0700 (MST) Warren Block wrote: > On Sun, 17 Feb 2013, Erich Dollansky wrote: > > >>> gpart destroy -F da0 > >>> diskinfo da0 > >>> dd if=/dev/zero of=/dev/da0 bs=512 count=34 > >>> dd if=/dev/zero of=/dev/da0 bs=512 count=34 seek=312581774 > >> > >> Someone here on the lists (I unfortunately forget who) showed a > >> sneaky easier way to do this: > >> > >> gpart destroy -F da0 > >> gpart create -s gpt da0 > >> gpart destroy -F da0 > >> > > This did not make a difference. > > It's an easier way to destroy the backup table at the end of the > disk, whether one was there before or not, without having to > calculate the location. ok, so, I should keep this then. > > >>> gpart show -p da0 > >>> gpart create -s MBR da0 > >>> gpart add -t freebsd da0 > >>> gpart show -p da0 > >>> gpart show -p da0s1 > >>> gpart set -a active -i 1 da0 > >>> # > >>> # The following line always gives an error: > >>> # > >>> # gpart create -s BSD da0s1 > >> > >> 'destroy' is not recursive. It destroys the geom found on the > >> device given, but does not write to any geoms inside those geoms. > >> > > This is obvious. What surprises me is that create does not write a > > new and empty description to the disk. > > It does, but not being recursive, it does not destroy the geoms > inside the one given to the command (da0). You had: > > da0 (MBR) > da0s1 (bsdlabel) > > After the destroy, it became > da0 (null) > da0s1 (bsdlabel) It seems that we talk here about the same with very different words. The effect comes from the fact that the entries are always on the same location on a disk. The advantage is that repartitioning a disk stills leaves some room for recovery. > > This can happen with any of the setups where there are geoms inside > other geoms. > > >> The second part of your question, about da0 starting a block zero: > >> > >>> [X220]...Appl/Some Tools (root) > gpart show da0 > >>> => 63 312581745 da0 MBR (149G) > >>> 63 312581745 1 freebsd [active] (149G) > >>> > >>> [X220]...Appl/Some Tools (root) > gpart show da0s1 > >>> => 0 312581745 da0s1 BSD (149G) > >>> 0 312581745 - free - (149G) > >> > >> That shows slice one starts at block 63, standard for MBR. The > >> space inside the slice (da0s1) starts at block 0 *of the slice*. > > > > This is a bit confusing for me but it does not really matter as > > long as the programs get it straight. > > This is again because of the geom inside a geom setup. The actual > start block is the start of the slice (block 63) plus the start of > the FreeBSD partition inside the slice (currently 0). When you > create FreeBSD partitions inside da0s1, they will have nonzero > offsets from the start of the slice. There are examples shown here: > http://forums.freebsd.org/showpost.php?p=206204&postcount=11 And I saw there how to overcome the alignment problems. It is so simple. Just understanding it was not so simple for me. Thanks! Erich > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org"