Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2004 17:02:10 -0600
From:      Eugene Lee <list-freebsd@fsck.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: resizing partitions in the same slice
Message-ID:  <20040312230210.GC16477@Dark-Age.local>
In-Reply-To: <200403121922.i2CJMLa19763@clunix.cl.msu.edu>
References:  <20040312184702.GA16477@Dark-Age.local> <200403121922.i2CJMLa19763@clunix.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 12, 2004 at 02:22:21PM -0500, Jerry McAllister wrote:
: Eugene Lee asked:
: > 
: > 	/dev/da0s1g   2064302 1464672  434486    77%    /usr
: > 	/dev/da0s1h  10660096     720 9806570     0%    /data
: > 
: > 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.
[...]
: > 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?
: 
: Yes and no.   I do not think you can shrink a partition with these.
: Since, in order to grow /dev/da0s1g you will have to shrink /dev/da0s1h
: I think you cannot do what you want.   I may well be wrong on this.
: I haven't tried it.

I'm a little surprised.  I would think that resizing partitions is a
common request, that the idea of growing one partition while shrinking
another is not a new or rare notion.  Can anyone else share their views
or experiences?  The list archives contain few comments on the subject.

BTW, some places have recommended commercial solution like Norton Ghost
or Partition Magic.  Do these products work on FreeBSD's UFS format and
grok partitions-in-a-slice?

[...symlinking /usr/{ports,local,src} to elsewhere...]
: 
: This should give you back quite a lot of your /usr file system
: Although ports, local and src are the usual hogs, you may need
: to use du in the /usr directory to find out what else is taking
: lots of space if these aren't the ones.   Do you have a bunch of
: home directories there or are you making them in /data for example.

I have /usr/home, and other stuff in /data.  I guess I could always
symlink /usr/src to /data/src when doing a buildworld.  Drats.

: > 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?  :-)
: 
: Editing the disklabel will change the partition sizes.  
: Definitely /dev/da0s1h will be messed up.   Running newfs on it
: will build a new filesystem in whatever is now that partition.

Got it.  I figured as much, but it's always good to get other opinions.
Jerry, thanks for the feedback!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040312230210.GC16477>