Networking Forums

Networking Forums > Computer Networking > Linux Networking > Moving /var/spool/mail

Reply
Thread Tools Display Modes

Moving /var/spool/mail

 
 
dave
Guest
Posts: n/a

 
      12-19-2005, 06:22 PM
Hi,

Please forgive my ignorance. I have a Linux production server that keeps
running out of space on the /var partition. I wish to move /var/spool/mail
to /home/mail. The box runs sendmail (8.11.6) and the majority of user mail
is picked up via ipop3d (v2001.78rh) though occasionally pine is used by
sysadmins.

To help me with this I would be grateful if anyone could answer the
following questions:

(1) If I just link /var/spool/mail to it's new home would there be a major
performance problem? The box is quite quick and has plenty of RAM. Are there
other hazards to this? Presumably even if I re-pointed sendmail and ipop3d I
could leave "legacy" links for other less frequent users?

(2) If I did just link /var/spool/mail to it's new home what is the best
type of link to use, I have used directory symlinks but know there are also
forced hard links. Which would be best?

(3) I know ipop3d has this option put in at compile time so if I want to
avoid all access through the links I'll have to recompile it but I can't
seem to find an option in sendmail.cf for this either. I have found the
/var/spool/mqueue line but nothing pointing to the /var/spool/mail
directory. Is there any way of doing this?

Thanks very much in advance,

Dave.


 
Reply With Quote
 
 
 
 
Joe Beanfish
Guest
Posts: n/a

 
      12-19-2005, 07:02 PM
On Mon, 19 Dec 2005 14:22:47 -0500, dave <(E-Mail Removed)> wrote:

> Hi,
>
> Please forgive my ignorance. I have a Linux production server that keeps
> running out of space on the /var partition. I wish to move /var/spool/mail
> to /home/mail. The box runs sendmail (8.11.6) and the majority of user mail
> is picked up via ipop3d (v2001.78rh) though occasionally pine is used by
> sysadmins.
>
> To help me with this I would be grateful if anyone could answer the
> following questions:
>
> (1) If I just link /var/spool/mail to it's new home would there be a major
> performance problem? The box is quite quick and has plenty of RAM. Are there
> other hazards to this? Presumably even if I re-pointed sendmail and ipop3d I
> could leave "legacy" links for other less frequent users?
>
> (2) If I did just link /var/spool/mail to it's new home what is the best
> type of link to use, I have used directory symlinks but know there are also
> forced hard links. Which would be best?


You can't hard link across filesystems. I'd just do the soft link and
forget about it. I can't imagine there'd be a problem with that.

 
Reply With Quote
 
Keith Keller
Guest
Posts: n/a

 
      12-19-2005, 07:16 PM
On 2005-12-19, dave <(E-Mail Removed)> wrote:
>
> (1) If I just link /var/spool/mail to it's new home would there be a major
> performance problem? The box is quite quick and has plenty of RAM. Are there
> other hazards to this? Presumably even if I re-pointed sendmail and ipop3d I
> could leave "legacy" links for other less frequent users?


There should not be a huge performance hit (if any), and leaving the
link after you reconfigure sendmail and ipop3d is a good idea, in case
someone reads mail using something like Mail or nail.

> (2) If I did just link /var/spool/mail to it's new home what is the best
> type of link to use, I have used directory symlinks but know there are also
> forced hard links. Which would be best?


