Problems clearing space on / of linux partitions

I need to clear some space on my linux box but cannot work out why when I remove some files it is not reflected on the available space, please see df summary file attached.

I need to create some space in "/"

thank you in advance

DF-Partition-Size.txt
LVL 4
mfg1Asked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Files in /tmp are always good candidates ...
0
 
woolmilkporcCommented:
Hi,

from which directory did you remove the files?

Please keep in mind that removing files from /var or /usr will have no effect on /, since these filesystems reside on different volumes.

The most common reason for space not getting freed is that the removed file's file handle is still in use by some process.

Try "lsof |grep deleted_file"

or even "lsof /"
You will most probably get a lot of output, but maybe there's a clue.

wmp
0
 
AriMcCommented:
By default 5% of disk space is reserved for root's emergency use. If you add the used+available blocks in your /dev/sda1 for example, 21166 + 166931 = 188097, you'll see that they sum up to just 95% of the total size 198337.

In other words, your root partition is so full that it is already using the emergency reserve. You'll need to free more space until only about 2872572 blocks are used. After that you will see the available-value start growing.


0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
mfg1Author Commented:
ok I know this is a silly question but what sort of stuff should I be able to remove safely? temp files etc.
0
 
mfg1Author Commented:
Yes i checked there and it turns out only 1 file was present which is tiny, any more :-)
0
 
AriMcCommented:
/var/log often contains saved and compressed (gz file extension) old log-files like syslog.2.gz. These should be safe to delete or move to another partition.

0
 
AriMcCommented:
Oops, I just noticed you have /var on a different partition. Ignore that advice.

0
 
mfg1Author Commented:
This was the files i was deleting before, however will this make any difference as the /var is on another partition?

                                  15683016  10437996         4448348  71%       /var
0
 
mfg1Author Commented:
Ok sorry i thought i had it wrong there.
0
 
woolmilkporcCommented:
/var is not on the same volume as / !
0
 
mfg1Author Commented:
Yes that is correct, so not sure what else I can remove.
0
 
woolmilkporcCommented:
Try

du -kx / | sort -n

to see your biggest files/directories (at the bottom of the list)
0
 
mfg1Author Commented:
ok not sure about this but it says that tmp does have some stuff in it, see below.

2741128 /tmp

but when I check by going to,

#cd /tmp
#ls
there is only 1 file there
0
 
woolmilkporcCommented:
lsof /tmp

?
0
 
mfg1Author Commented:
here is the information I got back thx

# lsof /tmp
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    5418 root  cwd    DIR  253,0     4096   18 /tmp
lsof    5677 root  cwd    DIR  253,0     4096   18 /tmp
lsof    5678 root  cwd    DIR  253,0     4096   18 /tmp
0
 
AriMcCommented:
Also try

  ls -al /tmp

to see any hidden files or directories

0
 
mfg1Author Commented:
this is what I get if I tab twice after cd in the tmp directory

tmp]# cd
.bayes/    env2       .ICE-unix/

0
 
mfg1Author Commented:
Here is the responce
tmp]# ls -al /tmp
total 16
drwxrwxrwt.  4 root   root   4096 2011-02-16 10:36 .
drwxr-xr-x. 22 root   root   4096 2011-02-16 09:32 ..
drwxr-xr-x   2 root   root   4096 2011-02-08 18:33 .bayes
-rw-r--r--   1 apache apache    0 2011-02-15 14:33 env2
drwxrwxrwt   2 root   root   4096 2010-11-06 13:29 .ICE-unix
0
 
AriMcCommented:
What do you see after this:

cd /tmp
du .

0
 
woolmilkporcCommented:
Ok,

.bayes and .ICE-unix are those hidden directories AriMc was talking about above!

What's in there?
0
 
mfg1Author Commented:
I assume this is what you mean if not let me know and I will try again.

# ls -al /tmp/.bayes/
total 2741124
drwxr-xr-x  2 root root       4096 2011-02-08 18:33 .
drwxrwxrwt. 4 root root       4096 2011-02-16 10:36 ..
-rw-r--r--  1 root root 2806890496 2009-11-26 14:27 .ps_1753.mem


# ls -al /tmp/.ICE-unix/
total 8
drwxrwxrwt  2 root root 4096 2010-11-06 13:29 .
drwxrwxrwt. 4 root root 4096 2011-02-16 10:36 ..
0
 
mfg1Author Commented:
thx for all these quick replies most appreciated.
0
 
AriMcConnect With a Mentor Commented:
Ok, this one is using your disk:

/tmp/.bayes/.ps_1753.mem

It's also very old and probably safe to remove. Try moving it to another partition and keeping it there for a while for safekeeping.


0
 
mfg1Author Commented:
Ok should I move it to home for example?
0
 
woolmilkporcCommented:
Could it be that yout machine is running for more than  14 months now?

If this could be the case check with

lsof /tmp/.bayes/.ps_1753.mem

whether the file is still in use (No output means it's not in use).

If it's not in use remove it, it's from an old Xsession!
0
 
mfg1Author Commented:
ok I moved the file but when I check df it is still showing 0 available :-(
0
 
woolmilkporcCommented:
That's because /home is on the same device as / !

0
 
mfg1Author Commented:
sorry what an idiot bear with me
0
 
t-maxCommented:
To avoid this in the future, you should think about having /tmp mounted at a different partition than /.
/tmp tends to get full from time to time, so having it mounted somewhere else allows the system to keep working (almost) normally.
0
 
mfg1Author Commented:
Can I just say thank you to both of you guys for saving my life, really helped system now all working ok.
0
 
mfg1Author Commented:
t-max I would if I knew how, maybe that is something I should ask another day.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.