From owner-freebsd-fs@FreeBSD.ORG Sun Mar 10 05:13:31 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 995D65AB for ; Sun, 10 Mar 2013 05:13:31 +0000 (UTC) (envelope-from cr@caltel.com) Received: from mail2.caltel.com (mail2.caltel.com [66.102.145.6]) by mx1.freebsd.org (Postfix) with ESMTP id 82C84D10 for ; Sun, 10 Mar 2013 05:13:31 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAJQVPFFCZpCq/2dsb2JhbABDwW6EVXSCKwEBBDlGNzQCWQgBAYgJBptdoDySVQOIco1jhWeLDoMrGw X-IPAS-Result: Ap4EAJQVPFFCZpCq/2dsb2JhbABDwW6EVXSCKwEBBDlGNzQCWQgBAYgJBptdoDySVQOIco1jhWeLDoMrGw X-IronPort-AV: E=Sophos;i="4.84,817,1355126400"; d="scan'208";a="775349" Received: from host-170.a66-102-144.caltel.com (HELO codys-mac.local) ([66.102.144.170]) by smtp.caltel.com with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 09 Mar 2013 21:12:10 -0800 Message-ID: <513C1629.50501@caltel.com> Date: Sat, 09 Mar 2013 21:12:09 -0800 From: Cody Ritts Organization: CalTel User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Aligning MBR for ZFS boot help Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Sun, 10 Mar 2013 05:13:31 -0000 Hello all, I am really struggling to understand what is going on, if anyone could tell me where I am going wrong, I would greatly appreciate it. I have a new intel atom appliance that will not boot from a GPT partition table. It came with an SSD, so I am trying to align it to 1MB for the erase block size. All of these commands are being run from a 9.1-RELEASE-amd64-memstick These commands partition the drive, the system boots just fine: > gpart create -s mbr ada0 > gpart add -t freebsd ada0 > gpart create -s bsd ada0s1 > gpart add -s 52862M -t freebsd-zfs ada0s1 > gpart add -s 8G -t freebsd-swap ada0s1 > gpart set -a active -i 1 ada0 > gpart bootcode -b /boot/mbr ada0 > dd if=/boot/zfsboot of=/dev/ada0s1 count=1 > dd if=/boot/zfsboot of=/dev/ada0s1a skip=1 seek=1024 This is the gpart print output of those commands > => 63 125045361 ada0 MBR (59G) > 63 125045361 1 freebsd [active] (59G) > > => 0 125045361 ada0s1 BSD (59G) > 0 108261376 1 freebsd-zfs (51G) > 108261376 16777216 2 freebsd-swap (8.0G) > 125038592 6769 - free - (3.3M) Here is my disk info > root@:/root # diskinfo -v ada0 > ada0 > 512 # sectorsize > 64023257088 # mediasize in bytes (59G) > 125045424 # mediasize in sectors > 0 # stripesize > 0 # stripeoffset > 124053 # Cylinders according to firmware. > 16 # Heads according to firmware. > 63 # Sectors according to firmware. 125045361 + 63 = 125045424 So gpart is for sure printing sectors. freebsd-zfs starts at sector 63 So, I need that freebsd-zfs slice to start at 1MB 1MB = 2048s 2048 - 63 = 1985 so if I add an offset to my slice: > gpart add -b 1985 -s 52862M -t freebsd-zfs ada0s1 should start me at 2048. > => 63 125045361 ada0 MBR (59G) > 63 125045361 1 freebsd [active] (59G) > => 0 125045361 ada0s1 BSD (59G) > 0 1985 - free - (992k) > 1985 108261376 1 freebsd-zfs (51G) BUT, when i boot, I get this: > zfsboot: No ZFS Pools located, can't boot I think remember reading that freebsd-zfs had to be the first slice (I cannot remember where i read that). And it apparently does not think an offset is funny. So, that leaves me with trying to adjust my MBR partition, so I start over and run: > gpart add -b 1985 -t freebsd ada0 but that gives me: > => 63 125045361 ada0 MBR (59G) > 63 1953 - free - (976k) > 2016 125043408 1 freebsd (59G) HHHMMMMM???? well, 2016 - 1953 = 63 coincidence? i doubt it, but I dont get it. Poking around on the internet, it looks like gpart is possibly enforcing geometry boundaries? so I do the following: > sysctl kern.geom.part.check_integrity=0 > root@:/root # gpart add -a 1m -t freebsd ada0 > ada0s1 added > root@:/root # gpart show > => 63 125045361 ada0 MBR (59G) > 63 2016 - free - (1M) > 2079 125042652 1 freebsd (59G) > 125044731 693 - free - (346k) Obviously still didnt work. I try a 10MB offset. 10MB = 20480s 20480-63 = 20417s > gpart add -b 20417 -t freebsd ada0 > => 63 125045361 ada0 MBR (59G) > 63 20412 - free - (10M) > 20475 125024949 1 freebsd (59G) It is still just a few sectors off. So what if i let gpart automatically align it. > gpart add -a 1m -t freebsd ada0 > => 63 125045361 ada0 MBR (59G) > 63 2016 - free - (1M) > 2079 125042652 1 freebsd (59G) > 125044731 693 - free - (346k) And 2079 is still != 2048. I have tried adjusting those numbers one by one, and it just hops around the number I am looking for. I have tried adding partitions in-front of it, setting the alignment to 1s, and adjusting the size. I cannot get it to land on 2048. It does boot with the padding in the MBR table, but I don't think it is aligned. Maybe it is aligned, and I just dont know any better. I am at a loss. Any suggestions would be greatly appreciated. Thanks, Cody