From 59480bb7f0223c5af2bbddf48dc3e156fcbff1e6 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Sun, 7 Jun 2026 12:46:09 +0200 Subject: [PATCH] repart: Rescan after writing partition table on factory reset 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/repart/repart.c b/src/repart/repart.c index 501f2cd1e4..fcb30b0df7 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -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; }