From owner-freebsd-current@FreeBSD.ORG Sat Feb 16 07:51:33 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 F20A145F for ; Sat, 16 Feb 2013 07:51:33 +0000 (UTC) (envelope-from erich@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) by mx1.freebsd.org (Postfix) with ESMTP id A8487E9C for ; Sat, 16 Feb 2013 07:51:33 +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:Message-ID:Subject:To:From:Date; bh=0gAFnR9mFW2sO0xoqFRjNQxI1o76T1Chc4pSVk01BdM=; b=OPGDHt6Ptfy+nzKP37SVHqCXCOyVzbh5QFtxLC9GRhqUWFxDji8bsMlcES4whihUYTA+ojXEJWKFsGR4Olc4n0aeHaX8G2FOeAS4jAzvOelbmiaOCaz4rGo7ugnuQWG+; Received: from [122.129.203.50] (port=30145 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 1U6cYP-004AUB-Ma for current@freebsd.org; Sat, 16 Feb 2013 00:51:26 -0700 Date: Sat, 16 Feb 2013 14:51:22 +0700 From: Erich Dollansky To: Subject: gpart, slice starts at 0 Message-ID: <20130216145122.3db70652@X220.ovitrap.com> Organization: ALO Green Technologies 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: erich@alogt.com X-Source: X-Source-Args: X-Source-Dir: X-Mailman-Approved-At: Sat, 16 Feb 2013 12:39:01 +0000 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 07:51:34 -0000 Hi, 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 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