Index: libexec/rc/rc.d/growfs =================================================================== --- libexec/rc/rc.d/growfs +++ libexec/rc/rc.d/growfs @@ -49,7 +49,17 @@ growfs_start () { echo "Growing root partition to fill device" - rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }') + FSTYPE=$(mount -p | awk '{ if ( $2 == "/") { print $3 }}') + FSDEV=$(mount -p | awk '{ if ( $2 == "/") { print $1 }}') + if [ "$FSTYPE" = "ufs" ]; then + rootdev=${FSDEV#/dev/} + elif [ "$FSTYPE" = "zfs" ]; then + pool=${FSDEV%%/*} + rootdev=$(zpool list -v $pool | tail -n 1 | awk '{ print $1 }') + else + echo "Don't know how to grow root filesystem type: $FSTYPE" + return + fi if [ x"$rootdev" = x"${rootdev%/*}" ]; then # raw device rawdev="$rootdev" @@ -91,7 +101,11 @@ } }' dev="$rawdev" gpart commit "$rootdev" - growfs -y /dev/"$rootdev" + if [ "$FSTYPE" = "ufs" ]; then + growfs -y /dev/"$rootdev" + elif [ "$FSTYPE" = "zfs" ]; then + zpool online -e $pool $rootdev + fi } load_rc_config $name