LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2011, 09:01 PM   #1
jcd29
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Disk capacity discrepancy in ext4


I've been seeing this with every single ext4 or ext3 disk/partition I work with, but I decided to make a post about it now since I got a bigger hard drive.

I formatted a 1TB external HDD as ext4 last night.

This is what I got:

http://img146.imageshack.us/img146/2259/71163295.png

http://img69.imageshack.us/img69/7180/70755142.png

The first imaage is from GParted, and the second one from Nautilus, when you right click the disk and click on Properties. Notice how GParted says the disk is 931 GiB while the Properties window says it's 917 GB. This happens to every single ext4 or ext3 drive I've worked with, and every other Linux computer with ext4 or ext3 I've seen. I know about the 5% reserved space in ext4, but it's not that. The 5% would be that 45.8 GB you see as used (the disk in actually empty) in the Properties image.

Now, I know about how HDD manufacturers will tell you it's 1000TB when in reality it's not, etc. The thing is, according to this converter: http://wintelguy.com/gb2gib.html

1000 GB would be 931 GiB. So far so good! The GParted image shows the disk as 931 GiB. The thing is, as you can see, it also shows 14.81 GiB used right out of the gate, which leaves that 917 GiB that the Properties image takes as the "total capacity".

So what's going on here? Is it just that ext4 takes that much off the actual disk capacity? Because I compared with a friends 1TB external, and it showed its total capacity as 931 in both GParted AND the disk properties, but of course his disk was NTFS.

It'd be weird if ext4 takes off 14 GiB while NTFS takes nothing, so I'm wondering what exactly is that and if it can be changed/fixed somehow?

Like I said, this applies to every single ext4 and ext3 drive I've worked with.
 
Old 07-06-2011, 10:53 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
The reduction is probably due to journaling.

If you really want to, you could turn it off.

Quote:
2.9. "No Journaling" mode
Journaling ensures the integrity of the filesystem by keeping a log of the ongoing disk changes. However, it is known to have a small overhead. Some people with special requirements and workloads can run without a journal and its integrity advantages. In Ext4 the journaling feature can be disabled, which provides a small performance improvement.
http://kernelnewbies.org/Ext4#head-b...f00764cb9beb1e
 
Old 07-07-2011, 05:24 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by jcd29 View Post
It'd be weird if ext4 takes off 14 GiB while NTFS takes nothing
My cynical view would be that FOSS will tell you it has used some (for journal or whatever) while M$oft don't.
Maybe it's just my years in the business showing through ...
 
Old 07-07-2011, 09:01 AM   #4
jcd29
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Is the journaling something that's safe to disable in external drives, or should I keep it? What could the consequences of keeping it be?

Quote:
Originally Posted by syg00 View Post
My cynical view would be that FOSS will tell you it has used some (for journal or whatever) while M$oft don't.
Maybe it's just my years in the business showing through ...
I dunno, I'd tend to agree but even when you format a 1 TB drive as NTFS in Linux, you see the size as 931 instead of 917, so I don't think it's that.
 
Old 07-07-2011, 09:25 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
syg00 is referring to the 14GB extra that you have 'lost', not to the 931GB
 
Old 07-07-2011, 09:29 AM   #6
jcd29
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Wim Sturkenboom View Post
syg00 is referring to the 14GB extra that you have 'lost', not to the 931GB
It's the same

The drive is shown as 917GB if it's ext4, but it's shown as 931GB if it's NTFS (both in Linux). That 14GB is what's lost because of the journaling I'm guessing.

I don't know if it's worth disabling though. If it gave a big performance boost maybe. But I don't know the downsides yet.
 
Old 07-11-2011, 08:06 PM   #7
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 106Reputation: 106
Lightbulb



By default drives reserve 5% of the drive for root to write to. You can reduce that by using tune2fs -m # /dev/sdxx .


Quote:

man tune2fs

-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%.


 
  


Reply



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
[SOLVED] disk capacity vanished drManhattan Linux - Newbie 2 03-28-2011 06:38 PM
migrated from ext3-disk to a ext4 disk - now linux wont boot zilogZ80 Linux - Newbie 4 02-05-2010 03:19 AM
hard disk size discrepancy rattlesocks Linux - Software 2 05-05-2007 08:38 AM
how to find disk capacity Henry_1 Linux - General 4 09-11-2003 11:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

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
Open Source Consulting | Domain Registration