I've always read that it's a Bad Idea (TM) to use hard links for
directories, but never knew why. Presumably a hard link to a directory
can cause problems for the filesystem or the kernel; the best reference
(which isn't so good, anyway) I've found so far is this thread:

http://lists.debian.org/debian-user/.../msg00333.html

In any case, it sounds like /home and /var are separate filesystems for
your box, so you *must* use a symlink. Hard links only work within one
filesystem.

--keith

--
kkeller-(E-Mail Removed)
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information

 
Reply With Quote
 
Paul Black
Guest
Posts: n/a

 
      12-20-2005, 06:13 AM
Keith Keller wrote:
> I've always read that it's a Bad Idea (TM) to use hard links for
> directories, but never knew why.


Because you have the capacity to create loops in the filesystem: your
recursive commands would never finish unless they had the capability of
detecting the loop.

Paul
 
Reply With Quote
 
Joe Beanfish
Guest
Posts: n/a

 
      12-20-2005, 06:08 PM
On Tue, 20 Dec 2005 02:13:50 -0500, Paul Black <(E-Mail Removed)> wrote:

> Keith Keller wrote:
>> I've always read that it's a Bad Idea (TM) to use hard links for
>> directories, but never knew why.

>
> Because you have the capacity to create loops in the filesystem: your
> recursive commands would never finish unless they had the capability of
> detecting the loop.


Also, on System V, they're very hard to get rid of. I had one once then
deleted it. Every fsck brought it right back.
 
Reply With Quote
 
David Brown
Guest
Posts: n/a

 
      12-21-2005, 08:27 AM
Paul Black wrote:
> Keith Keller wrote:
>> I've always read that it's a Bad Idea (TM) to use hard links for
>> directories, but never knew why.

>
> Because you have the capacity to create loops in the filesystem: your
> recursive commands would never finish unless they had the capability of
> detecting the loop.
>
> Paul


I thought hard-linking directories was not only inadvisable, but illegal
on most file systems (even within the one file system). To quote from
the man page for ln:

-d, -F, --directory
allow the superuser to attempt to hard link directories (note:
will probably fail due to system restrictions, even for the
superuser)

 
Reply With Quote
 
gregnoble
Guest
Posts: n/a

 
      12-21-2005, 08:37 AM
"David Brown" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> I thought hard-linking directories was not only inadvisable, but illegal
> on most file systems (even within the one file system).


And the prisons are already overcrowded as it is.

 
Reply With Quote
 
dave
Guest
Posts: n/a

 
      12-21-2005, 07:07 PM
"gregnoble" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "David Brown" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> I thought hard-linking directories was not only inadvisable, but illegal
>> on most file systems (even within the one file system).

>
> And the prisons are already overcrowded as it is.
>

LOL.

Well thanks everyone for their answers.

I haven't heard anybody screaming don't *soft* link /var/spool/mail though
so I'll assume that would be ok?

Cheers,

Dave.


 
Reply With Quote
 
gregnoble
Guest
Posts: n/a

 
      12-21-2005, 10:05 PM
"dave" <(E-Mail Removed)> wrote in message
news:doccm5$ns9$1$(E-Mail Removed)...

> I haven't heard anybody screaming don't *soft* link /var/spool/mail though
> so I'll assume that would be ok?


It's what most administrators do.

 
Reply With Quote
 
David Brown
Guest
Posts: n/a

 
      12-22-2005, 10:08 AM
gregnoble wrote:
> "dave" <(E-Mail Removed)> wrote in message
> news:doccm5$ns9$1$(E-Mail Removed)...
>
>> I haven't heard anybody screaming don't *soft* link /var/spool/mail though
>> so I'll assume that would be ok?

>
> It's what most administrators do.
>


If you have a spare partition, you could mount it on /var/spool/mail.

For the future, next time you get a new disk, you might want to look
into lvm2, combined with reiserfs file systems. My typical partioning
with linux now is a small boot partition, a root partion (doesn't need
to be too big), and the rest of the disk as a lvm2 physical volume. I
then make logical volumes for things like /home, /usr, and /var, without
worrying too much about sizes. If I run low on space, it's just a
matter of running "lvextend" then "resize_reiserfs" on the partition to
increase its size - it runs in seconds, while the partition is mounted
and in use.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Free Moving Estimate Moving Company Los Angeles linkswanted Wireless Internet 0 01-22-2008 01:20 AM
Moving Mail directory to different partition. Markvr Linux Networking 1 08-16-2006 12:56 PM
Keeping BT e-mail addresses after moving ADSL provider - update AJH Broadband 0 07-27-2005 11:31 AM
Keeping BT e-mail addresses after moving ADSL provider AJH Broadband 10 06-22-2005 02:22 PM
Maildir/ in /var/spool/mail/$user? (postfix) Nick E. Linux Networking 1 01-30-2004 03:11 AM



1 2 3 4 5 6 7 8 9 10 11