LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-14-2009, 05:16 PM   #1
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Rep: Reputation: 0
Wrong disk free space (VERY wrong)


Hi. I have a problem with the free space of my disk and I canīt find the huge files that are occupying such space.

Code:
[root@user /]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2              9959524   3214232   6231212  35% /
/dev/sda6            190522876 122539892  58148796  68% /home
/dev/sda3             34849872  24913952   8137044  76% /var
/dev/sda1               108868     15666     87581  16% /boot
tmpfs                  1031648         0   1031648   0% /dev/shm
as you can see, there are 122Gbytes used for /home (/dev/sda6)

but...
Code:
[root@usr /]# du -ks /home/* | sort -nr | head
664224  /home/httpd
4       /home/lost+found
4       /home/ftp
there is less than 1Gb occupied for /home, so must be some corrupted files or something that I canīt see.

This is what I get when I list the entyre disk content (there are some miss files too):
Code:
[root@macrobar /]# du -ks /* | sort -nr | head
du: cannot access `/proc/20063/task/20063/fd/4': No such file or directory
du: cannot access `/proc/20063/task/20063/fdinfo/4': No such file or directory
du: cannot access `/proc/20063/fd/4': No such file or directory
du: cannot access `/proc/20063/fdinfo/4': No such file or directory
du: cannot access `/var/named/run-root/proc/20063/task/20063/fd/4': No such file or directory
du: cannot access `/var/named/run-root/proc/20063/task/20063/fdinfo/4': No such file or directory
du: cannot access `/var/named/run-root/proc/20063/fd/4': No such file or directory
du: cannot access `/var/named/run-root/proc/20063/fdinfo/4': No such file or directory
24784664        /var
2528900 /usr
664240  /home
375652  /root
122944  /lib
45252   /etc
28300   /opt
19092   /sbin
11569   /boot
6368    /bin
According to this I only use ~30 Gb, so I donīt know how to recover the free space!

any help?

Thanks
JD

Last edited by macrojd; 05-14-2009 at 09:54 PM.
 
