From owner-freebsd-current@FreeBSD.ORG Sun Feb 17 01:04:24 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 A8FC7466 for ; Sun, 17 Feb 2013 01:04:24 +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 37E04273 for ; Sun, 17 Feb 2013 01:04:21 +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=V4esnXTLhA4/+nnqEH++auR9VZisvB7MmfzBPeIXsxc=; b=MOFUoSFGqKZkTfCjpgl/UPloUdmXwX94t9hL429pRfQv+KLLMlqxTzjMiQUpok/e1b/V0Ad6Z7pqMZA0f8AkF3myTkRMoE8kHguySfyEV9XyNBSqLXdcX91mxByB3WRO; Received: from [122.129.203.50] (port=27715 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 1U6sfw-004BUy-4E; Sat, 16 Feb 2013 18:04:16 -0700 Date: Sun, 17 Feb 2013 08:04:12 +0700 From: Erich Dollansky To: Warren Block Subject: Re: gpart, slice starts at 0 Message-ID: <20130217080412.205899fd@X220.ovitrap.com> In-Reply-To: References: <20130216145122.3db70652@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: Sun, 17 Feb 2013 01:04:24 -0000 Hi, On Sat, 16 Feb 2013 08:44:50 -0700 (MST) Warren Block wrote: > On Sat, 16 Feb 2013, Erich Dollansky wrote: > > > I did this to get a disk partitioned: > > > > #!/bin/tcsh > > Gah! > it is a generated script. > > 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. > > 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. > MBR/bsdlabel puts FreeBSD partitions inside MBR slices. > > So da0 has been erased, but the bsdlabel blocks for da0s1 are still > present. If you recreate da0, da0s1 will magically reappear. > This is what I struggeled with all the time. > Destroy the FreeBSD disklabel stuff in the slices first: > gpart destroy -F da0s1 And this was the solution. Thanks! > > Or instead, use GPT partitioning to avoid dealing with the problem of > one type of partitions inside a different type of partitions. GPT > makes disk partitioning a lot easier. I am bit tired of having to read handbooks/manuals whenever I get a new device. Out of this, I am currently writing a small program which allows me easy 'formatting' of the device. MBR is just one option the program has. I will publish it when it is really working as I want it to. It will take some time as I do this on the side only. > > 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. 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"