From d6415ce25b71230d252b20b3b84386690db72516 Mon Sep 17 00:00:00 2001 From: jpsollie Date: Wed, 9 Jun 2021 15:03:38 +0200 Subject: [PATCH] add a blk_wipe function call Remove any possible filesystems left on the block device when formatting this makes sure the automounter does not accidentally mount it as another filesystem. one of the functionalities possibly wiped by accodent? Signed-off-by: jpsollie --- tools-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools-util.c b/tools-util.c index 361419ae..3cc0de44 100644 --- a/tools-util.c +++ b/tools-util.c @@ -289,6 +289,8 @@ int open_for_format(const char *dev, bool force) fputs("Proceed anyway?", stdout); if (!ask_yn()) exit(EXIT_FAILURE); + while (blkid_do_probe(pr) == 0) + blkid_do_wipe(pr, 0); } blkid_free_probe(pr);