From owner-freebsd-stable@FreeBSD.ORG Tue May 24 13:36:03 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B59E61065673 for ; Tue, 24 May 2011 13:36:03 +0000 (UTC) (envelope-from victor@bsdes.net) Received: from equilibrium.bsdes.net (244.Red-217-126-240.staticIP.rima-tde.net [217.126.240.244]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBD48FC13 for ; Tue, 24 May 2011 13:36:03 +0000 (UTC) Received: by equilibrium.bsdes.net (Postfix, from userid 1001) id 7067C39832; Tue, 24 May 2011 15:20:28 +0200 (CEST) Date: Tue, 24 May 2011 15:20:28 +0200 From: Victor Balada Diaz To: stable@freebsd.org Message-ID: <20110524132028.GE1291@equilibrium.bsdes.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: gpart usage X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 13:36:03 -0000 Hello, I'm trying to setup a MBR partition with a BSD slice in it using gpart on FreeBSD 8.1 RELEASE. From the fixit console in the install i try to do gpart create -s MBR ad0 gpart add -t freebsd ad0 gpart create -s BSD ad0s1 gpart add -t freebsd-ufs ad0s1 gpart set -a active -i 1 ad0 For bootcode i do: gpart bootcode -b /boot/boot0 /dev/ad0 gpart bootcode -b /boot/boot /dev/ad0s1 This seems to work, but i have doubts about it. For example, looking at: http://freebsd.1045724.n5.nabble.com/gpart-micro-how-to-td4205149.html I can see that it leaves a 16 sectors offset. Can't find anything about it on gpart man page, but i did find on bsdlabel man page the following: offset The offset of the start of the partition from the beginning of the drive in sectors, or * to have bsdlabel calculate the correct offset to use (the end of the previous partition plus one, ignor- ing partition `c'). For partition `c', * will be interpreted as an offset of 0. The first partition should start at offset 16, because the first 16 sectors are reserved for metadata. So seems they're needed. Looking at what sysinstall did on a 8.0 install i can see the following: %gpart show => 63 285155262 da0 MBR (136G) 63 285153687 1 freebsd [active] (136G) 285153750 1575 - free - (788K) => 0 285153687 da0s1 BSD (136G) 0 2097152 1 freebsd-ufs (1.0G) 2097152 8388608 2 freebsd-swap (4.0G) [ more skipped ] Ie, no 16 sector offset in it. So my question is... What's the proper way of doing a MBR + BSD label partition and where is it documented? what are the different bootcodes and when is needed each one?[1] also, how do i know about offsets each partitioning scheme needs? shouldn't GEOM take care of it without user needing to know anything about it? If i wanted to also align partition to 1 MB offsets so i can get better performance with advanced format drives and RAID controllers, what would be the best option? I guess that i would need to add the first freebsd-ufs partition starting at 1985 sector, because 1 MB = 2048 512byte sector, and 63 are reserved for MBR scheme so 2048 - 63 = 1985. Is this right or i'm mistaken in something? Seems that gpart man page only documents doing it with GPT and doesn't talk about alignment constraints, but i can't use GPT because i want to do it over gmirror and last sector is used by gpt and gmirror at the same time causing some warnings[2]. It would be great if handbook's GEOM chapter would have some part about using gpart, but of course it's easier asking for it than actually writting it. Thanks a lot. Regards. [1]: I know handbook does have some info about /boot/boot0, boot1 and boot in "The Boot Manager and Boot Stages", but i can't find info about for example gptboot or gptzfsboot. [2]: Yes i know that i can create the GPT scheme and then gmirror the partitions but then, i can't use with the same speed the gmirror load algorithms over both disks so i prefer to gmirror the whole device. -- La prueba más fehaciente de que existe vida inteligente en otros planetas, es que no han intentado contactar con nosotros.