Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Incorrect disk usage displayed with du and file size view
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
suhcaB
n00b
n00b


Joined: 01 May 2006
Posts: 5
Location: South Africa

PostPosted: Thu Dec 14, 2006 6:54 pm    Post subject: Incorrect disk usage displayed with du and file size view Reply with quote

Well, hi there. This is the fierst problem in four years that I can't solve by just reading through the forums, so please bear with me.

I resently realised my du command weas showing me entirely wrong figures. It shows that my one drive is practically full, while I know that there is almostnothing on it. To give you an idea here is the output of a few commands:

Code:

df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda9              15G   13G  1.2G  92% /
udev                  220M  220K  220M   1% /dev
/dev/hda7              38M  5.3M   31M  15% /boot
/dev/hda10            6.6G  6.1G  256M  97% /home
/dev/hda1              21G   16G  4.8G  77% /win/c
/dev/hda5              10G  7.4G  2.7G  74% /win/d
/dev/hda6              25G   22G  3.1G  88% /win/e
none                  220M     0  220M   0% /dev/shm


Code:

cd /home
du -sh

485M


AND

Code:

mount

/dev/hda9 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
/dev/hda7 on /boot type ext2 (rw,noatime)
/dev/hda10 on /home type ext3 (rw,noatime)
/dev/hda1 on /win/c type ntfs (rw,gid=100,umask=0707)
/dev/hda5 on /win/d type vfat (rw,gid=100,umask=0707)
/dev/hda6 on /win/e type vfat (rw,gid=100,umask=0707)
none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)


According to this I'm only using 485MB of /home or /dev/hda10 out of a 6.6GB, but df -h reports having only 256MB available. How can this be? There is only one directory in home, my home folder, and even with the file size view of konquerer it shows that I'm only using around 480MB of space and only 250MB left!

This is getting rather frustrating as all of my applications seem to crash these days as I have to delete quite a few files every day, cause I get quite a lot of emails.

Anyone got any ideas?
_________________
There are 10 kinds of people. Those that understand binary, and those who don't
Back to top
View user's profile Send private message
Sten
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2006
Posts: 109
Location: Prague, Czechia, European Union

PostPosted: Thu Dec 14, 2006 7:01 pm    Post subject: Re: Incorrect disk usage displayed with du and file size vie Reply with quote

suhcaB wrote:
Well, hi there. This is the fierst problem in four years that I can't solve by just reading through the forums, so please bear with me.

I resently realised my du command weas showing me entirely wrong figures. It shows that my one drive is practically full, while I know that there is almostnothing on it. To give you an idea here is the output of a few commands:

Code:

df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda9              15G   13G  1.2G  92% /
udev                  220M  220K  220M   1% /dev
/dev/hda7              38M  5.3M   31M  15% /boot
/dev/hda10            6.6G  6.1G  256M  97% /home
/dev/hda1              21G   16G  4.8G  77% /win/c
/dev/hda5              10G  7.4G  2.7G  74% /win/d
/dev/hda6              25G   22G  3.1G  88% /win/e
none                  220M     0  220M   0% /dev/shm


Code:

cd /home
du -sh

485M


AND

Code:

mount

/dev/hda9 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
/dev/hda7 on /boot type ext2 (rw,noatime)
/dev/hda10 on /home type ext3 (rw,noatime)
/dev/hda1 on /win/c type ntfs (rw,gid=100,umask=0707)
/dev/hda5 on /win/d type vfat (rw,gid=100,umask=0707)
/dev/hda6 on /win/e type vfat (rw,gid=100,umask=0707)
none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)


According to this I'm only using 485MB of /home or /dev/hda10 out of a 6.6GB, but df -h reports having only 256MB available. How can this be? There is only one directory in home, my home folder, and even with the file size view of konquerer it shows that I'm only using around 480MB of space and only 250MB left!

This is getting rather frustrating as all of my applications seem to crash these days as I have to delete quite a few files every day, cause I get quite a lot of emails.

Anyone got any ideas?


Have you run ‘du’ as root?
Have you tried killing all applications using ‘/home’? There can be some unlinked but not closed files that does not appear in directories but takes space.

If so, try ‘fsck.ext3 -f /dev/hda10’ with unmounted /home.
_________________
You don’t understand, I break things like this!

xor rsi,rsi
lodsb
Segmentation fault
Back to top
View user's profile Send private message
suhcaB
n00b
n00b


Joined: 01 May 2006
Posts: 5
Location: South Africa

PostPosted: Thu Dec 14, 2006 8:25 pm    Post subject: Reply with quote

Thanx for the reply. I checked du as root and it gave the same results. I then ran fsck.ext3 -f /dev/hda10 with the following results:

Code:

/dev/hda10: ***** FILE SYSTEM WAS MODIFIED *****
/dev/hda10: 10980/877824 files (14.8% non-contiguous), 130463/1755093 blocks


I then ran du again, but still the same. After a reboot though everything seemed right as I now have more than 6GB left.

Thanx for the advice.
_________________
There are 10 kinds of people. Those that understand binary, and those who don't
Back to top
View user's profile Send private message
suhcaB
n00b
n00b


Joined: 01 May 2006
Posts: 5
Location: South Africa

PostPosted: Thu Dec 14, 2006 8:34 pm    Post subject: Reply with quote

BTW, can you please tell me what happened over here? I don't know that much about the ext3 filesystem as of now, but would really like to learn more.

Thanx again
_________________
There are 10 kinds of people. Those that understand binary, and those who don't
Back to top
View user's profile Send private message
Sten
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2006
Posts: 109
Location: Prague, Czechia, European Union

PostPosted: Sat Dec 16, 2006 1:59 am    Post subject: Reply with quote

suhcaB wrote:
BTW, can you please tell me what happened over here? I don't know that much about the ext3 filesystem as of now, but would really like to learn more.

Thanx again


Looks like some applications had opened files on the filesystem which was marked for deletion (was deleted from directories and therefore unaccessible for du) but not deleted (because they were opened).

Btw. did you unmounted the filesystem before fscking it, didn’t you?
_________________
You don’t understand, I break things like this!

xor rsi,rsi
lodsb
Segmentation fault
Back to top
View user's profile Send private message
widremann
Veteran
Veteran


Joined: 14 Mar 2005
Posts: 1314

PostPosted: Sat Dec 16, 2006 3:34 am    Post subject: Reply with quote

It's because the filesystem has a certain amount of overhead storage that isn't usable for normal data. df, which shows usable space, will obviously show less space available than du, which simple shows how much of the partition is actually allocated to something, be it filesystem or data.
Back to top
View user's profile Send private message
Sten
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2006
Posts: 109
Location: Prague, Czechia, European Union

PostPosted: Sat Dec 16, 2006 1:01 pm    Post subject: Reply with quote

widremann wrote:
It's because the filesystem has a certain amount of overhead storage that isn't usable for normal data. df, which shows usable space, will obviously show less space available than du, which simple shows how much of the partition is actually allocated to something, be it filesystem or data.


Well, yes, but metadata should never take 6 Gi of 6.6 Gi. This looks like other problem.
_________________
You don’t understand, I break things like this!

xor rsi,rsi
lodsb
Segmentation fault
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum