fdisk: warn if disk in use
Fixes: https://github.com/karelzak/util-linux/issues/1278 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
d527e8cf70
commit
dee0c29c6f
|
@ -1140,6 +1140,12 @@ int main(int argc, char **argv)
|
|||
if (rc)
|
||||
err(EXIT_FAILURE, _("cannot open %s"), devname);
|
||||
|
||||
if (fdisk_device_is_used(cxt))
|
||||
fdisk_warnx(cxt, _(
|
||||
"This disk is currently in use - repartitioning is probably a bad idea.\n"
|
||||
"It's recommended to umount all file systems, and swapoff all swap\n"
|
||||
"partitions on this disk.\n"));
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
if (!fdisk_is_readonly(cxt)
|
||||
|
|
Loading…
Reference in New Issue