From: Valentin David Date: Sun, 7 Jun 2026 10:46:09 +0000 (+0200) Subject: repart: Rescan after writing partition table on factory reset X-Git-Tag: v261-rc4~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59480bb7f0223c5af2bbddf48dc3e156fcbff1e6;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/repart/repart.c b/src/repart/repart.c index 501f2cd1e43..fcb30b0df7b 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; }