]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: wipe device if create a new label
authorKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2016 11:57:31 +0000 (12:57 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2016 11:58:12 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index d16766dc84511145eff393921d76182d88e828ce..010a196985ef78decea82d85072b734cf541f19f 100644 (file)
@@ -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)