resizing my slices/partitions - was pruning the Ports tree

Bill Moran wmoran at potentialtech.com
Sat Jul 10 14:50:11 PDT 2004


[Please wrap your lines around 72 chars or so ... see
http://www.lemis.com/questions.html ]

"Graham North" <graham.north at telus.net> wrote:
> Hello all:
> 
> I would like to  expand my FreeBSD partion on the hard drive of which it only
> has 60%.
> The rest of the HD holds an old installation of Win98.
> 
> When I first installed FBSD 4.8 I used Partition Magic to carve off 1.2G of a
> 2.0G HD and give me dual boot capability so as to retain the Win98.    After
> recently installing a full ports tree I find that my FBSD /usr slice is
> almost out of file handles.

This is very unusual.  There are generally more than enough inodes so that
you don't run out of inodes before you run out of space.  Did you use
custom options to newfs when you created the filesystem?  Do you have a TON
of small files?

You may want to just ckeck the filesystem and see what's eating up all the
inodes to make sure it isn't something you can just delete.  My /usr
filesystem is 10G, and the defaults created over 1 million inodes.  I'm
using 2.7G and 170,000 inodes, which means I'll run out of space when I
still have 1/2-million free inodes.

> Of course I can blow everything away, reformat and re-install, but my
> preference would be to:
> 1) shutdown
> 2)use my partion magic boot disk to reformat the 800MB windows partion
> 3)use sysinstall to expand my /usr slice, maybe even resize some of the others
> 
> Perhaps I can do this all with sysintall without even shutting down?   I have
> not used that program since my original install 6 months ago so am not sure
> of its capabilities, weaknesses and strengths.

You've got the right idea, but you're a little off.

_Assuming_ your Windows partition is the last partition on the HDD, and the
/usr partition is second to last, the following will work:

1) BACK UP any important data ... this procedure is easy to screw up!
2) Use PM or something similar to remove the Win partition and expenad the
   BSD partition to take up the space used by Win.  You can also use BSD's
   disklabel and related utilities to do this (in single-user mode).
3) Boot FreeBSD into single-user mode
4) Use growfs to increase the size of the /usr filesystem to take up the
   partition.

Since inodes are laid out in as a ration of #inodes/block, newfs will add
more inodes in ration to the amount of space added.  My point is that if you
continue to use the filesystem in this manner, you're still going to run out
of inodes before you fill the drive (even with the increased space).
Although, this is a valid short-term fix that will provide you with more
inodes.

Depending on what you want to accomplish (long term) you may want to take
the time now to backup this filesystem and re-newfs it with a value for
-i that's appropriate.  See the man page for newfs for more details.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com


More information about the freebsd-questions mailing list