I have read about 10 different sets of instructions on how to resize my root partition. Many of them don't apply because of different file systems, different partition tables, and different versions of FreeBSD. So, here I am asking the question like so many have before, but mine is slightly different 
I originally installed something like FreeBSD 5 on this machine, and the parition / slice layout has remained the same. In the last few upgrades, I haven't had room for /boot/kernel.old anymore, having to purge it to upgrade the kernel. Now, it is at the point where /boot/kernel barely fits. I could probably disable some kernel modules that I don't need, but I thought I should grow the root partition.
Here is the situation:
My thought was to steal some space from the swap, since it is directly after the root partition. I'm not sure of the correct way to do this. If possible, I would like to do it live, but I can drop it to single user after hours.
I originally installed something like FreeBSD 5 on this machine, and the parition / slice layout has remained the same. In the last few upgrades, I haven't had room for /boot/kernel.old anymore, having to purge it to upgrade the kernel. Now, it is at the point where /boot/kernel barely fits. I could probably disable some kernel modules that I don't need, but I thought I should grow the root partition.
Here is the situation:
Code:
$bsdlabel mfid0s1
# /dev/mfid0s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 1048576 0 4.2BSD 2048 16384 8
b: 8388608 1048576 swap
c: 974117277 0 unused 0 0 # "raw" part, don't edit
d: 10452992 9437184 4.2BSD 2048 16384 28528
e: 1048576 19890176 4.2BSD 2048 16384 8
f: 953178525 20938752 4.2BSD 2048 16384 28528
Code:
$df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/mfid0s1a 507630 471508 -4488 101% /
devfs 1 1 0 100% /dev
/dev/mfid0s1e 507630 6178 460842 1% /tmp
/dev/mfid0s1f 461587862 19653692 405007142 5% /usr
/dev/mfid0s1d 5060654 2026636 2629166 44% /var
fdescfs 1 1 0 100% /dev/fd
Code:
$gpart show
=> 63 974127041 mfid0 MBR (465G)
63 974117277 1 freebsd [active] (464G)
974117340 9764 - free - (4.8M)
=> 0 974117277 mfid0s1 BSD (464G)
0 1048576 1 freebsd-ufs (512M)
1048576 8388608 2 freebsd-swap (4.0G)
9437184 10452992 4 freebsd-ufs (5.0G)
19890176 1048576 5 freebsd-ufs (512M)
20938752 953178525 6 freebsd-ufs (455G)
Code:
FreeBSD - 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #2 r272394M: Thu Oct 2 23:18:05 PDT 2014
My thought was to steal some space from the swap, since it is directly after the root partition. I'm not sure of the correct way to do this. If possible, I would like to do it live, but I can drop it to single user after hours.