Old 05-14-2009, 05:26 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 166Reputation: 166
Show us the output from this:
Code:
df -m
du -sm /home/* | sort -nr
du -sm /home
Make sure to put them in [ code ] tags so we can read them too

Last edited by rweaver; 05-14-2009 at 05:31 PM.
 
Old 05-14-2009, 06:31 PM   #3
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
You'll probably need to run fsck on /dev/sda6. See if that works, if not, show us stuff like the type of fs (ext3, xfs ... ) and the fs settings (from tune2fs).

- Arch
 
Old 05-14-2009, 07:00 PM   #4
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rweaver View Post
Make sure to put them in [ code ] tags so we can read them too
Sorry! :-)

Well, here goes the outputs:

Code:
[root@user /]# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sda2                 9727      3139      6086  35% /
/dev/sda6               186058    119672     56783  68% /home
/dev/sda3                34034     24333      7944  76% /var
/dev/sda1                  107        16        86  16% /boot
tmpfs                     1008         0      1008   0% /dev/shm
Code:
[root@user /]# du -sm /home/* | sort -nr
649     /home/httpd
1       /home/lost+found
1       /home/ftp
Code:
[root@user /]# du -sm /home
649     /home
as you can see, the df command lie about the used space on sda6 (120Gb) and that is not what is really occupied on this partition (less than 1Gb).
 
Old 05-14-2009, 07:03 PM   #5
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
What does "ls -la /home" give?

Forrest
 
Old 05-14-2009, 07:03 PM   #6
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by archangel_617b View Post
You'll probably need to run fsck on /dev/sda6. See if that works, if not, show us stuff like the type of fs (ext3, xfs ... ) and the fs settings (from tune2fs).
- Arch
Hi Arch. I tried but I was scared when see this:

Code:
[root@macrobar /]# fsck /dev/sda6
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda6 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? no

check aborted.
it is normal that warning? Iīm taking some risk doing this?

Thanks again
JD
 
Old 05-14-2009, 07:05 PM   #7
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by forrestt View Post
What does "ls -la /home" give?
Forrest
Hi Forrest. I get this:

Code:
[root@user /]# ls -la /home
total 28
drwxr-xr-x  5 root root 4096 2007-11-19 16:36 .
drwxr-xr-x 23 root root 4096 2009-05-14 17:58 ..
drwxr-xr-x  2 root root 4096 2007-10-15 07:52 ftp
drwxr-xr-x  3 root root 4096 2007-11-19 16:37 httpd
drwx------  2 root root 4096 2007-10-29 17:03 lost+found
 
Old 05-14-2009, 07:13 PM   #8
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
OK, just wanted to make sure you didn't simply have a hidden file/directory in /home that you weren't seeing with the /home/* expansion.

As far as the fsck goes, yes, the warning is normal. You should unmount /home before the fsck. This means that any apps/users that are using that filesystem need to be stopped. This probably isn't going to be possible. You will probably need to reboot into single user mode to do it.

Forrest
 
Old 05-14-2009, 07:37 PM   #9
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by forrestt View Post
As far as the fsck goes, yes, the warning is normal. You should unmount /home before the fsck. This means that any apps/users that are using that filesystem need to be stopped. This probably isn't going to be possible. You will probably need to reboot into single user mode to do it.
Forrest
Thanks! but I don't know how to do that. I donīt have too many visits on my websites so there is no problem to stop the process on the server.

So, here are the questions :-)
- Stoping Apache and Mysql will be enough (and the other services I see runing from the Plesk control panel)?
- To unmount the /home directory I have to exec the command umount /home OR umount /dev/sda6 (don't laugh Iīm really new on this)?
- Instead of running a single-user mode, can I perform a shutdown -F ?
- If I have to reboot into a single-user mode what I have to do?

Thanks
JD
 
Old 05-14-2009, 07:42 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did you say anywhere what distro you use? If it's an option, I'd boot the install disk and enter either the live mode or rescue mode from there, then run rdisk this way. Probably simplest, quickest and safest.
 
Old 05-14-2009, 09:52 PM   #11
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
Did you say anywhere what distro you use? If it's an option, I'd boot the install disk and enter either the live mode or rescue mode from there, then run rdisk this way. Probably simplest, quickest and safest.
It's a remote server. I'm working with PuTTY
I think this is the distribution: psa v8.2.1_build82071015.17 os_FedoraCore 7 OS: Linux 2.6.23.12-52.fc7

so, I can't do any process manually on the server, everything must be done remotely
 
Old 05-15-2009, 09:44 AM   #12
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
If it must be done remotely, you can't boot to single user mode. You will have to log in as root, make sure nobody else is logged in, and then try to run the command, "umount /home". It will likely give you an error saying the device is busy. Then you will need to turn off process that would be using /home (like your webserver?) and try the umount command again until you are successful. Once you are able to umount the disk successfully, then you can run your fsck. After that, you can either remount /home and restart the services that you turned off OR reboot the system normally.

HTH

Forrest
 
Old 05-17-2009, 03:14 AM   #13
macrojd
LQ Newbie
 
Registered: May 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by forrestt View Post
If it must be done remotely, you can't boot to single user mode. You will have to log in as root, make sure nobody else is logged in, and then try to run the command, "umount /home". It will likely give you an error saying the device is busy. Then you will need to turn off process that would be using /home (like your webserver?) and try the umount command again until you are successful. Once you are able to umount the disk successfully, then you can run your fsck. After that, you can either remount /home and restart the services that you turned off OR reboot the system normally.

HTH

Forrest
Done! Thanks Forrest, and thanks to everyone! I followed your instructions and I have recovered my free space! haha!

Thanks again for your help and support, I hope some day I can pay back!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with reiserfs? wrong free space mesh2005 Linux - General 1 05-03-2007 08:21 AM
After lvextend wrong free space epiphiny Fedora 4 11-19-2006 04:09 PM
Wrong Size of free disk space ALInux Linux - General 1 04-03-2006 05:22 AM
'df -h' showing wrong free space on disk? Cdzin Slackware 4 03-16-2006 02:35 PM
Wrong calculation of free disk space by kdiskfree AGazzaz Mandriva 2 02-09-2006 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration