From a7600fb5ff50c51263d8193c4042e8ecfa5aee82 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 13 Apr 2023 19:46:27 +0200 Subject: [PATCH] Only try to expand root which is ext4 Root filesystem may be tmpfs or something else, in which case we should not call resize2fs. --- lib/tiny-cloud/init | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tiny-cloud/init b/lib/tiny-cloud/init index cf51e98..ee3fdbc 100644 --- a/lib/tiny-cloud/init +++ b/lib/tiny-cloud/init @@ -31,8 +31,15 @@ INIT_ACTIONS_FINAL=" init__expand_root() { local dev=$(awk '$2 == "/" {print $1}' "$ROOT"/proc/mounts) + local filesystem=$(awk '$2 == "/" {print $3}' "$ROOT"/proc/mounts) local partition=$(cat "$ROOT/sys/class/block/${dev#/dev/}/partition" 2>/dev/null) + # only support ext2/ext3/ext4 for now + case "$filesystem" in + ext*) ;; + *) return;; + esac + if [ -n "$partition" ]; then # it's a partition, resize it local volume=$(readlink -f "$ROOT/sys/class/block/${dev#/dev/}/..")