From owner-freebsd-current@FreeBSD.ORG Mon Aug 25 17:38:43 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B0FA2BF; Mon, 25 Aug 2014 17:38:43 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 112D93608; Mon, 25 Aug 2014 17:38:42 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s7PHcfCo004996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 25 Aug 2014 10:38:41 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s7PHceHc004995; Mon, 25 Aug 2014 10:38:40 -0700 (PDT) (envelope-from jmg) Date: Mon, 25 Aug 2014 10:38:40 -0700 From: John-Mark Gurney To: "Andrey V. Elsukov" Subject: Re: mkimg used to create gpt image, problem booting Message-ID: <20140825173840.GT71691@funkthat.com> Mail-Followup-To: "Andrey V. Elsukov" , Marcel Moolenaar , Craig Rodrigues , freebsd-current Current References: <53F9AC50.1000000@yandex.ru> <82000B55-10E5-4348-9F35-38962965A63C@xcllnt.net> <20140824233143.GQ71691@funkthat.com> <3AC10D0D-2BD8-4D30-A033-7EE9D923F408@xcllnt.net> <53FAEA31.1070108@yandex.ru> <53FB5014.40402@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53FB5014.40402@yandex.ru> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 25 Aug 2014 10:38:41 -0700 (PDT) Cc: Craig Rodrigues , freebsd-current Current , Marcel Moolenaar X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 25 Aug 2014 17:38:43 -0000 Andrey V. Elsukov wrote this message on Mon, Aug 25, 2014 at 19:02 +0400: > On 25.08.2014 18:40, Marcel Moolenaar wrote: > >> Also, now FreeBSD 11.0 uses different first usable LBA. By default it is > >> 4k aligned. And this creates some incompatibility with older versions. > >> You can't do `gpart restore` and get the same table, as you had on older > >> system. > > > > It sounds restore is broken then. The restore command > > cannot ever assume anything about the GPT. Including > > the tool that created the GPT. In order to restore a > > GPT, it must be properly backed-up. The backup header > > and table should suffice most of the time for that > > purpose as it's a replica, but as soon as meta-data is > > missing and the restore command has to guess, things > > will go wrong. > > `gpart restore` just uses a number of commands to geom_part(4) to create > partition table similar to what was backed up. If your partition table > on the old system had a partition that starts from LBA 34, now `gpart > create` isn't able to create such partition table. Because by default > the first usable LBA is 40. Luckily, gpart restore won't work: # gpart backup /dev/md0 GPT 4 1 freebsd-ufs 8 262144 # gpart restore md1 < /tmp/foob.gpt.back gpart: entries '4': Invalid argument So, we're somewhat safe, guess gpart restore needs to learn how to handle entries properly.... We should fix this, since other OS's might not use 128 for entries.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."