LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-25-2008, 04:06 PM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
large disk formatting


Good Day,

I format a disk over 900GB, But when I mount it and
>df -h

it it shows it as 800somthing GB
atleast 60GB are missing.

I tried
both
>mke2fs -j -b 4096 /dev/sdd1
and
mke2fs -j /dev/sdd1

Any Ideas?
Thanks
 
Old 11-25-2008, 04:14 PM   #2
claudius753
Member
 
Registered: Jan 2004
Distribution: Mac OS X 10.6.4 "Snow Leopard", Win 7, Ubuntu 10.04
Posts: 322

Rep: Reputation: 31
The size of a disk isn't necessarily how much space you will have when it is formatted. For instance, my 320GB drive only shows as 297 GB, the actual formatting takes up space.

The larger the drive, the more space the format will take up I would assume.
 
Old 11-25-2008, 04:14 PM   #3
claudius753
Member
 
Registered: Jan 2004
Distribution: Mac OS X 10.6.4 "Snow Leopard", Win 7, Ubuntu 10.04
Posts: 322

Rep: Reputation: 31
Oops, double post

Last edited by claudius753; 11-25-2008 at 04:26 PM. Reason: double post
 
Old 11-25-2008, 04:15 PM   #4
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
So its normal?

Thanks.
 
Old 11-25-2008, 04:27 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Some (most?) linux filesystems reserve space for your own protection and to keep the fielsystem in good order. This is a snippet from the man page for mk2fs (a porgram that generated the actual filesystem):
Code:
       -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 cor-
              rectly after non-privileged processes are prevented  from  writing  to  the  filesystem.   The
              default percentage is 5%.
The last bit means that if you or an unprivileged process fill up the disk, it won't instantly crash the system.
 
Old 11-25-2008, 05:27 PM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
On top of the reserve space, drive manufactures sell a GB as 1000 instead of 1024 (or something along those lines). So you loose quite a bit just to that.
 
Old 11-25-2008, 06:00 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
To sum up, there are a few separate issues:
  1. Disk manufacturers use international metrics systems. In an international metrics system, the prefixes to quantify magnitudes are expressed as powers of ten, because the humankind likes to count in that numeric base. However, computers are not -at least not for now- part of the humankind, and they like to count in powers of two. So, there's a slight misalignment between the way that computers count and the way that humans count, in which regards these prefixes. For your manufacturer (presumably, a human), 900 GB are 900 x 10^9 bytes. For a computer, 900 GB are 900 * 2^30 bytes, which are 900 x 1,073,741,824 bytes, and not 900 x 1,000,000,000 bytes like in the previous case. Doing the simple conversion you find that 900,000,000,000 (900 GiB, as per the human measure) are really 838 GB when it's counted by a PC. This is the major factor here.
  2. Secondly, the reserved space for root, however fdisk is not aware of that since it's fs agnostic. This is a space that some fs's reserve for root, and it's usually defaulted to a 5%, which in your drive would be 45 GiBs. Quite a lot, you can reduce it, or even disable it completely with tune2fs -m0 /dev/whatever. This is not advisable on a file system that will be used as the root of your system. In such case, always reserve some space unless you know what you are doing.
  3. Journaling is the third component here. It takes some space. This is the lesser factor. Some file systems allocate some space for journals, to improve the security and to shorten the fsck times.

PS. In other words, your drive is perfectly fine.

Last edited by i92guboj; 11-25-2008 at 06:04 PM.
 
Old 11-25-2008, 06:04 PM   #8
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 494

Rep: Reputation: 35
"Loosing" disk space is normal after formatting. You know, every filesystem actually uses some diskspace, and the bigger filesystem you have, the more space will be used by the filesystem. Also notice, that not every type of filesystem (NTFS, FAT, ext2, ext3, etc.) uses the same amount of space on a particular partition. Some use more, some use less. There's nothing to be worried about.
 
Old 11-25-2008, 06:04 PM   #9
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 494

Rep: Reputation: 35
"Loosing" disk space is normal after formatting. You know, every filesystem actually uses some diskspace, and the bigger filesystem you have, the more space will be used by the filesystem. Also notice, that not every type of filesystem (NTFS, FAT, ext2, ext3, etc.) uses the same amount of space on a particular partition. Some use more, some use less. There's nothing to be worried about.
 
Old 11-25-2008, 06:05 PM   #10
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 494

Rep: Reputation: 35
"Loosing" disk space is normal after formatting. You know, every filesystem actually uses some diskspace, and the bigger filesystem you have, the more space will be used by the filesystem. Also notice, that not every type of filesystem (NTFS, FAT, ext2, ext3, etc.) uses the same amount of space on a particular partition. Some use more, some use less. There's nothing to be worried about.
 
