LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 02-21-2005, 07:56 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Rep: Reputation: Disabled
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...
 
Old 02-21-2005, 08:00 AM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,464

Rep: Reputation: 46
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...
 
Old 02-21-2005, 08:03 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Original Poster
Rep: Reputation: Disabled
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?
 
Old 02-21-2005, 08:03 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 02-21-2005, 08:15 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Original Poster
Rep: Reputation: Disabled
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 08:16 AM.
 
Old 02-21-2005, 08:33 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 02-21-2005, 08:41 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Original Poster
Rep: Reputation: Disabled
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)?
 
Old 02-21-2005, 08:48 AM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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..
 
Old 02-21-2005, 08:52 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Original Poster
Rep: Reputation: Disabled
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 08:57 AM.
 
Old 02-21-2005, 09:06 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 02-21-2005, 09:15 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,686

Original Poster
Rep: Reputation: Disabled
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SCSI-3 Persist Reservation using cciss driver merry Linux - Hardware 2 05-22-2007 02:47 PM
persistent binding -> RESERVATION CONFLICTS da_kidd_er Linux - Hardware 0 06-01-2005 08:51 PM
Help ran out of space on root synapse Slackware 7 11-10-2004 01:46 PM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 01:44 PM
Run out of space at root devinWhalen Mandriva 2 06-15-2004 12:23 PM


All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration