LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Ambiguity in free disk space in /home partition (https://www.linuxquestions.org/questions/linux-general-1/ambiguity-in-free-disk-space-in-home-partition-352400/)

vharishankar 08-11-2005 11:20 PM

Ambiguity in free disk space in /home partition
 
I have a /home partition for my user files. It is a 1.9 GB partition and the free disk space in this partition currently shows only 542.9 MB.

Fine, I checked the size of my data files. I summed up all the space used by the subdirectories (including hidden folders) in my /home/hari partition. It shows 160 MB.

When I go one level down and check the total size of the /home/hari directory, it shows 1.4 GB used space.

I used konqueror's properties to check this. I also used KDiskFree and it still shows only 542.9 MB free.

How can I account for the large discrepancy when my total data stored sums up to only 160 MB? I even checked the hidden files and it just doesn't add up.

The partition in question is a reiserfs file system. I'm not storing anything else in the /home partition apart from this data totalling to 160 MB.

Any help regarding this would be much appreciated...

vharishankar 08-12-2005 01:01 AM

I found out the offending file.

It was the .xsession-errors file. Don't know how I missed that.

My question is

1. Why is this file so big?
2. Is it safe to delete this file?

Bruce Hill 08-12-2005 01:23 AM

Hi Hari,

You might want to check your partitions using "du -sh"
Code:

mingdao@james:~$ du -sh
23G    .

This gives you a summary of the disk usage of each FILE, recursively for directories. And the switches -- s is for summarize and h for human readable. There are many more options which might suit your needs more ... read "man du" to check.

I don't have an .xsession-errors file, or any other .xsession* files on this box. However, I run Fluxbox and not a desktop environment, which might be the reason. But on other boxen here running KDE, there were no .xsession* files, either. Perhaps it's only generated when there is an error.

Sorry I can't be of more help.

vharishankar 08-12-2005 01:28 AM

Apparently it's an error log. I checked some of it (not all 1.2 GB of it!) Not a problem I would imagine to delete it.

Yes, I've been getting a lot of errors with startx. Especially the first time I boot the system, startx dumps an error. Then I run startx again, I get it working fine. :confused:

dalek 08-12-2005 01:34 AM

Well, I have that file on my rig, I run Gentoo and KDE BTW, and it is not that big.

Code:

-rw-------  1 dale users  95502 Aug 12 01:31 .xsession-errors
I would not delete it but I would clear the contents. I have done that on my emerge log before. It may recreate the file but what if it don't?

Now to go see what is in my file. :scratch: :study:

Later

:D :D :D :D

vharishankar 08-12-2005 01:40 AM

Well I deleted that file and the disk space still shows only 531 MB free.

Might be a reboot might fix this...

dalek 08-12-2005 01:56 AM

REBOOT!!!!!! :eek:

That is for windoze, not Linux. You need to go wash your mouth out for saying that. ;) LOL

I doubt that will fix it. That is strange and there is something there that is taking up the space. Maybe check and see what is mounted and where it is mounted. Maybe there is a typo in your fstab file.

Is strange though. :scratch: :scratch:

Later

:D :D :D :D

Reboot, < gag gag gag > LOL

dalek 08-12-2005 01:58 AM

Oh, empty your trash too. I know when I delete things in Konqueror as root, it puts them in the root trash can instead of the user that KDE is logged in as. Maybe your trash can is the hog. May want to check both.

Later

:D :D :D :D

vharishankar 08-12-2005 02:02 AM

No trashing didn't do it.

I did a thorough check of all files in the /home partition and the whole directory /home comes to about only 170 MB. The partition size is 1.9 GB and it still keeps showing only 535 MB free now.

I know it can't be swap (like sometimes happens in Windows). I really don't understand why this space is reported as in use...

dalek 08-12-2005 02:17 AM

Did you check to see if anything else may be mounted in it by mistake? Just type in mount and it should list the partitions and where they are mounted. You can mount partitions twice or have them mounted in two places. I have done that before.

I have two users in my /home and it uses only about 720Mbs of space and I use reiserfs as well. I'm running out of ideas. We need a real guru.

:D :D :D :D

vharishankar 08-12-2005 02:30 AM

Mount gives me this
Quote:

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda6 on /home type reiserfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
I don't really see any problems here...

vharishankar 08-12-2005 02:43 AM

Well, a reboot fixed it in any case now :p

Don't know why it required a reboot, but now it shows 1.7 GB free as it should...

Thanks for all the help.

dalek 08-12-2005 02:47 AM

It likely deleted a file that you didn't see. I see mine "clear temp files" during the boot process too.

It was there somewhere. Just that we couldn't find it is all.

Later

:D :D :D :D

MensaWater 08-12-2005 06:59 AM

A couple of things:

1) df and du do their calculations slightly differently so won't give you exactly the same results but should be close enough most of the time so that likely wasn't your issue.

2) The most probable issue was that a file got deleted while it was still open by a process. When this occurs the file NAME gets deleted but not the file INODE. A reboot will always cure this because it kills all processes (including the one that held the file open).

However you don't have to reboot as pointed out above. Instead you can do "lsof /home" to see all open files and associated processes using /home. Typically in this situation you'd see a very large size file open but no name. If you kill the process associated with that it will free up the INODE and the deletion will complete.

lsof will show you things tha fuser often won't as far as what is busying out a filesystem. It has many other uses including examining open network connections and associating those with processes so is better than netstat in that regard.

minty33 02-22-2013 01:09 PM

Maye the reboot fixed it because it was a logfile and deleting it probably created a tmp backup that was being used till you shut down or its loaded in ram at the beginning of the session so until it left ram it was being used. Just guesses don't know for sure. But I do also think journaled fs's like reiserfs don't show all you unallocated space accurately because some is reserved for backups of recently deleted files. I don't know how the journal gets reported by df or du but keep that in mind. That's why shred is unreliable with journaled fs's. The percentage of yours is odd though but maybe because the partition is so small and the journal is based on mb's not percentage of drive space available. Again just a guess.


All times are GMT -5. The time now is 07:17 PM.