Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-21-2002, 11:33 AM
|
#1
|
LQ Newbie
Registered: Sep 2002
Posts: 29
Rep:
|
df not truly reporting disk free space, why?
I am still trying to figure out a problem that I ran into this past week with gdm, nothing has shown up in the logs...anyway, I'm wondering about disk free space because I get a warning during boot about it.
Just the other day I deleted a directory with 160 MB of files in it. Since then, I expected there to be a decent amount free, but this is only partially reflected in the df run:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 3826552 3620832 11336 100% /
Now, you can see that at least 160 was freed since the other day, because 3826552 - 3620832 = 205720 (which should be around 205 MB). For a ~4 GB partition, this is about 5 percent. However, df is reporting only 11 MB free, and that the partition has 100% in use. Rpmdrake 9.0 (mandrake 9.0 tool) reports 200 free though.
Why is df falsely reporting the amount in use (100%), and the amount available (11336)?
|
|
|
12-22-2002, 02:31 AM
|
#2
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
By default, the ext2 filesystem reserves 10% of the disk space on a
partition for root, and df knows to ignore that 10%. I don't know what
Rpmdrake uses, but it looks like that tool doesn't respect the reserve.
You want to reserve SOME space for root so you can save yourself
if you have a problem, but IMHO 10% of a 40G drive is excessive.
Check out the man page for tune2fs.
|
|
|
12-22-2002, 04:53 AM
|
#3
|
LQ Newbie
Registered: Sep 2002
Posts: 29
Original Poster
Rep:
|
Why does it reserve anything?!
I have 256 MB of RAM and nearly as large of swap partition...bad Linux!
But, seriously, is there anyway I can prevent this? Surely it does not need 256 MB + ~256 MB + 10% of 4 GB.
Feeling like I'm dealing with Windows and its swap file in the same partition...
|
|
|
12-22-2002, 08:31 PM
|
#4
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Moses told you how to fix it  You should read up on the man page for tune2fs, here's the chunk you'll wanna look for probably:
Quote:
-m reserved-blocks-percentage
Set the percentage of reserved filesystem blocks
|
Cool
|
|
|
12-22-2002, 08:33 PM
|
#5
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
As for your swap, if you don't want to use that much swap space, and believe it's just "worthless" then you can add that back into your "pool" of HD space. You'll need to resize your partition with something like Parted, but if you feel it's worth it, go for it.
Cool
|
|
|
12-22-2002, 09:04 PM
|
#6
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
Actually, the reason it reserves it is because if some user
happened to have write permission on your root partition (say
they could write to /tmp), and they filled your partition with junk
(say music or pr0n), then root would still have a way to log in. If
the root partition didn't have any space reserved for root, then
root couldn't log in and fix the problem. This provides root with
the ability to write important files when your users have "filled" the
disk. Not a bad thing. You really should NOT reduce the
reserved space to nothing, as you can get into trouble, and since
you're already down to 160 M from 4G, I'd say you may need it.
|
|
|
12-22-2002, 09:13 PM
|
#7
|
LQ Newbie
Registered: Sep 2002
Posts: 29
Original Poster
Rep:
|
Actually, I'm using ext3. Is tune2fs safe to use on ext3 (it mentions ext3 in various spots in the man page)? Also, based on math, it doesn't seem like 10% is in reserve, maybe 5%. Is there a way to verify that? I do not see any options to show the current settings in the man page.
Thanks for all the info.
|
|
|
12-22-2002, 09:17 PM
|
#8
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Ext3 is ext2 with -j or journaling. You can (usually) use ext2 tools on ext3. So tune2fs is just fine for you.
As for listing:
tune2fs -l <device>
Here's what my /dev/hda5 reported:
Code:
root@masterc:~# tune2fs -l /dev/hda5
tune2fs 1.27 (8-Mar-2002)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 5bcb6dca-0f7c-11d7-925c-f24f10abf103
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal filetype needs_recovery sparse_super
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 836992
Block count: 1672760
Reserved block count: 83638
Free blocks: 1017244
Free inodes: 676540
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 16096
Inode blocks per group: 503
Last mount time: Sun Dec 22 09:23:58 2002
Last write time: Sun Dec 22 09:23:58 2002
Mount count: 16
Maximum mount count: -1
Last checked: Sat Dec 14 07:54:42 2002
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal UUID: <none>
Journal inode: 8
Journal device: 0x0000
First orphan inode: 0
root@masterc:~#
You can see this line:
Reserved block count: 83638
That shows the reserve.
Cool
|
|
|
12-22-2002, 11:20 PM
|
#9
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
I may have been in error about the 10% reserve as default, it was
some time ago, but could have been changed by the developers
due to disk space becoming so plentiful. 1-3% (40-120 MB) should
be just fine for recovery situations on your partition, and you could
probably even get away with less, though I caution against it.
|
|
|
All times are GMT -5. The time now is 10:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|