diff options
author | Karel Zak | 2017-05-09 14:30:36 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-09 14:30:36 +0200 |
commit | ddead341c580e9da21f195c5b3815ec05697bf33 (patch) | |
tree | 336efb3af8c55a0f5d272bccc02de8d89c0fd648 /disk-utils/fdisk-list.c | |
parent | libfdisk: add fdisk_partition_has_wipe() (diff) | |
download | kernel-qcow2-util-linux-ddead341c580e9da21f195c5b3815ec05697bf33.tar.gz kernel-qcow2-util-linux-ddead341c580e9da21f195c5b3815ec05697bf33.tar.xz kernel-qcow2-util-linux-ddead341c580e9da21f195c5b3815ec05697bf33.zip |
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 <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk-list.c')
-rw-r--r-- | disk-utils/fdisk-list.c | 7 |
1 files changed, 7 insertions, 0 deletions
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)) { |