From 5dbff4c0eb7c326e21891b6ce4f123ba96511f87 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 31 May 2007 14:31:51 +0200 Subject: fdisk: add GPT detection code The GPT (GUID Partition Table) is unsupported by fdisk, sfdisk and cfdisk. Unfortunately, the fdisk doesn't complain about GPT.. that's dangerous, because user is able to blindly edit PT with unexpected results. Signed-off-by: Karel Zak --- fdisk/cfdisk.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fdisk/cfdisk.c') diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c index cd0f68648..40b234608 100644 --- a/fdisk/cfdisk.c +++ b/fdisk/cfdisk.c @@ -83,6 +83,7 @@ #include "nls.h" #include "xstrncpy.h" #include "common.h" +#include "gpt.h" #define DEFAULT_DEVICE "/dev/hda" #define ALTERNATE_DEVICE "/dev/sda" @@ -1669,6 +1670,13 @@ fill_p_info(void) { opentype = O_RDWR; opened = TRUE; + if (gpt_probe_signature_devname(fd)) { + print_warning(_("Warning!! Unsupported GPT (GUID Partition Table) detected. Use GNU Parted.")); + refresh(); + getch(); + clear_warning(); + } + /* Blocks are visible in more than one way: e.g. as block on /dev/hda and as block on /dev/hda3 By a bug in the Linux buffer cache, we will see the old -- cgit v1.2.3-55-g7522