From owner-freebsd-current@FreeBSD.ORG Sat Feb 16 13:27:27 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 07EBEA75 for ; Sat, 16 Feb 2013 13:27:27 +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 9EBC1A61 for ; Sat, 16 Feb 2013 13:27:26 +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=6ru111+Zay6J82bgJLT8JX2F4Qbuc7ud/Sdin/ysNKo=; b=Gw3t01gxST7Su+UHPp6hwfRtrEzGpVwMNO6zjyVO2rMxLZ3VjLwQh/2vdY4XGebvc5jNS4chESmYE4amuffqBupIHQjRTYkYXRsqWYYjhx+jNKS/X7NEADfmUEmDrYwE; Received: from [122.129.203.50] (port=15597 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 1U6hnY-001Fui-PE; Sat, 16 Feb 2013 06:27:25 -0700 Date: Sat, 16 Feb 2013 20:27:21 +0700 From: Erich Dollansky To: Erich Dollansky Subject: Re: gpart, slice starts at 0 Message-ID: <20130216202721.765ff79b@X220.ovitrap.com> In-Reply-To: <20130216145122.3db70652@X220.ovitrap.com> 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: Sat, 16 Feb 2013 13:27:27 -0000 Hi, On Sat, 16 Feb 2013 14:51:22 +0700 Erich Dollansky wrote: > > I did this to get a disk partitioned: > > #!/bin/tcsh > ############################################################################### > # > # File name: FormatSamsung160GB > # > # Description: This script formats a thumb drive connected as > da0 # > ############################################################################### > # > 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 if I wipe out 100% of the disk here, it all works as expected. Can we assume that there is a problem in gpart? Erich > 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 > gpart bootcode -b /boot/mbr da0 > gpart bootcode -b /boot/boot da0s1 > gpart show -p da0 > gpart show -p da0s1 > gpart add -t freebsd-ufs -s 512MB -l Samsung160GBroot da0s1 > > The script results in this output: > > FormatSamsung160GB > da0 destroyed > da0 512 160041885696 312581808 0 0 19457 > 255 63 34+0 records in > 34+0 records out > 17408 bytes transferred in 0.012732 secs (1367260 bytes/sec) > 34+0 records in > 34+0 records out > 17408 bytes transferred in 0.023717 secs (733983 bytes/sec) > gpart: No such geom: da0. > da0 created > da0s1 added > => 63 312581745 da0 MBR (149G) > 63 312581745 da0s1 freebsd (149G) > > => 0 312581745 da0s1 BSD (149G) > 0 312581745 - free - (149G) > > active set on da0s1 > bootcode written to da0 > bootcode written to da0s1 > => 63 312581745 da0 MBR (149G) > 63 312581745 da0s1 freebsd [active] (149G) > > => 0 312581745 da0s1 BSD (149G) > 0 312581745 - free - (149G) > > gpart: Invalid argument > [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) > > I have now two problems which I do not understand. First, why do I > need this line and why does it fail? > > gpart create -s BSD da0s1 > > Second, why does this slice start at 0? > > => 0 312581745 da0s1 BSD (149G) > 0 312581745 - free - (149G) > > I use this as an starting point: > > http://www.wonkity.com/~wblock/docs/html/disksetup.html > > It worked for me some time ago. > > Did I miss something very, very simple? > > 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"