public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Christian Storm <christian.storm@siemens.com>
To: isar-users@googlegroups.com
Cc: Christian Storm <christian.storm@siemens.com>
Subject: [PATCH] expand-on-first-boot: Don't fail when using systemd mount units
Date: Mon,  8 Apr 2019 16:33:09 +0200	[thread overview]
Message-ID: <20190408143309.3614-1-christian.storm@siemens.com> (raw)

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


             reply	other threads:[~2019-04-08 14:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 14:33 Christian Storm [this message]
2019-04-15  5:44 ` Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190408143309.3614-1-christian.storm@siemens.com \
    --to=christian.storm@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox