LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-18-2004, 07:50 PM   #1
Dee-ehn
Member
 
Registered: Apr 2004
Distribution: Suse 9 pro
Posts: 52

Rep: Reputation: 15
160Gb harddrive only 140Gb???


I have a Highpoint RAID controller (HPT370) in my RH 9.0 system. I just installed the controller (bios 2.34) and two Samsung 160Gb drives in a RAID-1 config. Everything seess to be fine: the BIOS of the controller reports a 160.04 Gb RAID-1 array to be fully working.

Ok, I partitioned the array into 1 primary EXT3 partition. Both cfdisk and fdisk show a disk size of 156Gb. Sounds normal to me for a 160Gb disk...

Anyhow, after making the EXT3 fs (I use mke2fs -j), when I do a df -h, it shows that my RAID array is only 147Gb big (where are those 9Gb?) and only 140GB free, while there's only 33MB used (by the system that is).

Doesn't make sense to me... does it?
 
Old 04-18-2004, 08:11 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,469

Rep: Reputation: 154Reputation: 154
"Anyhow, after making the EXT3 fs (I use mke2fs -j), when I do a df -h, it shows that my RAID array is only 147Gb big (where are those 9Gb?) and only 140GB free, while there's only 33MB used (by the system that is)."

Hard drive manufacturers lie about the size of their drives by defining:
1K = 1000 bytes
1M = 1000K
1G = 1000M

The correct definitions are:
1K = 1024 bytes
1M = 1024K
1G = 1024M

Also when you create a Linux filesystem then roughly 5% of your partition space is used for the filesystem superblocks and inodes. This filesystem overhead is not reported when counting either used space or free space. This is a high overhead but Linux filesystems contain some redundency which makes recovering broken filesystems much easier.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 04-19-2004, 04:02 AM   #3
Dee-ehn
Member
 
Registered: Apr 2004
Distribution: Suse 9 pro
Posts: 52

Original Poster
Rep: Reputation: 15
Yes I know the story of the manufacturers and the commercial kilo/mega/gigabytes (1000/1024) and that's what I took into account, but as I miss 20Gb I thought it to be a little too much.
I just noticed that my 2x 80Gb raid 1 array (there are two raids in the system) only has 74Gb available... but ok if this is true I'm still missing 4 Gb.... can that be explained by the system's overhead?
 
Old 04-19-2004, 08:29 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,763

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
When you format an ext3 partition by default 5% is reserved by root which would account for the missing 4GB. Reserve space is supposed to reduce fragementation and allow root to log in to perform maintenance if the filesystem free space is zero. You can reduce reserve using the tune2fs command.
 
Old 04-19-2004, 06:09 PM   #5
young1024
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1, Fedora Core 2
Posts: 40

Rep: Reputation: 15
HD manufacturers use the metric system, so they use kilobytes (thousand), megabytes (million), and gigabytes (billion). This is respectively 1000 bytes, 1000 KB, and 1000 MB.

Linux and other OS'es refer to these as 1024 bytes, 1024 KB, or 1024 MB, instead, or 2 to the tenth power for each. However, this is incorrect. These should be refered to as kibibytes (KiB), mebibytes (MiB), and Gibibytes (GiB). A difference of 24 dosen't seem like a lot, but that can greatly contribute for Linux "seeing less" of your hard drive.
 
Old 04-19-2004, 11:46 PM   #6
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Its not Operating Systems fault when partitioning and formatting storage mediums. In machine language everything is base 2. We humans state our number system as base 10. 1 kilobyte to us is 1000 bytes but in machine langauge its 1024 bytes.

I have three 120 gigabyte hard drives from different manufactures. One hard drive after formatting is 115 gigabytes. The second hard drive is 112 gigabytes after formatting. The other hard drive is about 112 gigabytes after formatting (I think). You have to calculate the cylinders, heads, and sectors and this will give you the true capacity.

Did you read the information what mke2fs did exactly. It could be it made a huge journal allocation unit to compensate for your hard drive.

You can try other filesystems.

young1024, I do not know where you came from but the computer metric system is bits, bytes, kilobytes, megabytes, gigabytes, terabytes.
 
Old 04-20-2004, 12:34 AM   #7
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
Might want to take a look at ext3 in general, its by far the hog of the journaling fs's and is really just ext2 with a journal. Don't get me wrong, ext2 is and always will be one of the best filesystems every for repairability, stability, and a whole lot of other good words that end in bility, but when it gets down to it, you start losing space due to filesystem structure overhead on a exponential scale as the partition sizes increase. Might want to take a look at Reiser or XFS...

Cheers,

Finegan
 
Old 05-22-2004, 12:17 PM   #8
jjn
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
This is probably not due to the filesystem reserving this space or to marketing vs real gigabytes but more likely due to a kernel limit.

Until recent kernels disks greater than than 128Gb could not be accessed. The 128Gb limit is because the drive geometry is described by 8 bits for sector, 16 bits for cylinder, and 4 bits for head a total of 28bits 2^28 is 268435456 blocks, a block being 512 bytes.

Newer kernels, at least newer than 2.4.18 support the newer ATA-6 addressing scheme which allows disks upto the 2^48 bits in size - 128Pb (PetaByte = 1024 TerraBytes = 1024 Gigabytes)

See the Large disk Howto
for more information
 
Old 08-15-2005, 11:02 AM   #9
abefroman
Senior Member
 
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,249

Rep: Reputation: 53
Quote:
Originally posted by Electro
You have to calculate the cylinders, heads, and sectors and this will give you the true capacity.
What is the formula for calculating true capacity? If I want to mirror a partition on a larger drive to i make the partition the site of the true capacity?
 
Old 08-15-2005, 05:41 PM   #10
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
C X H X S = total bytes

C = Cynlinders
H = Heads (usually it is 255 heads for multi-gigabyte hard drives)
S = Sectors (it is fixed at 63 X 512 bytes)

This information should be noted on the hard drive's label. Not all manufactures state this information.

On my Hitachi 120 GB model 180GXP there are 16383 cylinders, 255 heads, 63 sectors. After creating a partition and formatting, it comes to 115 GB. It does not matter what filesystem that I use. I lost about 5 GB from the stated 120 GB. I have Seagate and Western Digital which are 120 GB. My Western Digital hard drives loses about 8 GB and the Seagate loses 10 GB.
 
  


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
160Gb/2Mb or 120Mb/8Mb ron_henry Linux - Hardware 5 03-29-2005 09:35 PM
LILO Doesn't Work With 160GB Drive bfwissel Linux - Newbie 5 03-11-2005 02:33 PM
Lacie USB 160Gb byteZero Linux - Hardware 2 09-20-2004 09:47 AM
Installing linux on 2nd harddrive(dual boot) windows on seperate harddrive lysol Linux - Software 25 08-03-2004 09:33 AM
External USB disk 160GB frieslinux Linux - Hardware 1 02-06-2004 04:23 AM


All times are GMT -5. The time now is 03:00 PM.

Main Menu
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