[KLUG Members] Need more space for /var

Bob Kanaley members@kalamazoolinux.org
Fri, 16 May 2003 17:23:13 -0500


KLUGites,

I am in need of some expert KLUG guidance to get me through a partition
space allocation problem.

When my production SMTP/POP3 mail server crashed and burned, I quickly threw
together a replacement. Of course it is still being used months later. The
replacement is a poorly partitioned hard disk with RedHat 7.0 (Guiness)
Kernel 2.2.16-22 on an i686.

Mail goes to /var/spool/mail/username. /var is in a very small partition;
rotated log files accumulated. Last week while getting pipeline slammed with
junk mail, I got an insufficient system storage message. Since that time I
have been getting intermittent complaints from users saying mail is not
coming or going as usual (Duh). I moved all my rotated log files into
another partition to buy enough time to figure out what I am doing.

I need to get some more space for /var until I can get the time to rebuild
the real mail server. I know the best answer to this is to use Logical
Volume Manager to dynamically allocate space, but RedHat 7.0 doesn’t support
LVM. I don’t want to go through an OS upgrade/replacement and learn how to
set up LVM while my mail server is down and I have 50 angry people standing
outside my office. I need this fix to be as quick and clean as possible.

I am not opposed to stuffing a second old 250 MB hard disk into this box and
mounting it as /var, but I am a little shaky on how to get the data
currently in /var over to the new hard disk without screwing things up. I
don’t think that I can do a disk dump while all my log files are open and
being written to.

If I am wrong about this, then it should be a piece of cake to down the
server, install the second hard disk, cfdisk and mke2fs /dev/hdb. Then dd
/dev/hda7 (current /var) to /dev/hdb1 (/var to be). Then all I should have
to do is edit /etc/fstab on the original disk to have /dev/hdb1 mount as
/var. Unmount everybody, reboot and I should be back online in short order.

If I can’t dd the original /var while booted from the original hard disk,
then I think I have to boot from an install or rescue disk. I should then be
able to mount the current hard disk, cfdisk the second disk, create an ext2
file system and mount it. From there I would think that I should be able to
dd /dev/hda7 (current /var) to /dev/hdb1 (/var to be) then edit /etc/fstab
on the original disk and reboot.

Am I on the right track here or completely in left field?

Thanks in advance for any responses.

Bob

Robert V. Kanaley
Manager Information Systems
Agdia, Inc.
rvk@agdia.com
http://www.agdia.com