LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   3.6T useable on a 4TB HDD? (http://www.linuxquestions.org/questions/slackware-14/3-6t-useable-on-a-4tb-hdd-4175489686/)

luckyknight 12-31-2013 07:39 AM

3.6T useable on a 4TB HDD?
 
I've purchased 2 x 4TB WD40EZRX SATA HDDS and setup in parted using a gpt label:

Quote:

GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA WDC WD40EZRX-00S (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:


Number Start End Size File system Name Flags
1 1049kB 4001GB 4001GB ext4 primary
But df -h only shows 3.6T is useable - is this normal?

Quote:

/dev/sdb1 3.6T 855G 2.6T 25% /storage/sdb1
/dev/sdc1 3.6T 2.1T 1.4T 62% /storage/sdc1
Motherboard is a Gigabyte D525 Atom running Slackware 14.1. Disk was formatted using mkfs.ext4

druuna 12-31-2013 08:00 AM

There could be 2 things that could explain this:

1 - When you format a partition a certain percentage (default is 5%, which is 200 Gb in your case) is allocated for root use only, this to make sure you are able to troubleshoot the partition if something goes wrong.

2 - There is a difference between 4 TB as mentioned by the manufacturer and 4 TB as mentioned by df. The first is based on 1000 being 1 Mb and the second on 1024 being 1 Mb.

Those 2 combined will account for the "missing" space.

cascade9 12-31-2013 08:57 AM

Yep, its going to be the whole MB vs MiB issue.

http://en.wikipedia.org/wiki/Mebibyte

4TB = 3.63 TiB.

anscal 12-31-2013 12:46 PM

Quote:

Originally Posted by luckyknight (Post 5089571)
But df -h only shows 3.6T is useable - is this normal?

It is normal, because
Quote:

df -h
reports sizes in MiB/GiB/TiB (i.e. the units we called MB/GB/TB in our childhood :) ). To obtain the base-ten sizes, try
Quote:

df -H
or, better,
Quote:

df --si
:)

luckyknight 12-31-2013 02:13 PM

Quote:

Originally Posted by cascade9 (Post 5089595)
Yep, its going to be the whole MB vs MiB issue.

http://en.wikipedia.org/wiki/Mebibyte

4TB = 3.63 TiB.

I had the same thought as I left the house!! Thanks for clarifying :)

tjackson 11-14-2014 09:45 AM

4tb != 4tb
 
This seems to be a recent change. In the past, if I purchased a xGB or xTB disk, I got xGB or xTB.
In my opinion, this just means the consumer gets 9% less than what he purchases. I don't like it.

szboardstretcher 11-14-2014 10:06 AM

Quote:

In my opinion, this just means the consumer gets 9% less than what he purchases. I don't like it.
No. Not at all.

You are getting 4 Terrabytes worth of space, which CONVERTS to 3.63 TiB of space. It's like converting 1 Mile to Kilometers, its the same amount of distance represented in different units.

You ARE getting 4 TerraBYTES worth of space. Its just that computer programs generally report space in Mebbibytes instead.

jtsn 11-14-2014 10:07 AM

Quote:

Originally Posted by tjackson (Post 5269681)
This seems to be a recent change. In the past, if I purchased a xGB or xTB disk, I got xGB or xTB.

The first hard drive I installed Slackware on was a Conner IDE drive with 170 MB or 162 MiB capacity. This was about 20 years ago. So if a "change" ever happened, it was before then.

bassmadrigal 11-14-2014 10:32 AM

Quote:

Originally Posted by tjackson (Post 5269681)
This seems to be a recent change. In the past, if I purchased a xGB or xTB disk, I got xGB or xTB.

It has always been this way (always being at least the last 25 years -- probably much longer). It was definitely not a recent change (although, adding the designation of MiB instead of MB for decimal by the IEC occurred in 1998 and took quite a while longer for manufacturers/developers to start utilizing it). Put simply, hard drive manufacturers treat 1GB as one billion bytes, while the operating system calls it 1,073,741,824 bytes (1000 * 1000 * 1000 vs 1024 * 1024 * 1024).

You can see the same issue in reverse with CDs. A CD can hold 700MiB (commonly called 700MB) of information, which ends up being 737,280,000 bytes. If a hard drive manufacturer were selling this CD, it would be labeled as a 737MB disc. And this even occurred with 3.5" floppies, although at a much smaller scale. A 1.44MiB (commonly called 1.44MB) floppy held 1,474,560 bytes, which would've been labeled as 1.47MB by hard drive manufacturers. If you want more info (although, it is Windows based, however it still holds true in Linux), see the following How-to Geek page.

http://www.howtogeek.com/123268/wind...rong-capacity/

jtsn 11-14-2014 11:55 AM

Quote:

Originally Posted by bassmadrigal (Post 5269706)
And this even occurred with 3.5" floppies, although at a much smaller scale. A 1.44MiB (commonly called 1.44MB) floppy held 1,474,560 bytes, which would've been labeled as 1.47MB by hard drive manufacturers.

And the floppy example is amusing, because both designations are wrong. It's either 1.41 MiB or 1.47 MB formatted capacity (exactly 1440 KiB). But neither 1.44 MB nor 1.44 MiB, such a floppy doesn't exist. :D

bassmadrigal 11-14-2014 04:16 PM

Quote:

Originally Posted by jtsn (Post 5269746)
And the floppy example is amusing, because both designations are wrong. It's either 1.41 MiB or 1.47 MB formatted capacity (exactly 1440 KiB). But neither 1.44 MB nor 1.44 MiB, such a floppy doesn't exist. :D

Haha... I didn't even catch that on the wikipedia page.

EdGr 11-15-2014 12:43 AM

The difference between 1000^N and 1024^N has become pretty large at N=4. Eventually, the rated capacity of storage devices will have nothing to do with the size reported by the OS. ;)
Ed

Totoro-kun 11-15-2014 02:01 AM

Please do not forget, that Linux ext file systems reserve 10% of space by default, so if your disk is full you could still work on the system Edit: around 5% of space by default, so root user can login and rescue system in case disk is full /Edit . With big drives this can be insane amount of wasted space. You could use tune2fs command for setting it for example to 0.5%:
Code:

tune2fs -m 0.5 /dev/sdb1
Another issue is unit conversion issue mentioned above.

syg00 11-15-2014 02:08 AM

That would be 5%, and is specifically reserved for the root user to be able to logon and rescue the system.
For data partitions, set it to zero.

jtsn 11-15-2014 04:07 AM

Quote:

Originally Posted by Totoro-kun (Post 5270009)
Please do not forget, that Linux ext file systems reserve 10% of space by default, so if your disk is full you could still work on the system Edit: around 5% of space by default, so root user can login and rescue system in case disk is full /Edit .

5 % file system space are reserved to prevent excessive fragmentation on ext2/4 and allow e2fsck to continue to function in case of an almost full disk. This is why this is a percentage. The reason why root can fill up this space, is because he's the super user, who is by definition allowed to do everything including stupid things. Not because it is a good idea to use the last 5 percent.


All times are GMT -5. The time now is 10:54 PM.