mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-15 11:22:43 +03:00
Only try to expand root which is ext4
Root filesystem may be tmpfs or something else, in which case we should not call resize2fs.
This commit is contained in:
parent
02c0c31703
commit
a7600fb5ff
@ -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/}/..")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user