From: Karel Zak Date: Mon, 6 Oct 2014 12:53:25 +0000 (+0200) Subject: sfdisk: add --label-nested for hybrid GPT X-Git-Tag: v2.26-rc1~343 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1422de3d83326b6cd6e559b0f6653a451e7ef92;p=thirdparty%2Futil-linux.git sfdisk: add --label-nested for hybrid GPT regular disk label: # sfdisk --list /dev/sdb .. Disklabel type: gpt Disk identifier: 9DF9A9F1-0654-4E7A-9A5E-36E66D60FD79 Device Start End Sectors Size Type /dev/sdb1 2048 22527 20480 10M Linux filesystem /dev/sdb2 22528 43007 20480 10M Linux swap /dev/sdb3 43008 204766 161759 79M Linux filesystem nested (PMBR): # sfdisk --list --label-nested dos /dev/sdb ... Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/sdb1 1 204799 204799 100M ee GPT and for example: # sfdisk --label-nested dos /dev/sdb < --- diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8 index 226fa34214..8f905174f9 100644 --- a/disk-utils/sfdisk.8 +++ b/disk-utils/sfdisk.8 @@ -147,6 +147,10 @@ Specify disk label type (e.g. dos, gpt, ...). If no label specified then sfdisk defaults to an existing label. If there is no label on the device than defaults to "dos". .TP +.BR \-Y , " \-\-label-nested \fItype\fR +Force sfdisk to edit nested disk label. The primary disk label has to already exist. +This option allows to edit for example hybrid/protective MBR on devices with GPT. +.TP .BR \-h , " \-\-help" Display help text and exit. .TP diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 7a5e8be8d0..faaaf3feda 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -79,6 +79,7 @@ struct sfdisk { int act; /* action */ int partno; /* -N , default -1 */ const char *label; /* --label