]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Rescan after writing partition table on factory reset
authorValentin David <me@valentindavid.com>
Sun, 7 Jun 2026 10:46:09 +0000 (12:46 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 15 Jun 2026 08:03:49 +0000 (10:03 +0200)
If a partition gets removed due to factory reset, we will recreate it
as blkpg later. So it needs to get removed. So rescan is needed to be
done after we write the partition table for factory reset.

Fixes #42453

src/repart/repart.c

index 501f2cd1e43d540450531320d94150f2174d4470..fcb30b0df7b3179e0f4b80104cb795c0f0784e98 100644 (file)
@@ -8707,6 +8707,9 @@ static int context_factory_reset(Context *context) {
         if (r < 0)
                 return log_error_errno(r, "Failed to write disk label: %m");
 
+        /* We do not want to stop if partscan has errors */
+        (void) context_partscan(context);
+
         log_info("Successfully deleted %zu partitions.", n);
         return 1;
 }