OSDN Git Service

gpt: do not automatically "correct" a suspicious GPT partition table
authorPetr Uzel <petr.uzel@suse.cz>
Fri, 13 Feb 2009 12:27:55 +0000 (13:27 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 17 Feb 2009 11:46:55 +0000 (12:46 +0100)
commitd7d9f2c40c6bb3e83a7e6ea3164b4f4eb7440a47
treef3364a00b327018623077c08544894abb52e3937
parent7cc930b80ebe50c131f203f17e11f3dba2673a41
gpt: do not automatically "correct" a suspicious GPT partition table

Previously, when parted was invoked on a disk with a GPT partition table
and the backup GPT was not in the last sector of the disk, and even if
the requested operation was just to print the partition table, parted
would "repair" this automatically. This behavior is undesirable in the
following situation:

dm-raid on top of block device. The dm-raid is partitioned with GPT. If
the dm-raid starts on the first block of underlying device (AFAIK this is
the case with FastTrack controllers) and the user runs parted on the
dm-raid, it will identify the physical device as being partitioned with
GPT and see the backup GPT table not to be in the last sector of the
physical device and thus move it to this location (which may lead to
destruction of dm-raid metadata in case they are located at the end of
physical device).

This patch modifies parted's behavior to ignore fixing of backup GPT
position by default.
libparted/labels/gpt.c