gpart 使用笔记
需求
将260G 的/home 分区拆成/home与/data,原/home分区上的数据不用保留,新/home为100G,剩余空间给/data
gpart过程
1、df 结果:
# Device Mountpoint FStype Options Dump Pass#
/dev/aacd0s1a / ufs rw 1 1
/dev/aacd0s1g /home ufs rw,noatime 2 2
/dev/aacd0s1f /tmp ufs rw 2 2
/dev/aacd0s1d /usr ufs rw 2 2
/dev/aacd0s1e /var ufs rw 2 2
/dev/aacd0s1b none swap sw 0 0
proc /proc procfs rw 0 0
2、删除/home:
#umount /home
#index 为7是因为g排在第7
#gpart delete -i 7 /dev/aacd0s1
aacd0s1g deleted
3、建立/home,大小为100G:
#gpart add -t freebsd-ufs -s 100G -i 7 /dev/aacd0s1
aacd0s1g added
#newfs -U /dev/aacd0s1g
#mkdir /home
#mount /dev/aacd0s1g /home
4、建立/data:
#gpart add -t freebsd-ufs -i 8 /dev/aacd0s1
aacd0s1h added
#newfs -U /dev/aacd0s1h
#mkdir /data
#mount /dev/aacd0s1h /data