Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ShakaZOffline
Post subject: Ext4 free space not correct [Solved]  PostPosted: 10.04.2011, 22:29



Joined: 2011-02-16
Posts: 67

Status: Offline
Hello,

earlier today trying to download a tiny file to my home folder failed because the root partition was full. So I moved some GB to an external drive.
Then doing a df -h reported less free space than expected.
Part of the explanation came from the data being corrupted downloads, so 10GB moved out ended up freeing only 350MB.

After some googling, here are the results :
      Code:
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              49G   45G  2.2G  96% /

This is after putting the reserved space for root at 2%, as that seems to be an explanation for the missing free space in some case.
However removing the reserved space completely still shows there's about 1GB of free space gone missing.
      Code:
# tune2fs -m 0 /dev/sda5
tune2fs 1.41.12 (17-May-2010)
Setting reserved blocks percentage to 0% (0 blocks)
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              49G   45G  3.1G  94% /


Next step was forcing an fsck at boot :
touch /forcefsck

I also tried that from a livecd but the space is still missing.
fsck.ext4 -tv /dev/sda5

/lost+found is empty

Edit :
well doing an df -k instead of df -h, with 0% reserved space shows actually very little space missing :
      Code:
# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda5             50394964  47164340   3230624  94% /

That is 3,230,624 instead of 3,230,660 KB available. That's 36KB, I guess used to store filesystem information.

I'll just leave the post in case someone does have some space missing.

The reserved root space tweak can still be useful to know, as it's set to default at 5% on linux filesystems, which is way too much on the huge hard drives we have now and can safely be put at 0% on non system partitions.

That hard drive shouldn't be that full, I know, been waiting almost 3 weeks now for a replacement 1TB 2.5" drive from Samsung, but they keep pushing the delivery date further.
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 11.04.2011, 16:12



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Also, don't forget that some blocks/sectors will be lost when the partition boundaries are set -- even if a disk is a single partition. Example, from fdisk -lu:

      Quote:
Disk /dev/sde: 60.0 GB, 60022480896 bytes
32 heads, 32 sectors/track, 114483 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1377a180

Device Boot Start End Blocks Id System
/dev/sde1 1024 117230591 58614784 83 Linux
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio