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. |
|
 |
03-02-2010, 10:34 AM
|
#1
|
|
LQ Newbie
Registered: May 2007
Posts: 15
Rep:
|
df -h returns wrong values
Hi guys,
I'm having a kind of weird issue, and it's not a big problem, but it's kind of annoying. If I run df -h on my server, I get the following values:
Code:
henk@tiffany:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 9.5G 4.9G 4.2G 55% /
/dev/sda1 917G 898G 0 100% /media/disk1
/dev/sdb1 917G 723G 148G 84% /media/disk2
tmpfs 122M 0 122M 0% /dev/shm
/dev/hda1 7.9G 6.5G 1.4G 83% /media/windows
As you can see, except from tmpfs and /dev/hda1, the other filesystems have a wrong size. I'm not very good in calculations, 917 minus 898 isn't 0. I tried to run some fsck scans on those partitions, but that doesn't solve anything. I can still write to /dev/sda1, but if I want to copy files through samba to this disk, it refuses it, because the disk is full. I would love to have these 19 Gigabyte available, and I'm also wondering why this is.
As for the filesystem types, /dev/sda1 and /dev/sdb1 are ext3 and /dev/root is ext4.
Can anyone explain me why this is, and, if possible, how I can solve this?
|
|
|
|
03-02-2010, 11:11 AM
|
#2
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
It has to do with reserved blocks. There is a certain amount reserved so that root and system processes can continue to write to a disk but it will be seen as "full" by non-root processes.
From the mkfs.ext3 man page:
Quote:
-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the super-user. This avoids fragmentation, and allows root-owned daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. The default percentage is 5%.
|
You're using 97% so presumably the writing you've been doing outside of Samba is as root.
|
|
|
1 members found this post helpful.
|
03-02-2010, 01:14 PM
|
#3
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
.. and the amount of disk space that is reserved for the root user can be altered with tune2fs
See man tune2fs
If you are referring to an external "media" disk, you can probably set the reserved blocks to zero, but never, ever do this for your root filesystem, or one day you may be unable to login, even as root, to fix the mess.
[ You could recover from the above by using a live CD though, but these did not exist when the ext2 / ext3 filesystems were first engineered, but do you want to run the risk of trashing your system because root has run out of filespace? ].
Last edited by tredegar; 03-02-2010 at 01:16 PM.
|
|
|
1 members found this post helpful.
|
03-02-2010, 02:53 PM
|
#4
|
|
LQ Newbie
Registered: May 2007
Posts: 15
Original Poster
Rep:
|
Great, thanks for the explanation! I'm going to take a look at tune2fs 
I'll let the /dev/root partition stay as it is, but these /media partitions (which are seperate hard drives) don't need reserved space to log in on those. I assume it's still possible to mount a full disk, or am I wrong?
edit: For future reference:
tune2fs -r 0 /dev/sda1
tune2fs -r 0 /dev/sdb1
and:
Code:
root@tiffany:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 9.5G 4.9G 4.2G 55% /
tmpfs 122M 0 122M 0% /dev/shm
/dev/hda1 7.9G 6.5G 1.4G 83% /media/windows
/dev/sdb1 917G 723G 195G 79% /media/disk2
/dev/sda1 917G 899G 19G 98% /media/disk1
Thanks a lot!
Last edited by Hmail; 03-02-2010 at 03:06 PM.
|
|
|
|
03-02-2010, 03:13 PM
|
#5
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
Quote:
|
I assume it's still possible to mount a full disk, or am I wrong?
|
This is linux. So you are in control. You can mount whatever you like, wherever you like, as you choose.
Some choices might be inadvisable though. For example, running tune2fs not to allow root to have some reserved disk space on your root partition might be a mistake you will regret bitterly in the future. So don't do that, is my advice.
But for your "media" disks, it'll be fine. If you run out of space on one of them, you'll be fine, because although you cannot save that big file, your system will still boot, and you can clean up, delete unnecessary stuff to free up space and fix it.
Best to read up on this so you fully understand what you are doing, and why.
Linux puts you in control, so you had better know why you are changing the defaults (which are generally safe) and the repercussions of making any changes.
Then you'll be both happy and safe.
|
|
|
2 members found this post helpful.
|
03-02-2010, 04:05 PM
|
#6
|
|
LQ Newbie
Registered: May 2007
Posts: 15
Original Poster
Rep:
|
Okay, cool, thanks a lot, I just asked it for verification. I know it's Linux, I pretty much know my way around it, but because I'm in control, I can still mess up. A lot  That's why I wanted to be sure.
I left the /dev/root as it was, because of these warnings. However, I'm almost sure that, sooner or later, I'll mess up big time. I might know what I'm doing, but I still want things to be done quickly instead of safe. Luckily it's my own server, and I would be the only one who will cry my eyes out. But unfortunately, that's just the best way to learn it. For now, I've avoided that. Thanks a lot for the warnings!
|
|
|
|
03-02-2010, 04:36 PM
|
#7
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
Quote:
|
I pretty much know my way around it, but because I'm in control, I can still mess up. A lot.
|
So that's why you take full backups, of course.
Quote:
|
I might know what I'm doing, but I still want things to be done quickly instead of safe.
|
"Quick" or "safe" ? Well, "You makes your choice and takes your pick". You can have one, or the other, but not necessarily both.
|
|
|
|
| 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 08:14 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
|
|