]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: warn if disk on use
authorKarel Zak <kzak@redhat.com>
Thu, 15 Apr 2021 12:39:11 +0000 (14:39 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Apr 2021 12:39:11 +0000 (14:39 +0200)
Fixes: https://github.com/karelzak/util-linux/issues/1278
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index 5ae21e73a660feb43c66a1904ce032e09347f4ec..747953b22a95c04b8b2e7391c09d8f694674801a 100644 (file)
@@ -2570,6 +2570,8 @@ static int ui_run(struct cfdisk *cf)
 
        if (fdisk_is_readonly(cf->cxt))
                ui_warnx(_("Device is open in read-only mode. Changes will remain in memory only."));
+       else if (cf->device_is_used)
+               ui_warnx(_("Device is currently in use, repartitioning is probably a bad idea."));
        else if (cf->wrong_order)
                ui_info(_("Note that partition table entries are not in disk order now."));