Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2014 07:40:50 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc:        Craig Rodrigues <rodrigc@freebsd.org>, John-Mark Gurney <jmg@funkthat.com>, freebsd-current Current <freebsd-current@freebsd.org>
Subject:   Re: mkimg used to create gpt image, problem booting
Message-ID:  <B44B1E51-0F9E-41ED-B37F-DA2A9E6334FC@xcllnt.net>
In-Reply-To: <53FAEA31.1070108@yandex.ru>
References:  <CAG=rPVeucq%2BsMxe_NPe3Og939o=Sg4WGfYL7PjA1uXGU8uL=8g@mail.gmail.com> <853B0396-2C19-49DF-A8E8-8EB43D107597@xcllnt.net> <CAG=rPVes3Eq87hOE6W135yGvzRiAzHTbCGSxiyd0JBAs2ufqmA@mail.gmail.com> <7CE168C1-6AF3-4AD2-80DB-192AEC49FD2B@xcllnt.net> <CAG=rPVfe6pP08WWaYQ6enk7A6AkT3dBXVxNfK0JgJPaN_rJ_Uw@mail.gmail.com> <CAG=rPVe8Lh=P2MUdycM7%2B2mpSBPhe%2BkTvxR_bjnZfB1EkvK92Q@mail.gmail.com> <53F9AC50.1000000@yandex.ru> <CAG=rPVctN4-UBxRzWhEoEt5e_4d8UXCa0O40LZUHnS5Qj9hFeA@mail.gmail.com> <82000B55-10E5-4348-9F35-38962965A63C@xcllnt.net> <CAG=rPVeLgOGXx8=S18u03JuNGB9PzYk3uYZS8r=sgu3b_UHOmQ@mail.gmail.com> <20140824233143.GQ71691@funkthat.com> <3AC10D0D-2BD8-4D30-A033-7EE9D923F408@xcllnt.net> <53FAEA31.1070108@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_757AD842-0A21-49E3-9AC8-2B78A23C85C6
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=iso-8859-1


On Aug 25, 2014, at 12:48 AM, Andrey V. Elsukov <bu7cher@yandex.ru> wrote:

> On 25.08.2014 03:55, Marcel Moolenaar wrote:
>>> Though, w/ people dd'ing images onto disks, and using growfs to grow
>>> as necessary, we might want to allocate a few more more than the
>>> minimum...  I do agree that we want to keep sizes to a minimum...
>> 
>> One thing I can maybe do is simply fill the empty sectors
>> that are there because of alignment. If you add -P 4K to
>> mkimg, then the first partition will by 4K aligned and you
>> have about 5 sectors unused between the end of the GPT
>> table and the first sector of the first partition. I may
>> as well extend the table to cover those unued sectors.
> 
> IMHO, mkimg should behave like gpart and create images in
> gpart-compatible way.

It already does. There's s difference between behaving
like something else or behaving exactly identical to
that something. The same applies to compatible. It is
not the same as identical.

There is no compatibility issue. mkimg follows the GPT
specification (modulo bugs) and gpart happily groks the
partition table.

> Some users may want to copy the partition layout
> from the image to real hardware and they will not be able to do it.

I'm inclined to say that generally speaking this is not
possible. The GPT has metadata in the first few sectors
*and* the last few sectors and LBAs of these sectors are
part of the metadata. You cannot blindly copy an image
onto a physical medium unless the image and the physical
medium are of exactly the same size. Odds are they are
not.

To reliably transfer or convert an image (e.g. RAW->VHD)
one must modify the image as part of the process. Not a
hard rule, but best to assume as a rule of thumb. This
seems to warrant a utility all by itself.

> 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.

-- 
Marcel Moolenaar
marcel@xcllnt.net



--Apple-Mail=_757AD842-0A21-49E3-9AC8-2B78A23C85C6
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlP7SvIACgkQpgWlLWHuifZl5wCeOzKi+goy+G3DWYgpyaYHX+Mp
nOcAmwQXh+tDRxxUcw+vWkCvlSgB5jij
=/jUa
-----END PGP SIGNATURE-----

--Apple-Mail=_757AD842-0A21-49E3-9AC8-2B78A23C85C6--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B44B1E51-0F9E-41ED-B37F-DA2A9E6334FC>