lkml.org 
[lkml]   [2009]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: df -h shows ~10 times bigger size when umounting pendrive
Arkadiusz Miskiewicz wrote:
> /etc/mtab contains:
>
> /dev/sdb1 /media/floppy vfat rw 0 0
>
> statfs() returns:
>
> statfs("/media/floppy", {f_type=0x58465342, f_bsize=4096, f_blocks=2497555,
> f_bfree=1410716, f_bavail=1410716, f_files=10000448, f_ffree=9842679,
> f_fsid={2051, 0}, f_namelen=255, f_frsize=4096}) = 0
>

The statfs(), above, is not a stat for the file system at /media/floppy,
it's a stat for the file system which *contains* /media/floppy. If
/dev/sdb1 has been unmounted (which was in fact in occurring at the
time) the stat refers to (in your case) the root filesystem. And look
at the returned information: 2497555 4K blocks, 1410716 of them
available; that's 9.6GB file system with 5.5GB available, same as /dev/sda3.

Truly, this is what I said it was; and it's normal, and it's reasonable.

> /dev/sdb1 9,6G 4,2G 5,4G 44% /media/floppy
>
> So why statfs() lies on a being unmounted filesystem?

There is a lie, which is that /media/floppy is on /dev/sdb1. That
ceases to be true as soon as the umount starts. The reason df lies is
because it trusts the mtab, which has not yet had the entry for
/dev/sdb1 removed.


\
 
 \ /
  Last update: 2009-03-22 15:55    [W:0.050 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site