From ddead341c580e9da21f195c5b3815ec05697bf33 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 9 May 2017 14:30:36 +0200 Subject: 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 --- disk-utils/fdisk-list.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'disk-utils/fdisk-list.c') diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c index c9560f42b..034c01901 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)) { -- cgit v1.2.3-55-g7522