零、少了20G的查看:
df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ufsid/59a7effe7885633c 19G 5.6G 12G 31% /
devfs 1.0K 1.0K 0B 100% /dev
一、gpart show 查看磁盘空间情况,可以看到磁盘大小是 40G,但是FreeBSD系统盘空间有20G,少了20G。
Welcome to Alibaba Cloud Elastic Compute Service !
root@iZ2ze0upl89i15wngnott5Z:~ # gpart show [img]=> 63 83886017 vtbd0 MBR (40G)
63 1 - free - (512B)
64 41942975 1 freebsd [active] (20G)
41943039 41943041 - free - (20G)
二、gpart recover ada0 恢复磁盘的空闲大小,然后再执行 gpart show 就可以看到磁盘的空闲空间了。
gpart recover vtbd0
vtbd0 recovering is not needed
三、gpart resize -i 3 -a 4k -s 40G vtbd0
gpart resize -i 1 -a 4k -s 39G vtbd0 #注意编号是1: -i 1
vtbd0s1 resized
resize磁盘,我这里是50G的磁盘,但是不只能直接写50G,因为1G被swap占用了,512K被启动分区占用,最多只能使用48G,如果扩容到其他的大小,都需要在磁盘的总大小上减掉2G
growfs /dev/ada0p3
growfs /dev/vtbd0s1
It's strongly recommended to make a backup before growing the file system.
OK to grow filesystem on /dev/vtbd0s1 from 20GB to 39GB? [yes/no] yes
growfs: /dev/vtbd0s1: Operation not permitted
扩容文件系统,执行完成以后会提示是否同意从 19G 扩容到 48G,以及一些风险提醒,直接Yes。
4 、df -h看下能看到成功扩容。
aliyun do the resize the freebsd size:
attachment.php?fid=475[/img]
service growfs onestart
Growing root partition to fill device
vtbd0s1 resized
growfs: requested size 40GB is not larger than the current filesystem size 40GB
https://help.aliyun.com/document_detail/35099.html
df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ufsid/59a7effe7885633c 19G 5.6G 12G 31% /
devfs 1.0K 1.0K 0B 100% /dev
一、gpart show 查看磁盘空间情况,可以看到磁盘大小是 40G,但是FreeBSD系统盘空间有20G,少了20G。
Welcome to Alibaba Cloud Elastic Compute Service !
root@iZ2ze0upl89i15wngnott5Z:~ # gpart show [img]=> 63 83886017 vtbd0 MBR (40G)
63 1 - free - (512B)
64 41942975 1 freebsd [active] (20G)
41943039 41943041 - free - (20G)
二、gpart recover ada0 恢复磁盘的空闲大小,然后再执行 gpart show 就可以看到磁盘的空闲空间了。
gpart recover vtbd0
vtbd0 recovering is not needed
三、gpart resize -i 3 -a 4k -s 40G vtbd0
gpart resize -i 1 -a 4k -s 39G vtbd0 #注意编号是1: -i 1
vtbd0s1 resized
resize磁盘,我这里是50G的磁盘,但是不只能直接写50G,因为1G被swap占用了,512K被启动分区占用,最多只能使用48G,如果扩容到其他的大小,都需要在磁盘的总大小上减掉2G
growfs /dev/ada0p3
growfs /dev/vtbd0s1
It's strongly recommended to make a backup before growing the file system.
OK to grow filesystem on /dev/vtbd0s1 from 20GB to 39GB? [yes/no] yes
growfs: /dev/vtbd0s1: Operation not permitted
扩容文件系统,执行完成以后会提示是否同意从 19G 扩容到 48G,以及一些风险提醒,直接Yes。
4 、df -h看下能看到成功扩容。
aliyun do the resize the freebsd size:
attachment.php?fid=475[/img]
service growfs onestart
Growing root partition to fill device
vtbd0s1 resized
growfs: requested size 40GB is not larger than the current filesystem size 40GB
https://help.aliyun.com/document_detail/35099.html