From 323f415fa8b23d5849bc4c4a983fbcd8ec8a588b Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 17 Dec 2020 14:09:43 +0100 Subject: [PATCH] Mount boot partition sync (#1092) (#1101) When we write the update to the boot partiton, there is nothing which makes sure that data is written to disk. This leaves a rather large window (probably around 30s) where a machine reset/poweroff can lead to a corrupted boot partition. Use the sync mount option to minimize the corruption window. Note that sync is not ideal for flash drives normally. But since we write very little and typically only on OS update to the boot partition, this shouldn't be a problem. --- .../rootfs-overlay/usr/lib/systemd/system/mnt-boot.mount | 1 + 1 file changed, 1 insertion(+) diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mnt-boot.mount b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mnt-boot.mount index c2008cd5d..e9f70d67b 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mnt-boot.mount +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mnt-boot.mount @@ -10,6 +10,7 @@ Wants=systemd-fsck@dev-disk-by\x2dlabel-hassos\x2dboot.service What=/dev/disk/by-label/hassos-boot Where=/mnt/boot Type=auto +Options=sync [Install] WantedBy=local-fs.target