From: Karel Zak Date: Tue, 9 May 2017 12:30:36 +0000 (+0200) Subject: fdisk: inform on 'p' about wiped partitions X-Git-Tag: v2.30-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddead341c580e9da21f195c5b3815ec05697bf33;p=thirdparty%2Futil-linux.git fdisk: inform on 'p' about wiped partitions 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 --- diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c index c9560f42bf..034c01901b 100644 --- a/disk-utils/fdisk-list.c +++ b/disk-utils/fdisk-list.c @@ -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)) {