View previous topic :: View next topic |
Author |
Message |
kalle2 n00b
Joined: 18 Jan 2005 Posts: 33
|
Posted: Wed Mar 26, 2008 2:47 am Post subject: Due to df I lost 4GB of my harddrive [solved] |
|
|
The values df reports for one of my partitions do not fit.
Code: | fileserver:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
[bla]
/dev/hdc1 79150628 69354960 5775004 93% /home
/dev/hdb1 96124904 89232276 6892628 93% /home/samba/public/foo |
Both are ext3 filesystems.
hdb1 is allright, 6892628+89232276=96124904
But if I add the values for "Used" and "Available" on hdc1, I get: 69354960+5775004=75129964 - 4 Gig missing.
First I did fschk - no difference.
I searched the gentoo forum for df and found nothing.
I asked Google for my problem and only found
- the advice to run df --sync - no difference
- the statement, ext3 would reserve 5% of it's space for root. But hdc1 counts correct and hdb1 not, so that can't be the problem
Edit: This was indeed the problem. I don't know why but apparently on hdc1 there was reserved space and on hdb1 there wasn't. You can use "tune2fs -m 0 /dev/hdc1" to set the reserved space to 0%
Fdisk says:
Code: | fileserver:~# fdisk -l /dev/hdb
Disk /dev/hdb: 123.5 GB, 123522416640 bytes
255 heads, 63 sectors/track, 15017 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 12158 97659103+ 83 Linux
/dev/hdb2 12159 15017 22964917+ 83 Linux
|
Any help?
I can't just reformat the drive as I don't have that much free space in the whole network.
(I hope this is the right forum.. At least "Hardware" seems to be right)
Last edited by kalle2 on Thu Mar 27, 2008 11:15 pm; edited 2 times in total |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9625 Location: beyond the rim
|
Posted: Wed Mar 26, 2008 12:50 pm Post subject: |
|
|
What does
Code: | tune2fs -l /dev/hdc1 | grep Reserved |
say? |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Wed Mar 26, 2008 1:04 pm Post subject: |
|
|
++
when you formatted your filesystem, roughly 5% (on average) was reserved for root's usage... it's not missing, its just not shown so people don't freak out when the system tells you "out of space" even though df/du show otherwise.
cheers _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
kalle2 n00b
Joined: 18 Jan 2005 Posts: 33
|
Posted: Thu Mar 27, 2008 11:10 pm Post subject: |
|
|
Genone wrote: | What does
Code: | tune2fs -l /dev/hdc1 | grep Reserved |
say? |
It says:
Code: | Reserved block count: 1005166
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root) |
If I understand correctly, the filesystem has reserved 1005166 blocks.
Due to df there are 4020664 blocks missing, that's exactly four times 1005166.
Whatever.
I took a look at the manpage of tune2fs and found:
Code: | [...] -m reserved-blocks-percentage
Set the percentage of the filesystem which may only be allocated
by privileged processes. Reserving some number of filesystem
blocks for use by privileged processes is done to avoid filesys-
tem fragmentation, and to allow system daemons, such as sys-
logd(8), to continue to function correctly after non-privileged
processes are prevented from writing to the filesystem. Nor-
mally, the default percentage of reserved blocks is 5%.[...] |
So I did
Code: | tune2fs -m 0 /dev/hdc1 |
and my problem was solved:
Code: | fileserver:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
[bla]
/dev/hdc1 79150628 70026180 9124448 89% /home
/dev/hdb1 96124904 72427464 23697440 76% /home/samba/public/foo
|
Thanks for the help! |
|
Back to top |
|
|
Monkeh Veteran
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Thu Mar 27, 2008 11:42 pm Post subject: |
|
|
The default filesystem blocksize is 4096. |
|
Back to top |
|
|
MostAwesomeDude Guru
Joined: 12 Aug 2007 Posts: 373
|
Posted: Fri Mar 28, 2008 2:44 pm Post subject: |
|
|
I highly recommend you reserve some space so you can recover from anything that might fill up your disk. _________________ Don't believe the "n00b" under my name. |
|
Back to top |
|
|
kalle2 n00b
Joined: 18 Jan 2005 Posts: 33
|
Posted: Sat Mar 29, 2008 2:28 pm Post subject: |
|
|
MostAwesomeDude wrote: | I highly recommend you reserve some space so you can recover from anything that might fill up your disk. |
Take a look at the mountpoints. The partitions in question are used only for samba shares. If they are full, they system keeps running. |
|
Back to top |
|
|
|