summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2007-05-31 14:31:51 +0200
committerKarel Zak2007-06-05 10:40:14 +0200
commit5dbff4c0eb7c326e21891b6ce4f123ba96511f87 (patch)
tree0d49f7da1065d4c772b38e455260f5ac0731eb4d /fdisk/cfdisk.c
parentfdisk: Makefile.am refactoring (diff)
downloadkernel-qcow2-util-linux-5dbff4c0eb7c326e21891b6ce4f123ba96511f87.tar.gz
kernel-qcow2-util-linux-5dbff4c0eb7c326e21891b6ce4f123ba96511f87.tar.xz
kernel-qcow2-util-linux-5dbff4c0eb7c326e21891b6ce4f123ba96511f87.zip
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 <kzak@redhat.com>
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c8
1 files changed, 8 insertions, 0 deletions
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