resizing partitions in the same slice

Eugene Lee list-freebsd at fsck.net
Fri Mar 12 10:47:06 PST 2004


My FreeBSD-4.9 setup uses one drive in "dangerously dedicated partition"
where all of my partitions live in one slice:

	$ df
	Filesystem  1K-blocks    Used   Avail Capacity  Mounted on
	/dev/da0s1a     64462   37886   21420    64%    /
	/dev/da0s1e     64462       4   59302     0%    /tmp
	/dev/da0s1f    516062    6086  468692     1%    /var
	/dev/da0s1g   2064302 1464672  434486    77%    /usr
	/dev/da0s1h  10660096     720 9806570     0%    /data
	procfs              4       4       0   100%    /proc

I almost run out of space during a buildworld, so I'd like to expand
/usr from 2 GB to 4 GB by taking space away from /data.  Since my
filesystems will remain in the same slice, is it correct that I don't
need to use fdisk(8)?

So my procedure to do this is to recalculate the size/offset/cylinder
settings for my partitions "g" & "h", change those settings via
disklabel(8), then use growfs(8) on /dev/da0s1g?  Seems simple enough,
and the data on /usr should be preserved, correct?

But will /dev/da0s1h be okay?  Is editing the disklabel enough?  Or do I
need to reformat the partition --- and, if so, how?  I'm not too comfy
using newfs(8) directly.  Can I just run "newfs /dev/da0s1h" after
running the growfs(8) command and it will use the disklabel settings?
Or can I be a wuss and use /stand/sysinstall?  :-)

Any suggestions are appreciated, thanks in advance!



More information about the freebsd-questions mailing list