Resizing disk labels

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Nov 25 05:11:09 PST 2003


On Tue, Nov 25, 2003 at 02:16:52PM +0200, Roland Giesler wrote:
> I have installed FreeBSD in a server with the default setting in the label
> editor.  I hope my terminology is correct, since I'm refering to /etc /usr
> etc.  Now I've installed a squid, KDE, DHCP, Java (not complete yet!),
> Apache and some other stuff.  While installing Qmail, I ran out of disk
> space on /etc. but /usr still has 17GB free.

Terminology slightly muddled, but I understand clearly enough.  Your
partitions (as laid out within the containing slice using
disklabel(8)) turn out not to be quite suitable.

Do you really mean that you've run out of space in /etc? The default
with qmail is to install under /var/qmail -- which is a result of
DJB's somewhat ideosyncratic take on hier(7).  Now /var is fairly
small in the default layout generated by sysinstall(8), and I can see
you overflowing it fairly easily.  You can reclaim some space in /var by
de-installing and re-installing the qmail port using the more usual
PREFIX setting of /usr/local:

	# pkg_delete -f qmail-\*
        # portinstall -m PREFIX=/usr/local  mail/qmail

However, /var is where people's inboxes are stored by default (under
/var/mail) and if this machine is going to do a lot of mail traffic
then you need a fair amount of space there.

If it really is /etc that has run out of space then first question is:
did you put /etc on a different partition to the root?  If so, you're
going to have a great deal of difficulty rebooting your system.  So
don't do that.  /etc should have a relatively small amount of stuff in
it, but those files include all of the really important system
configuration files, the scripts used to do the actual booting process
and other goodies that the system has to be able to find very early in
the boot process when only the root partition is yet available.
 
> How can I resize the "labels" so /etc grows to 1GB for example?  I've
> searched all over and it appears that one can grow the size, but not shrink
> it?

The answer is "with some difficulty".  If you want to work "in place"
-- without trashing the existing contents of a filesystem -- the only
thing you can do is increase the size of the partition, and then only
be adding new space immediately adjacent to the current end of the
partition.  Adding space at the end of a partition either requires you
to be using something like vinum(8), or for you to have cunningly left
an unused gap between the end of the partition you want to expand and
the next partition on the drive.  You can't steal some space from the
front of the next partition without destroying the filesystem and any
contents on it.

Ultimately the least problematic way for you to procede would be to
back up everything you've done so far, wipe your disk clean and start
over with a fresh install: this time, make sure you choose better
sizes for the different partitions.  If you take care to keep the
partitions in the same order as before, you should be able to restore
your the back-ups of your previous setup onto the re-partitioned drive
without difficulty.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20031125/7399fe8e/attachment.bin


More information about the freebsd-questions mailing list