Missing disk space

My root partition seems to missing 1.6 GB of space. From “df -k” I get this output:

FILE: > df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 33032196 3113332 28240880 10% /
udev 994464 156 994308 1% /dev
/dev/sdc1 781166488 193277096 587889392 25% /home
/dev/sdb1 2147218624 1028363008 1118855616 48% /disks/D
/dev/sdd1 1952558576 506876880 1445681696 26% /disks/data2

but for /dev/sda1 (Used + Available) is less than the total 1K blocks.

(Used+Available) = 31354212
1K blocks = 33032196

Difference = 1677984 K.

I can’t find any rootkits with rkhunter and chkrootkit, and fsck reports no errors.

Does anyone have any idea what might be going on here?

Cheers,
Eric

Ext3 (and 4 too, certainly) reserve 10% of disk space for contingencies (inode issues IINM, or things like that).

This is adjustable, I did this sometime ago to reduce the reserve to 5% and get some more space in large (1TB) backup disks not written frequently. But I don’t recall right now how to do it, there are posts about this, or maybe someone will chime in.

Maybe that’s the reason for the difference you are seeing.

Some space is used by the ext4 file system

For example. Now I picked a random pic form some of my work here. But look at for eg sda6 and 7 in this image
http://dl.dropbox.com/u/10573557/Win-Install/re-partitioned.jpeg

Notice the used space. There is nothing installed but space is used. These are much smaller partitions than yours …

Isn’t 5% the default for ext3/ext4? I thought so…

tune2fs -m x /dev/sdxn

‘-m x’ sets the percentage of reserved blocks, /dev/sdxn is the respective partition.

However, I do not recommend to edit those settings for systempartitions such as / or /home.

If you check with ‘tune2fs -l /dev/XXXX’, where XXXX is the partition name and
number, you will see the reserved count. This space can only be used by root and
is set aside so that you can get logged on as root to free some space when the
partition is otherwise full. Without this buffer, you would always need to boot
a repair CD to accomplish the cleanup.

The reserved amount seems to be 5%, not 10% as mentioned earlier. You can change
it with ‘sudo tune2fs -r YYYYY /dev/XXXX’ (see man tune2fs). A value of 5% makes
sense for a small partition, but it is overly aggressive for a large one.

Thank you all for your answers. The difference is in fact the reserved space. I had forgotten about that :slight_smile:

Hmm… My bad (it’s the type-from-memory issue again:))

The reserved space for the 1TB drive I mentioned before is:

# tune2fs -l /dev/sdb1
tune2fs 1.41.1 (01-Sep-2008)
...
Block count:              244188000
Reserved block count:     4883760
Free blocks:              14290950
...

That amount to 2%. It was 5% before.

On 2011-01-15, gropiuskalle <gropiuskalle@no-mx.forums.opensuse.org> wrote:
>
> “brunomcl” Wrote:
>> This is adjustable, I did this sometime ago to reduce the reserve to 5%
>> and get some more space in large (1TB) backup disks not written
>> frequently.
>
> Isn’t 5% the default for ext3/ext4? I thought so…
>
> “brunomcl” Wrote:
>> But I don’t recall right now how to do it, there are posts about this,
>> or maybe someone will chime in.
>
>
> Code:
> --------------------
> tune2fs -m x /dev/sdxn
> --------------------
>
>
> ‘-m x’ sets the percentage of reserved blocks, /dev/sdxn is the
> respective partition.
>
> However, I do not recommend to edit those settings for systempartitions
> such as / or /home.

Strange, I recommend leaving it alone for a system partition too. But I
don’t count /home in that, which I consider a data partition.

My /home has been at 0% sinces ages. Given that the /home partitions/drives
are usually the largest, the waste of space is huge. And root’s home is not
in it, so what’s the point of keeping a spare place in there ?

But to each his own, of course.


When in doubt, use brute force.
– Ken Thompson

On 01/16/2011 02:15 PM, Rikishi42 wrote:
> On 2011-01-15, gropiuskalle <gropiuskalle@no-mx.forums.opensuse.org> wrote:
>>
>> “brunomcl” Wrote:
>>> This is adjustable, I did this sometime ago to reduce the reserve to 5%
>>> and get some more space in large (1TB) backup disks not written
>>> frequently.
>>
>> Isn’t 5% the default for ext3/ext4? I thought so…
>>
>> “brunomcl” Wrote:
>>> But I don’t recall right now how to do it, there are posts about this,
>>> or maybe someone will chime in.
>>
>>
>> Code:
>> --------------------
>> tune2fs -m x /dev/sdxn
>> --------------------
>>
>>
>> ‘-m x’ sets the percentage of reserved blocks, /dev/sdxn is the
>> respective partition.
>>
>> However, I do not recommend to edit those settings for systempartitions
>> such as / or /home.
>
>
> Strange, I recommend leaving it alone for a system partition too. But I
> don’t count /home in that, which I consider a data partition.
>
> My /home has been at 0% sinces ages. Given that the /home partitions/drives
> are usually the largest, the waste of space is huge. And root’s home is not
> in it, so what’s the point of keeping a spare place in there ?
>
> But to each his own, of course.

As root can login without touching /home, it is OK for the percentage in /home
to be 0. You should have non-zero amounts for / and any other system partitions
that you might have created.

Hm, okay… I’ll give this a thought, since the loss of space in /home indeed can be huge - but I meant it exactly like I wrote: “I do not recommend…”, meaning since it is a default setting, I rather not wanted to recommend fiddling with it. Anyway, I suppose yu guys are right and there’s not much to be afraid of when setting the reserved blocks in /home to zero.

Edit: I did it. :slight_smile:

On 2011-01-16, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>>> ‘-m x’ sets the percentage of reserved blocks, /dev/sdxn is the
>>> respective partition.
>>>
>>> However, I do not recommend to edit those settings for systempartitions
>>> such as / or /home.
>>
>>
>> Strange, I recommend leaving it alone for a system partition too. But I
>> don’t count /home in that, which I consider a data partition.
>>
>> My /home has been at 0% sinces ages. Given that the /home partitions/drives
>> are usually the largest, the waste of space is huge. And root’s home is not
>> in it, so what’s the point of keeping a spare place in there ?
>>
>> But to each his own, of course.
>
> As root can login without touching /home, it is OK for the percentage in /home
> to be 0. You should have non-zero amounts for / and any other system partitions
> that you might have created.

Of course I do, that we all agree on.


When in doubt, use brute force.
– Ken Thompson