Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-21-2005, 06:56 AM
|
#1
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Rep: 
|
df: hd-space reservation for root, really?
Okay, so I found out (on LQ  ) that the command "df" shows biased results. Instead of giving exact values of a file system's total, used and free spaces, it refuses to show 5 % of the existing space on ext2/3 because these 5 % are reserved for system-salvation work by root.
Fine. Now, why does it do that also, when I'm logged in as root? In case root uses the command shouldn't (s)he get shown the amount of space available to root or am I missing something here? Reasom I'm asking is, I want to zero out all non-used space in some partitions...
|
|
|
|
02-21-2005, 07:00 AM
|
#2
|
|
Senior Member
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,463
Rep:
|
If the space is reserved, then it isn't being 'used' as such is it?
This is just a feature of this file system type. I'm not an expert on ext2/3 but i believe you will have to leave it as it is...
|
|
|
|
02-21-2005, 07:03 AM
|
#3
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Original Poster
Rep: 
|
No, it (the percentage) can be changed with tune2fs -O. Nevertheless, this space can contain (old) data, which I want to wipe. So, when and how can I access this reserved space?
|
|
|
|
02-21-2005, 07:03 AM
|
#4
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
|
Hi,
df does show the correct amount of (free) space. Normal users do sometimes get a 'no space left on device' message although df shows 5% still being unused (this is the 5% reserved for root).
The 5% is a standard, but can be changed to whatever you want (man tune2fs).
Hope this clears things up a bit.
|
|
|
|
02-21-2005, 07:15 AM
|
#5
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Original Poster
Rep: 
|
Point is, logged in as root I get shown the same amount as any "normal" user. So again, when and how can I access the space reserved by the file system for system maintenance?
Last edited by JZL240I-U; 02-21-2005 at 07:16 AM.
|
|
|
|
02-21-2005, 07:33 AM
|
#6
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
|
Hi,
If you are root you have access to this reserved part:
$ dd if=/dev/zero of=/data/tets01
dd: writing to `/data/tets01': No space left on device
$ df | grep hda12
/dev/hda12 4214036 4214036 0 100% /data
Size of tets01: 3509186560
The same thing as normal user you'll end up with:
$ df | grep hda12
/dev/hda12 4214036 3999972 0 100% /data
Size of tets01: 3290198016 (which is a smaller file).
It also shows that root always has access to the reserved space.
Hope this answers your question.
|
|
|
|
02-21-2005, 07:41 AM
|
#7
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Original Poster
Rep: 
|
Aha, thank you. I didn't dare that for fear of locking my system. In conclusion that means, that "df" is insensitive to who is just issueing the command, root or normal users...
Which would be system directories on partitions, which should not entirely filled up because of locking the system (like e.g. /var with the log files)?
|
|
|
|
02-21-2005, 07:48 AM
|
#8
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Its a very good idea to keep this reserved space for root. Say / fills up for some reason, regular users won't be able to login without any available space. If this were the same for root, well, its a hassle to clear up. With the reserved space though, root can login and easily fix the problem.. 
|
|
|
|
02-21-2005, 07:52 AM
|
#9
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Original Poster
Rep: 
|
Quote:
Originally posted by trickykid
Its a very good idea to keep this reserved space for root. ...
|
Yes, I'm aware of that. I'm not entirely sure of the entire list of files and / or directories which need space for system activities as mentioned in my previous post and I'm not as bold as druuna.
Like I said, I wanted to wipe unused space -- reason: When I use partimage, I dont want a huge amount of compressed garbage in the image. That okay  ?
Last edited by JZL240I-U; 02-21-2005 at 07:57 AM.
|
|
|
|
02-21-2005, 08:06 AM
|
#10
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
|
Hi,
LOL I'm actually a carefull person (all sysadmins should be....). I took /data 'cause I know that this fs is not being written to atm.
I can only repeat what trickykid mentioned. You could limit the amount of space reserved (5% of a 200 Gb disk is a lot more spare space then 5% on a 20 Gb disk). But personally I would always have some in reserve for root, no matter what.
|
|
|
|
02-21-2005, 08:15 AM
|
#11
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Original Poster
Rep: 
|
Okay, okay, okay. Is there a chance to move the allocated free space within a partition, i.e. at first wiping one half of the free space - re-allocating the root reserve into the freshly wiped section - wiping the second half of the space?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:35 PM.
|
|
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
|
|