mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
26 lines
688 B
Bash
26 lines
688 B
Bash
#!/bin/bash
|
|
### BEGIN INIT INFO
|
|
# Provides: expand-volume
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Should-Start:
|
|
# Should-Stop:
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop:
|
|
# Description: Expand the filesystem of the mounted root volume to its maximum possible size
|
|
### END INIT INFO
|
|
|
|
prog=$(basename $0)
|
|
logger="logger -t $prog"
|
|
|
|
device_path="/dev/xvda1"
|
|
|
|
filesystem=`blkid | grep $device_path | sed 's#\(.*\):.*TYPE="\(.*\)".*#\2#'`
|
|
|
|
case $filesystem in
|
|
xfs) xfs_growfs / ;;
|
|
ext2) resize2fs $device_path ;;
|
|
ext3) resize2fs $device_path ;;
|
|
ext4) resize2fs $device_path ;;
|
|
*) $logger "The filesystem $filesystem was not recognized. Unable to expand size." ;;
|
|
esac
|