Ganbold <[EMAIL PROTECTED]> wrote:

>How to safely move /var/spool/mail directory to somewhere else?
>Because my /var partition is filling up.

If you have another disk or empty space you can create a new filesystem on,
you can probably do something like the following:

Create the new filesystem, using fdisk and mkfs as necessary.

Make a temporary mount point for the new filesystem, like /newmail, or
whatever you like.  Mount the new filesystem.

Stop sendmail or whatever you're using as an SMTP server.  This will
prevent new mail from arriving while you're working on moving things.

Assuming you're using pop3, comment out the pop3 line in /etc/inetd.conf,
then restart inetd.  This will prevent users from retrieving their mail
while you're moving it.  If you're not using pop3, you'll need to stop
whatever you're using.

Copy all users' mail files from /var/spool/mail to /newmail.  Make sure
they got copied and check the permissions as well.  Once you are confident
everything's has been properly copied to the new location, delete the mail
files from /var/spool/mail.

Unmount /newmail and re-mount it as /var/spool/mail.  Edit /etc/fstab to
reflect the new, correct mount point for /var/spool/mail so it will be
mounted properly on the next boot.  (Remember that you must mount /var
first, then /var/spool/mail.)

Restart sendmail.  (or whatever you use for SMTP)

Uncomment the pop3 entry in /etc/inetd.conf and restart inetd.  (Again
assuming you're using pop3.)

Remove the directory /newmail

Send yourself a test message to be sure it works!

That should be about it.  Hopefully I haven't missed anything.

-Eric


Eric Sisler
Library Computer Technician
Westminster Public Library
Westminster, CO, USA
[EMAIL PROTECTED]

Linux - don't fear the Penguin.
Want to know what we use Linux for?
Visit http://gromit.westminster.lib.co.us/linux


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to