I have a KVM virual machine running FreeBSD 9.1, with a typical one-partition layout with slices for swap, /, /tmp, /var, /usr. Now I need to upgrade that virtual server, beside others to a larger harddisk.
I don't want to re-install the whole system and all server applications, so I would rather like to increase the slice sizes of the existing system.
I have seen onlilne that it is quite easy to increase the size of the last slice in the partition, usually /usr, using fdisk, disklabel, and growfs. However, I also need to increase the size of the /var slice as well.
root@chaos ~ % bsdlabel /dev/vtbd0s1
# /dev/vtbd0s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 1048576 0 4.2BSD 0 0 0
b: 980816 1048576 swap
c: 31456593 0 unused 0 0 # "raw" part, don't edit
d: 2586624 2029392 4.2BSD 0 0 0
e: 1048576 4616016 4.2BSD 0 0 0
f: 25792001 5664592 4.2BSD 0 0 0
root@chaos ~ % gpart show -l vtbd0
=> 63 31457217 vtbd0 MBR (15G)
63 31456593 1 (null) [active] (15G)
31456656 624 - free - (312k)
root@chaos ~ % df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/vtbd0s1a 495M 215M 240M 47% /
devfs 1.0k 1.0k 0B 100% /dev
/dev/vtbd0s1e 495M 12k 456M 0% /tmp
/dev/vtbd0s1f 11G 2.5G 8.5G 23% /usr
/dev/vtbd0s1d 1.2G 562M 562M 50% /var
Is there any "best practice" approach how to do so?
Or is this a no-go for all other slices other than the last one?
PS: The system uses UFS file system
PPS: Disk I/O via virtio drivers from ports
gpart list
.bsdlabel
is used to read BSD partitions.