public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] expand-on-first-boot: Don't fail when using systemd mount units
@ 2019-04-08 14:33 Christian Storm
  2019-04-15  5:44 ` Maxim Yu. Osipov
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Storm @ 2019-04-08 14:33 UTC (permalink / raw)
  To: isar-users; +Cc: Christian Storm

By default, resize2fs fails with the error message "Can't check if
filesystem is mounted due to missing mtab file" if the to be resized
filesystem isn't listed in mtab. This is the case, e.g., when using
systemd mount units instead of /etc/fstab.
Hence, selectively disable this safety check by exporting the
environment variable EXT2FS_NO_MTAB_OK=1 [1].

[1] https://github.com/tytso/e2fsprogs/blob/master/lib/ext2fs/ismounted.c#L111

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 .../expand-on-first-boot/files/expand-last-partition.sh       | 4 ++++
 1 file changed, 4 insertions(+)
 mode change 100644 => 100755 meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh

diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
old mode 100644
new mode 100755
index 4cf90de..08c69db
--- a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
@@ -28,4 +28,8 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | grep -v last-lba | \
 # Inform the kernel about the partitioning change
 partx -u "${LAST_PART}"
 
+# Do not fail resize2fs if no mtab entry is found, e.g.,
+# when using systemd mount units.
+export EXT2FS_NO_MTAB_OK=1
+
 resize2fs "${LAST_PART}"
-- 
2.21.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-15  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 14:33 [PATCH] expand-on-first-boot: Don't fail when using systemd mount units Christian Storm
2019-04-15  5:44 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox