From 7a6e10df1c335b447ed9e60e2cc1226a42b5f5c8 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 25 Feb 2015 12:28:57 +0100 Subject: [PATCH] Sync filesystems before returning from MBR installation We need to make sure the device/filesystem is synced, otherwise syslinux installation might fail with: | [...] | Installing default MBR | Installing syslinux as bootloader | syslinux: /dev/sdb1: No such file or directory | Fatal: Error executing syslinux (either try --fat16 or use grub?) fsync-ing via dd isn't enough, so we need to make it a full sync. Closes: #779193 --- grml2usb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grml2usb b/grml2usb index 9d5c2ef..e324954 100755 --- a/grml2usb +++ b/grml2usb @@ -645,6 +645,10 @@ def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): raise Exception("error executing dd (third run)") del tmpf + # make sure we sync filesystems before returning + proc = subprocess.Popen(["sync"]) + proc.wait() + def is_writeable(device): """Check if the device is writeable for the current user -- 2.1.4