Change size of hard drive in gparted

Using applications, configuring, problems
Message
Author
april

#21 Post by april »

No I still can't say its clear.
A Kilobyte is 1024 bytes
A megabyte is 1,024,000 bytes
A megabit is 1,024,000 bits
A megabyte is therefore 1,024,000 x 8 = 8,192,000 bits

How am I doing so far? Crikey I've lost it now .(corrected rather than leave error here)

A Gigabyte is 1000 Megabytes isn't it ?
So a Gigabyte is 1000 x 1,024,000 bytes = 1,024,000,000 bytes
So 120 Gigabytes is 120 x 1,024,000 bytes = 122.880.000,000 bytes. ?

Code: Select all

root# df /dev/sda1
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1      115344936 64914808  44570852  60% /initrd/mnt/dev_save
root# 
115,344,936 X 1024=118,113,200,000 bytes ? ....nearly 2Gig lost here
File system is ext2.
I think I'll forget it and go have a beer
Last edited by april on Fri 18 May 2018, 07:56, edited 7 times in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#22 Post by rcrsn51 »

april wrote:A megabyte is 1024 bytes
A Gigabyte is 1000 Megabytes isn't it ?
So a Gigabyte is 1000 x 1024 bytes = 1,024,000 bytes
No. Mega means million. So Mega is 1000x1000 or 1024x1024, depending on which counting system you are using.

But you shouldn't mix them in the same calculation.

For a hard drive manufacturer, Giga probably means 1000x1000x1000, not 1000x1024x1024.

For a RAM manufacturer, Giga probably means 1024x1024x1024.

But you don't really know unless they tell you.

----------------

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#23 Post by jafadmin »

bits = bytes x 8 ( how data transfer speeds are measured - bps )

Bytes in Hex notation: (how volume is measured)

1024 = 1K
1024 x 1024 = 1M
1024 x 1024 x 1024 = 1G
1024 x 1024 x 1024 x 1024 = 1T

Marketing departments like to use decimal notation to make their products appear
bigger than their competitor's. a 500 G drive in hex would magically become a 520 G drive using decimal notation, etc ..

It's like monitor manufacturers using diagonal measurements instead of horizontal measurements.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#24 Post by rcrsn51 »

jafadmin wrote: a 500 G drive in hex would magically become a 520 G drive using decimal notation
Calculation, please.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#25 Post by jafadmin »

rcrsn51 wrote:
jafadmin wrote: a 500 G drive in hex would magically become a 520 G drive using decimal notation
Calculation, please.
Ok, busted. My bad. It would be:

536,870,912,000 or 536G (dec)

1024x1024x1024x500

The problem is that the engineers who build these things are using hex notation to build them, then the marketing guys are using whatever the hell they want to use to market and sell them to naive consumers.
Here: Interesting read
In sales & marketing, ambiguity = Buck$
.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#26 Post by rcrsn51 »

The "fdisk -l" command shows you the total number of INDIVIDUAL byes on the drive. There is no confusion in that number.

You then have two ways to convert the number to a more convenient form - divide by powers of 1000 or divide by powers of 1024.

Since Gparted shows april's drive in GiB's, it's working with 1024. This is probably because other measurements are that way too.

For example, a 4KB block size is 4096 bytes, not the metric 4000 bytes.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#27 Post by jafadmin »

Agree that fdisk will show the real story.

In my own case, I care about block size and number of blocks. Then I do the math on my fingers. :roll:

The reason for all the madness is that it makes simple sense in hexadecimal:
Block size 512 = 200h
Block size 1024 = 400h
Block size 4096 = 1000h

april

#28 Post by april »

fdsk =119,997,988,864 bytes as opposed to
115,344,936 X 1024=118,113,200,000 bytes under df report

Code: Select all

root# fdisk -l /dev/sda1
Disk /dev/sda1: 111.8 GiB, 119997988864 bytes, 234371072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Now there must be a clear reason for that discrepancy
and
Disk /dev/sda1: 111.8 GiB so we are down 6.3 Gig on marked capacity.
118.113G
111.800G
...6.313G
I'm almost scared to use "/mnt/sda1" and see what comes up there !
Last edited by april on Fri 18 May 2018, 08:01, edited 1 time in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#29 Post by rcrsn51 »

april wrote:... as opposed to 115,344,936,000 bytes under df report
Where did you get that number?

april

#30 Post by april »

Code: Select all

root# df /dev/sda1
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1      115344936 64914808  44570852  60% /initrd/mnt/dev_save
root# 

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#31 Post by rcrsn51 »

Multiply by 1024, not 1000.

april

#32 Post by april »

OK all these knowledgeable interjections but nothing comprehensive .
I have adjusted my posts where I think you are suggesting fixes

So Why the 6.313 Gig difference in reports from "df" and "fdisk -l"...?

Only one can be correct.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#33 Post by rcrsn51 »

This may be the difference between the amount of raw space on the disk and the amount of workable space available to the end user.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#34 Post by jafadmin »

april wrote:OK all these knowledgeable interjections but nothing comprehensive .
I have adjusted my posts where I think you are suggesting fixes

So Why the 6.313 Gig difference in reports from "df" and "fdisk -l"...?

Only one can be correct.
They are both correct. They measure different things.

df measures free space on mounted disk partitions. fdisk reports on the raw disk device metrics.

So fdisk shows raw disk, df shows cooked disk space, got it? Raw and cooked!

What is the raw weight of a ribeye, and what is the cooked weight? Inquiring mimes want to know! Yes, MIMES!! :shock:

april

#35 Post by april »

Well I breed Droughtmaster Stud Bulls for sale and If their meat lost that much in the cooking I would change brands.

Thanks anyway

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#36 Post by rcrsn51 »

fdsk =119,997,988,864 bytes as opposed to
115,344,936 X 1024=118,113,200,000 bytes under df report
The raw size (fdisk) of the drive counted in decimal is 120 billion or 120 GB .

The usable size (df) also counted in decimal is 118 billion or 118 GB.

So you have only lost 2 GB, or less than 2%.
Last edited by rcrsn51 on Sat 19 May 2018, 13:06, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#37 Post by bigpup »

You have not lost anything.
You have used some of the physical drive space for the format info, file allocation table, partition table, etc....
Usable space is what those items do not use.

Also you may have some sectors flagged as bad by the format process. Those you do not want to use.

This feature also takes up some physical area of the drive.
Nowadays, the disk is managed by a microcontroller on the drive itself, and that microcontroller keeps track of bad sectors and "swaps in" good sectors from a reserve pool.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#38 Post by rcrsn51 »

Manufactures of hard drives always identify the size based on the smaller number used to calculate size.
Makes it look bigger than it really is.
Check the advertised size of your drive against the size reported in "fdisk -l".

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#39 Post by jafadmin »

april wrote:Well I breed Droughtmaster Stud Bulls for sale and If their meat lost that much in the cooking I would change brands.
So are you going to use miles per hour, or miles per gallon, then? It's not clear. :wink:

april

#40 Post by april »

jafadmin wrote:
april wrote:Well I breed Droughtmaster Stud Bulls for sale and If their meat lost that much in the cooking I would change brands.
So are you going to use miles per hour, or miles per gallon, then? It's not clear. :wink:
Its kilometers in Oz for a start Kilometers per hour or Kilometers per litre ?
You have lost me, speed or economy ? SPEED for me ! The bloody economy is rigged anyway however you look at it .I drive an Audi , Audi owns VW so I guess the settings will be fiddled.

Post Reply