]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (gpt) cleanup header size usage
authorKarel Zak <kzak@redhat.com>
Fri, 9 Jan 2015 12:05:49 +0000 (13:05 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Jan 2015 12:05:49 +0000 (13:05 +0100)
commit4bb82a455461e42644c9b3d8aa1206ad8889ed35
tree49ef3dbe5f947a2fe31225cde66e69aecd56d772
parent46a965679686fe4ec276d311d3c19219e48171fa
libfdisk: (gpt) cleanup header size usage

Kay reported that Windows 8.1 installed does not recognize GPT created
by libfdisk, but parted works as expected.

It seems (according to the header hexdump) that the problem is
HeaderSize GPT field where libfdisk uses 512 (header + reserved area),
but parted uses 92. The both is pretty valid according to the current
EFI standard, but 92 is probably more backwardly compatible.

I also found places in code where libfdisk gpt driver is inconsistent
and uses sometimes all sector and simetimes sizeof(gpt_header) only.
The right solution is to read all sector (into zeroized memory) and
later write again all sector to the device.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.8
libfdisk/src/gpt.c