LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running out of disk space (https://www.linuxquestions.org/questions/linux-newbie-8/running-out-of-disk-space-70904/)

ann_tulip18 07-08-2003 05:03 AM

Running out of disk space
 
hi! Im newbie in Linux 7.3, and Im encountering problem regarding our mail server.. we cannot receive mails. Ive check the disk space using df -h and here's the output:


filesystem size Used Avail% Use Mounted on
/dev/hda1 1.9G 2.0G 0 100% /
/dev/hda2 981M 137M 794M 15% /home
none 61M 0 61M 0% /dev/shm
/dev/hda5 6.0G 1.7G 4.0G 30% /var

What will I do?! Can u pls. help me? Should I delete files?! What files should i delete..


thanks,
Ann

MasterC 07-08-2003 05:10 AM

First try clearing out /tmp

Then, begin uninstalling applications you don't need/use anymore.

Finally, yes, get a larger HD and stick it in there. That or resize your /var to give more room to /

To resize you should look for an application called parted on www.freshmeat.net

Cool

Poetics 07-08-2003 05:12 AM

Well, it looks like your root dir ("/") is absolutely filled. Deffinately not a good thing, IMO, especially for a mail server. It looks like your logfiles ("/var") really isn't being used as much as you may have thought. Perhaps using a repartitioning utility to decrease that 6 GB partition for /var into perhaps 3 gigs. Put the rest into hda1 to help alieviate the problem.

What directory on /hda1 is using the most space?

Edit: Ooooor as MasterC said :p

ann_tulip18 07-08-2003 08:53 PM

Whats the main cause of this problem? I have tried to delete some log files.. Is there any way to resolve this problem aside partitioning the HD? By the way, our mail server dont have GUI.

Sorry If I have so many question?!


Thanks!

ann

v00d00101 07-08-2003 09:55 PM

Have you worked out what is eating the space, its probably /tmp , but it would help you if you could find that out.

Im not an expert, but if it is the /tmp location that is causing the problem try re-partioning and putting /tmp on its own partition.

If / gets too full all hell tends to break loose.

My suggestion is as above, take 1gb of that /var space and make a /tmp partition.

Then edit /etc/fstab to represent your new change.

ann_tulip18 07-08-2003 10:42 PM

i revoked du- h ./tmp its only 44k.... (hu...hu..hu..) I dont know what eating up the space...

Is it posssible to swap the /var to /dev/hda1 coz it dont use lot of space.. and putting /var to /dev/hda5? How?

If I partition the HD will it destroy some file?
Help me Pls!


THANKS!

Dark_Helmet 07-08-2003 11:49 PM

Type this command:
du -s /* | sort -rn

You'll see some warning for the /proc directory and some others... don't worry about them.

The output of that command will tell you what subdirectories are eating the most space. It will also be listed with the largest directory first. For the sake of being thorough, don't pay any attention to the /var or /home entries because they have their own partition.

So, now that you can see which directory is using the most space, you can issue the command above again, but for that subdirectory. Let me give an example. Let's say after running the command, you got this output:

Code:

# du -s /* | sort -rn
622488 /usr
24092  /bin
17380  /sbin
...

Then you know the /usr directory is eating most of the space. Then you could execute this command:
du -s /usr/* | sort -rn

Then that will tell you which directories in /usr are the biggest. Continue doing that until you find what files are eating the most space, and make a decision about whether to delete them.

ann_tulip18 07-09-2003 01:15 AM

I am checking the disk space right now. but I encountered problem again when I restarted sendmail. There's an error:

postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/incoming/E/D
postfix/postfix-script: warning: not owned by group: postdrop:/var/spool/postfix/maildrop

Whats wrong?


Thanks

ann_tulip18 07-09-2003 02:50 AM

Can anyone help me?? PLEASE!! Our server can no longer receive and send mail...

THANKS!

MasterC 07-09-2003 02:56 AM

Quote:

Originally posted by ann_tulip18
i revoked du- h ./tmp its only 44k.... (hu...hu..hu..) I dont know what eating up the space...

Is it posssible to swap the /var to /dev/hda1 coz it dont use lot of space.. and putting /var to /dev/hda5? How?

If I partition the HD will it destroy some file?
Help me Pls!


THANKS!

It's not the mount point that is running out of space, it's the device. You could swap them, but it'd be MUCH more difficult (require some backing up, and ensuring enough space exists for all info, quite a bit of work) than resizing your partitions. Parted can do this, and it has been noted by several people that it doesn't destroy info. However, you should ALWAYS backup before doing any work on devices such as resizing.

Try invoking du -h on / and see what you get as your most bit hungry piece. You'll be getting a whole lot of info, so I'd probably pipe it and examine your files with less:
du -h | less
Or to a file:
du -h > /home/hog
And then read /home/hog with:
less /home/hog

HTH

Cool

MasterC 07-09-2003 03:00 AM

Re: Running out of disk space
 
Quote:

Originally posted by ann_tulip18
hi! Im newbie in Linux 7.3, and Im encountering problem regarding our mail server.. we cannot receive mails. Ive check the disk space using df -h and here's the output:


filesystem size Used Avail% Use Mounted on
/dev/hda1 1.9G 2.0G 0 100% /
/dev/hda2 981M 137M 794M 15% /home
none 61M 0 61M 0% /dev/shm
/dev/hda5 6.0G 1.7G 4.0G 30% /var

What will I do?! Can u pls. help me? Should I delete files?! What files should i delete..


thanks,
Ann

Can you backup, dump your current partitions together, and then resize them back out? If you are unable to use parted (which you probably will be since your / is full) this is going to be one of your best options. Have you got a CDR handy, could you borrow one, or do you have somewhere online that you could backup the info to? Look for an application called partimage (but again, you dont have any room on / ... man...) to do the backup with.
For now, because of the lack of space completely, I'd say find a large package, uninstall it. Something non-vital, and good luck. This should be able to be found from within the du -h pipe above.

Cool

ann_tulip18 07-09-2003 03:23 AM

Ok.. I will try to uninstall KDE and GNOME, besides, im not using it... Hope it will work...

THANKS

MasterC 07-09-2003 03:39 AM

:eek:

You have X on there? On a mail-server box (assuming that's all you run on that) you should try to only run it from the console. That is, if you have limited room/resources. If you've got the INIAC in your room, feel free to host the www in it's entirety ;)

If you are confortable enough to run linux (at least on this machine) without X, then I suggest taking off more than just KDE and Gnome (although, that will be a big help); take X out completely, and all related applications. However, if you are running this mail-server on a system where other tasks are being accomplished, such as web surfing (desktop use), then you will want to keep X on there, just get a much lighter environment, such as Fluxbox or Openbox.

HTH

Cool

ann_tulip18 07-09-2003 03:47 AM

Yes. I am comfortable with that. It has no GUI. The server is only used for emails.

I think its working, however we were only able to free up more or less 2 MB of disk space. We ain't sure to uninstall other program.

MasterC 07-09-2003 03:56 AM

In your original post you said you were running Linux 7.3, I can only assume this is Redhat 7.3 You should be able to remove things like KDE by:
rpm -e kde

And so on. They were most likely installed via RPM, and so this is going to be the best way to uninstall them. You should be gaining more than 2MB from removing these 2 HD vacuums! :)

I'd give a look again in a few, it's possible that df is simply not reporting back the correct info yet.

Cool

ann_tulip18 07-09-2003 04:05 AM

No KDE program installed, only GNOME. It is now deleted.

I have one more question in my mind, EXACTLY Where does the mail server save logs?

Is there any command to delete some log files, automatically?

THAnKS

MasterC 07-09-2003 04:31 AM

There are things like Log Rotators that assist in log removal/archiving. You could use those, then periodically run a cron to clean out the old logs if you didn't wanna keep them around.

And mail servers save logs in various locations, my Postfix system on Gentoo saves them:
/var/log/maillog
And in:
/var/log/everything
But I'm running metalog, so you might wanna check with your system logger to see where it stores it's logs. Most likely it's going to be a subdirectory of /var/log though

Cool

ann_tulip18 07-09-2003 07:44 PM

Meaning... I'll just invoke the logrotate command to the console and then it will display all the log files?
Yesterday I have deleted all the files on /var/log. Today the same files appear again.

Ps. Our mail serer is not sending mail, but it can receive mail (though its delayed).

THANKS?

MasterC 07-09-2003 08:05 PM

Log files are created if they do not exist. It's normal. You can setup a cron job to remove these files on a weekly/daily/hourly basis if you'd like.

As for the sending/receiving bit..
Were you able to send before you tapped out the partition? Did you manually remove any files when trying to free up space? What files were removed when you removed X? If you've still got your mail server files on your box, nothing should have changed? You might need to restart the server though, follow the documentation for it to restart it.

:)

Cool

ann_tulip18 07-09-2003 08:21 PM

I haven't tried to partition the HD.. Yes.. we have removed a file manually (/var ... but we have copy it back, thinking it has no effect on the HD space). I think its the main reason why our server cant send mails.. I restarted postfix here is the error message

[COLOR=darkblue]
postfix/postfix-script: warning : not owned by postfix: /var/spool/postfix/incoming/E/4
postfix/postfix-script: warning : not owned by postfix: /var/spool/postfix/public
postfix/postfix-script: warning : not owned by postfix: /var/spool/postfix/saved
postfix/postfix-script: warning : not owned by group postdrop: /var/spool/postfix/public
postsuper: fatal: scan_dir_push: open directory defer: Permission Denied
postfix/postfix-script: fatal: Postfix integrity check failed!




What should we do then??

THANKS

MasterC 07-09-2003 08:24 PM

Hmm... Let's try to setup the ownership then:
chown -R postfix.postdrop /var/spool/postfix (this needs to be run by root)
Now try restarting postfix again.

Cool

**I've looked up my own permissions, try this instead:
chown root.root /var/spool/postfix
chown postfix.root /var/spool/postfix/*
chown postfix.maildrop /var/spool/postfix/maildrop /var/spool/postfix/public

While I look up permissions, try those instead.

Cool

ann_tulip18 07-09-2003 08:35 PM

I tried it... and then restart the postfix (postfix start) theres a message again:

postfix/postfix-script: warning : not owned by root: /var/spool/postfix/lib/libdb-3.3.so
postfix/postfix-script: warning : not owned by root : /var/spool/postfix/usr
postfix/postfix-script: warning : not owned by root : /var/spool/postfix/usr/lib
postsuper: Renamed to match inode nunmer: 230 messages
postsuper: warning: QUEUE FILE NAMES WERE CHANGED TO MATCH INODE NUMBERS
postfix/postfix-script: starting the Postfix mail system

What are these warning messages?

ann_tulip18 07-09-2003 09:08 PM

I tried to send mail on my own email add using one of the computers here (outlook) however I still dont receive the email.

What will i do next?

Sorry if I have so may questions.

MasterC 07-09-2003 09:08 PM

Well, we can keep doing this if you'd like, eventually we should get all the permissions back. Another option is for you to use the upgrade option in the postfix source, this will go through and install and set correct permissions on all the new packages when installing postfix.

Cool

ann_tulip18 07-09-2003 09:17 PM

So you mean the best option is to reinstall the postfix?? I will try to set the permission like what you have taught to me.. I hope it will work!!

THANKS! :)

mfread 07-09-2003 09:19 PM

Well you could spend all this time, energy and heachache trying to fix your space issue by finding the space hog and figuring out how to uninstall it. Or you just ghost to a larger drive... ghost will resize the partitions to scale to the new drive automatically and you have the chance to adjust it at that point.

Or possibly a better fix for you might be to copy out all the mail spools, then google clarkconnect, download the 1.3 ISO, this is a redhat based distro that uses utilities like apt by default, is specifically designed to run as a mailserver/gateway and doesn't install a whole lot more than is needed to perform these functions. It also uses postfix by default rather than the historically bug ridden sendmail. You can perform the simpliest of administration on the local lan by point a browser at: https://mailserverip:81.

It has the advantage of being the only cookie cutter mail/web/ftp/gateway application distro I know of that doesn't overwrite manual changes or require you edit templates. It uses the same directory structure any redhat system uses.


It will take up to an hour to install if you've never done it before and have 50 users or so. You might lose the mail that is sitting on your server right now if you don't know how to move the mail spools back in place but that might not being to compare wit the mail you lose being down.

ann_tulip18 07-09-2003 09:50 PM

I have set all the permissions. Thanks to you! About space hog, what is it?? I guess I'll go with that option, uninstall what is eating up my space.

ann_tulip18 07-09-2003 10:57 PM

I am trying to uninstall nautilus ( i will not use it) But theres un error message again:

error : removing these package s would break dependensies:
nautilus = 1.0.6 is needed by nautilus-mozilla-1.0.6-15
libnautilus.so.0 is needed by nautilus-mozilla-1.0.6-15

So i tried to uninstall nautilus-mozilla-1.0.6-15 but it displayed again an error message

error: removing these packages would break dependencies:
nautilus-mozilla is needed by nautilus-1.0.6.15

How will i remove these applications????

MasterC 07-09-2003 11:29 PM

Remove them both at the same time, or --force it.

Cool

ann_tulip18 07-10-2003 01:28 AM

I have removed all the applications that I think it is not used by the server, however it seems not to work out.

What else can I do?

ann_tulip18 07-10-2003 04:21 AM

CAn I delete the files inside the /opt/trend/virus ????

Please!!!! Can someone reply?

THANKS

MasterC 07-10-2003 11:41 AM

I don't have /opt/trend/virus
But you probably don't want to go around manually deleting files, instead try removing them from the way they were installed (rpm -e most likely).

As for "it seems to not work out" what do you mean? Do you mean you aren't gaining any space from removing these applications? Is it possible that you already deleted alot of these hogs, and when you remove the applications you are just removing the reminance of applications already long gone?

If you aren't running a major mail server, your best bet is going to be to wipe the slate clean, re-partition, this time only using a single partition, backup the essentials and this time only put the email server necessary tools on there.

Cool

ann_tulip18 07-10-2003 08:20 PM

I have backup the files on /opt/trend/virus and have done deleting files on it. But still we cant receive emails... Could the problem is on Postfix (yesterday we have deleted manually the /var)???

Knowing that the said action has no effect on the mail, I bring back what I removed a while ago (/opt/trend/virus) to its original place.

You think the config of the mail is the problem??? How will I solve it?

MasterC 07-10-2003 11:45 PM

When you removed/put back /var it changed all the permissions on /var to root only. This is not satisfactory for human use (though it is very secure ;) ). Either you can re-install/upgrade your postfix install, during this install/upgrade correct permissions will be set;
OR
you can go through manually, and redo all the permissions according to your Makefile from compiling Postfix.

Best option IMHO, re-install Postfix. However, this won't be the only thing needing re-installing most likely. You will have other permissions issues on the system, other files need other permissions too...
For this you can decide how to proceed, a re-install might be necessary :( However, you might be able to get by with just a postfix re-install/upgrade.

FYI:
In the future, when you backup/remove directories/files, ensure the permissions are preserved.

Cool


All times are GMT -5. The time now is 09:58 AM.