]> git.ipfire.org Git - thirdparty/util-linux.git/commit
gpt: create empty disklabels
authorDavidlohr Bueso <dave@gnu.org>
Sat, 27 Oct 2012 17:23:47 +0000 (19:23 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 2 Nov 2012 11:26:17 +0000 (12:26 +0100)
commit3f73100190e26d531b715dccfcf7ea07936d6a9d
tree560560de2da225f67db864d188849cf989c98ce7
parent1961311196cdc290d5e0951f29882d42e01dadd9
gpt: create empty disklabels

This patch enables creating a new, empty, GPT disklabel from either
an empty disk or one that already has a disklabel. For this
purpose, a 'g' option is added to the main menu and is visible to all
labels. Here's an example for a scsi_debug device (/dev/sdb):

...
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x20a614c8.
3696: fdisk:  CONTEXT: zeroize in-memory first sector buffer

Command (m for help): g
3696: fdisk:    LABEL: changing to gpt label

3696: fdisk:  CONTEXT: zeroize in-memory first sector buffer
3696: fdisk:    LABEL: created new empty GPT disklabel (GUID: D4EA0706-F011-46DC-B7DE-6A72C7090AF8)

Command (m for help): w
The partition table has been altered!
...

Acked-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisks/fdisk.c
fdisks/gpt.c