]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: inform on 'p' about wiped partitions
authorKarel Zak <kzak@redhat.com>
Tue, 9 May 2017 12:30:36 +0000 (14:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 9 May 2017 12:30:36 +0000 (14:30 +0200)
The wipe operation is potentially dangerous. Let's inform about it
always by 'p' (list) command to make sure user knowns about it.

Command (m for help): p
...
Device     Boot Start    End Sectors Size Id Type
/dev/sdc1        2048 204799  202752  99M 83 Linux

Filesystem/RAID signature on partition 1 will be wiped.

Addresses: https://github.com/karelzak/util-linux/issues/437
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fdisk-list.c

index c9560f42bf09585cf0773c24ee799f6a28101058..034c01901bcb65c242effc290ecff4bd560cde88 100644 (file)
@@ -191,6 +191,13 @@ void list_disklabel(struct fdisk_context *cxt)
                                          fdisk_partition_get_partno(pa) + 1);
                        post++;
                }
+               if (fdisk_partition_has_wipe(cxt, pa)) {
+                       if (!post)
+                               fdisk_info(cxt, ""); /* line break */
+                        fdisk_info(cxt, _("Filesystem/RAID signature on partition %zu will be wiped."),
+                                        fdisk_partition_get_partno(pa) + 1);
+                        post++;
+               }
        }
 
        if (fdisk_table_wrong_order(tb)) {