diff options
author | Karel Zak | 2016-02-18 12:57:31 +0100 |
---|---|---|
committer | Karel Zak | 2016-02-18 12:58:12 +0100 |
commit | 97ffbd43d2b93242f8fc9fd5d36da8ea08c06d3c (patch) | |
tree | 4f10d1a72d1aed0538dfd5c9747dc02e7f436b44 /disk-utils/cfdisk.c | |
parent | sfdisk: add --wipe (diff) | |
download | kernel-qcow2-util-linux-97ffbd43d2b93242f8fc9fd5d36da8ea08c06d3c.tar.gz kernel-qcow2-util-linux-97ffbd43d2b93242f8fc9fd5d36da8ea08c06d3c.tar.xz kernel-qcow2-util-linux-97ffbd43d2b93242f8fc9fd5d36da8ea08c06d3c.zip |
cfdisk: wipe device if create a new label
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/cfdisk.c')
-rw-r--r-- | disk-utils/cfdisk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index d16766dc8..010a19698 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2435,6 +2435,14 @@ static int ui_run(struct cfdisk *cf) ui_cols = COLS; DBG(UI, ul_debug("start cols=%zu, lines=%zu", ui_cols, ui_lines)); + if (fdisk_get_collision(cf->cxt)) { + ui_warnx(_("Device already contains %s signature, it will be removed by write command."), + fdisk_get_collision(cf->cxt)); + fdisk_enable_wipe(cf->cxt, 1); + ui_hint(_("Press a key to continue.")); + getch(); + } + if (!fdisk_has_label(cf->cxt) || cf->zero_start) { rc = ui_create_label(cf); if (rc < 0) |