From owner-freebsd-geom@FreeBSD.ORG Thu Apr 2 12:20:40 2009 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07703106570B for ; Thu, 2 Apr 2009 12:20:40 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 49F658FC0A for ; Thu, 2 Apr 2009 12:20:39 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA12120 for ; Thu, 02 Apr 2009 15:09:30 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <49D4AAFA.1000407@icyb.net.ua> Date: Thu, 02 Apr 2009 15:09:30 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090323) MIME-Version: 1.0 To: freebsd-geom@freebsd.org X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: gpart micro-how-to X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 12:20:40 -0000 When I was a FreeBSD newbie I used sysinstall to partition my disks (now this subset of sysinstall's functionality can be found in sade(1)); when I became more knowledgeable and self-confident I started using fdisk and disklabel; and now it's time for gpart. Yesterday I marked up a new disk using part and decided to share the commands I used just in case somebody finds it useful. The disk is WD5000AAKS, its size in sectors is 976773168. # the following is fdisk substitute: create mbr partition table # and populate two entries with FreeBSD slices gpart create -s mbr ad10 gpart add -b 63 -s 12578832 -t freebsd ad10 gpart add -b 12578895 -s 964194273 -t freebsd ad10 # the following are disklabel substitutes: create empty labels, then add ufs # partition ad10s1a, swap partition ad10s1b and partition ad10s2d of type # "unknown"/FS_OTHER/10 for future use by zfs gpart create -s bsd ad10s1 gpart create -s bsd ad10s2 gpart add -i 1 -b 16 -s 4194304 -t freebsd-ufs ad10s1 gpart add -i 2 -b 4194320 -s 8384512 -t freebsd-swap ad10s1 gpart add -i 4 -b 16 -s 964194257 -t \!10 ad10s2 # the following are substitutes for fdisk/disklabel with -B/-b flags gpart bootcode -b /boot/boot0 ad10 gpart bootcode -b /boot/boot ad10s1 And "gpart show" is, of course, of great help at intermediate steps to figure out sizes and offsets. -- Andriy Gapon