Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143619427
D19095.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1014 B
Referenced Files
None
Subscribers
None
D19095.diff
View Options
Index: head/libexec/rc/rc.d/growfs
===================================================================
--- head/libexec/rc/rc.d/growfs
+++ head/libexec/rc/rc.d/growfs
@@ -49,7 +49,20 @@
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 }}')
+ case "$FSTYPE" in
+ ufs)
+ rootdev=${FSDEV#/dev/}
+ ;;
+ zfs)
+ pool=${FSDEV%%/*}
+ rootdev=$(zpool list -v $pool | tail -n 1 | awk '{ print $1 }')
+ ;;
+ *)
+ echo "Don't know how to grow root filesystem type: $FSTYPE"
+ return
+ esac
if [ x"$rootdev" = x"${rootdev%/*}" ]; then
# raw device
rawdev="$rootdev"
@@ -91,7 +104,14 @@
}
}' dev="$rawdev"
gpart commit "$rootdev"
- growfs -y /dev/"$rootdev"
+ case "$FSTYPE" in
+ ufs)
+ growfs -y /dev/"$rootdev"
+ ;;
+ zfs)
+ zpool online -e $pool $rootdev
+ ;;
+ esac
}
load_rc_config $name
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 1, 2:17 AM (8 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28248588
Default Alt Text
D19095.diff (1014 B)
Attached To
Mode
D19095: Teach /etc/rc.d/growfs to handle disks with ZFS
Attached
Detach File
Event Timeline
Log In to Comment