4 # Provides: FilesystemResizeUnmounted
5 # RunBefore: MountImage
6 # RunAfter: FixPartitionTable
7 # Short-Description: Resize filesystem to use all the available space
11 . "@commondir@/common.sh"
13 if [ ! -b "$SNF_IMAGE_DEV" ]; then
14 log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
17 if [ -z "$SNF_IMAGE_TYPE" ]; then
18 log_error "Image type does not exist"
21 last_partition=$(get_last_partition "$SNF_IMAGE_DEV")
22 id=$(echo "$last_partition" | cut -d: -f1)
23 ptype=$(echo "$last_partition" | cut -d: -f5)
25 if [[ "$ptype" =~ ext[234] ]]; then
26 device="$SNF_IMAGE_DEV""$id"
27 "$RESIZE2FS" "$device"
32 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :