]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dmsquash-live-autooverlay): re-read partition table after creation
authorNadzeya Hutsko <nadzeya.hutsko@canonical.com>
Thu, 22 Jan 2026 12:03:28 +0000 (13:03 +0100)
committerBenjamin Drung <bdrung@ubuntu.com>
Thu, 22 Jan 2026 12:54:30 +0000 (13:54 +0100)
After parted creates the overlay partition, the kernel's in-memory
partition table is not automatically updated. This causes mkfs to fail
with "The file /dev/sdX does not exist" on some systems.

Add blockdev --rereadpt to force the kernel to re-read the partition
table before attempting to create the filesystem.

modules.d/70dmsquash-live-autooverlay/create-overlay.sh

index 00d76d64e42e63906422235cf01c59b65f7c0cef..b3632ffecc13d81f6f6ceb9467bbec6c2278482d 100755 (executable)
@@ -78,6 +78,7 @@ gatherData() {
 
 createPartition() {
     parted --script --align optimal "${blockDevice}" mkpart primary ${partitionStart}% 100%
+    blockdev --rereadpt "${blockDevice}"
 }
 
 createFilesystem() {