Old 11-25-2008, 08:45 PM   #11
claudius753
Member
 
Registered: Jan 2004
Distribution: Mac OS X 10.6.4 "Snow Leopard", Win 7, Ubuntu 10.04
Posts: 322

Rep: Reputation: 31
Looks like I'm not the only one having trouble with double posts today...

I didn't even think of the 1000 vs 1024 thing. Do they do this from the byte level up? IE, 1MB should be 1024 KB, do they consider 1000 KB as 1 MB?
 
Old 11-25-2008, 09:15 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by claudius753 View Post
Looks like I'm not the only one having trouble with double posts today...

I didn't even think of the 1000 vs 1024 thing. Do they do this from the byte level up? IE, 1MB should be 1024 KB, do they consider 1000 KB as 1 MB?
Yes. It doesn't matter the units you choose, the final result is the same. They use the same SI prefixes that you can find in any other discipline.

http://physics.nist.gov/cuu/Units/prefixes.html

But again, computers do not understand about SI units. For computers it's just convenient to use powers of 2 instead of powers of ten, so that's how computers count. With 10 bits, you can count up to 1024, with 9 you only can count up to 512, so, there's nothing in the middle really. It's just the nature of computers. Computers do have only two fingers, and not ten. In the past, this "rounding" worked more or less for most purposes. The problem is that, as the sizes grow, the SI numbers and the base2 numbers start to diverge more and more.

In the SI nomenclature 900 gigabytes are 900,000 megabytes, 900,000,000 kilobytes or 900,000,000,000 bytes.

Strictly speaking, we (the 1024 crew) are the ones that count "the wrong way". Since the rest of the world counts in powers of ten and is happy with that. However, we can't overlook that this "discrepancy" produces a marginal benefit for hardware makers. I wouldn't be able to count with 12 bits the times that I have answered this same question. Sooner or later all the computer users wonder where all the MB's (well, GB's nowadays) are going

Last edited by i92guboj; 11-25-2008 at 09:21 PM.
 
Old 11-25-2008, 09:57 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,033

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
Read this too.
 
Old 11-26-2008, 08:05 AM   #14
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 494

Rep: Reputation: 35
Oh! I'm sorry! I didn't want to post the same twice. Yesterday LQ was a bit slow sometimes...

So: back to disk space problems. There is a way to avoid these misunderstandings. It's called KiB (kibibyte), MiB (mebibyte), GiB (gibibyte), etc... These terms were invented about 10 years ago by IEC to set a new naming system for what we call kilobyte, megabyte, etc... Kibibyte for example is Kilo Binary Byte which means 1024 bytes exclusively, and never 1000 bytes or anything else. You can read more about this naming system here for example.

Why don't hardware manufacturers use this more accurate naming system is another story...
 
Old 11-26-2008, 07:57 PM   #15
claudius753
Member
 
Registered: Jan 2004
Distribution: Mac OS X 10.6.4 "Snow Leopard", Win 7, Ubuntu 10.04
Posts: 322

Rep: Reputation: 31
Quote:
Originally Posted by pusrob View Post
Oh! I'm sorry! I didn't want to post the same twice. Yesterday LQ was a bit slow sometimes...

So: back to disk space problems. There is a way to avoid these misunderstandings. It's called KiB (kibibyte), MiB (mebibyte), GiB (gibibyte), etc... These terms were invented about 10 years ago by IEC to set a new naming system for what we call kilobyte, megabyte, etc... Kibibyte for example is Kilo Binary Byte which means 1024 bytes exclusively, and never 1000 bytes or anything else. You can read more about this naming system here for example.

Why don't hardware manufacturers use this more accurate naming system is another story...
Ah ha, I always wondered why some people typed GB or MB and others sometimes used GiB or MiB, I thought it was just a different way to abbreviate Gigabyte or Megabyte, etc. I didn't know it was 2 separate ways to measure. Learn something new every day...
 
  


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
formatting large hard disk drives in linux jdh77 Linux - Hardware 13 07-17-2008 02:49 AM
formatting hard disk rohans Linux - Software 2 08-24-2007 08:10 AM
Formatting linux disk? euclid Linux - General 6 09-03-2006 07:01 AM
Formatting a disk as NTFS lothario Linux - Software 1 01-06-2006 07:00 PM
Question on disk formatting Qwirt Linux - Hardware 3 10-08-2004 02:42 AM


All times are GMT -5. The time now is 09:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration