From owner-freebsd-fs@FreeBSD.ORG Thu Mar 14 11:47:20 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 51F58599 for ; Thu, 14 Mar 2013 11:47:20 +0000 (UTC) (envelope-from peter.maloney@brockmann-consult.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id D683D6DA for ; Thu, 14 Mar 2013 11:47:19 +0000 (UTC) Received: from [10.3.0.26] ([141.4.215.32]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0M31EZ-1UZ1BQ27yp-00sxHw; Thu, 14 Mar 2013 12:47:03 +0100 Message-ID: <5141B8B6.4010209@brockmann-consult.de> Date: Thu, 14 Mar 2013 12:47:02 +0100 From: Peter Maloney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: Aligning MBR for ZFS boot help References: <513C1629.50501@caltel.com> <513CD9AB.5080903@caltel.com> <513CE369.4030303@caltel.com> <1362951595.99445.2.camel@btw.pki2.com> <513E1208.5020804@caltel.com> <20130312203745.A1130@besplex.bde.org> <513F8F04.60206@caltel.com> <20130313232247.B1078@besplex.bde.org> <5140F373.1010907@caltel.com> <20130314195715.Y909@besplex.bde.org> In-Reply-To: <20130314195715.Y909@besplex.bde.org> X-Enigmail-Version: 1.5 X-Provags-ID: V02:K0:C4/pe3TKhgPHEqVsWCFKHk7t77FrJqAAOpRdszHRylk Oze/q0yot56nEVdpSobrAswTpXLbeJBzppXtzLCFrn1ehj8H/k qU9v3JX0tM3hERgT7hq+5h3KBKTA0SBzPmsIxfgfoEU4Icm2VX BJNRTZLRCYCxX6cJl/6Bp0+fN8VqgEjIE9yekNQeqkUEOi9yS3 Cgb16UwtrnQfAvquYWQZXUY0MCQKhThWDA6RHm7pBayHHIRsYj aMFR9X1Jg3huY2fd9bLIBbB8oIKtIHpoISQQ0YuSpTNkCnhHh/ 0ZVXm6QMjKHfnLOd08C3UODvW02LmdXf8ZyzO9h1Om57tOpOoG ZSJZZ3+6rmR64lZEXgF7xDfIS7EPnMO/AgEz6qv1C Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2013 11:47:20 -0000 On 2013-03-14 10:41, Bruce Evans wrote: > On Wed, 13 Mar 2013, Cody Ritts wrote: > >> So, by setting those CHS values I am: >> making the partition table more compatible with other operating >> systems and BIOSes? >> and giving some utilities the CHS stuff they need to function right? > > It's not completely clear that S=32 H=64 is portable, but it is what most > old SCSI BIOSes used. > > Also, if the disk already has some partitions with a certain geometry, > use > the same geometry for other partitions and don't use fdisk's defaults if > they differ. > > Bruce Oh man... I thought yeah that -a 1 or -a 2048 should work, but it doesn't. And then I thought I'd be extra crafty and use dd to directly write the partition table myself and send that as a solution to you guys, but even that fails! Here's writing a 63 alignment mbr to the disk, just to prove dd can do this: # gdd if=mbr.img of=/dev/md10 bs=512 count=1 1+0 records in 1+0 records out 512 bytes (512 B) copied, 16.8709 s, 0.0 kB/s # gpart show md10 => 63 4194241 md10 MBR (2.0G) 63 40950 1 freebsd (20M) 41013 4153291 - free - (2G) Here's changing the start sector on the first partition to 2048 ;) Writing to the device works with bs=512, but not bs=1, so we use a file and bs=1 to do our edits, and then bs=512 to the disk. # gdd if=<(echo -ne "\x00\x08" ) of=mbr.img bs=1 seek=454 2+0 records in 2+0 records out 2 bytes (2 B) copied, 0.000112023 s, 17.9 kB/s Here's writing the new 2048 aligned mbr to the disk: # gdd if=mbr.img of=/dev/md10 bs=1 count=1 gdd: writing `/dev/md10': *Invalid argument* 1+0 records in 0+0 records out 0 bytes (0 B) copied, 21.0247 s, 0.0 kB/s :O