linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Determining maximum partition size on a hard disk
@ 2001-08-21 19:55 Nick DeClario
  2001-08-28 12:23 ` Guest section DW
  2001-08-28 12:53 ` Anton Altaparmakov
  0 siblings, 2 replies; 6+ messages in thread
From: Nick DeClario @ 2001-08-21 19:55 UTC (permalink / raw)
  To: linux-kernel

I am trying to calculate the maximum size a partition can be on a hard
drive and I ran into some problems I don't fully understand.  

First I found that the maximum size of the drive Linux reports is not
the maximum size I get when I calculate it from the drives geometry. 
Secondly, the total drive space reported by linux is not the amount
available for the maximum partition.

For example, I have a 4.3Gb disk.  The drives geometry is 525 cylinders,
255 heads and 63 sectors (525 * 255 * 63 * 512 = 4318272000 or
4.318Gb).  

This is an IDE disk so I found in /proc/ide/hdx/capacity a block size
8439184, which when divided by 2048 is 4120.7, ~200Mb less than what I
calculated as the disk size.  

Finally, using a program such as fdisk or sfdisk I create a partition
manually to be the maximum amount allowed, which turns out to be 4217041
blocks, or, when divided by 1024 is 4118.2.

I assume that the difference between the maximum size that linux reports
and the maximum partition size is due to linux leaving room for a MBR
and such.  If so how do I go about calculating this?  Also why does the
size of the drive I calculate out by using the drives geometry differ so
much from the amount Linux reports?  I thought maybe Linux set 1MB=1000k
but that doesn't seem to case.

Any information or a push in the right direction would be appreciated,
thanks! 

Regards,
	-Nick DeClario

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Determining maximum partition size on a hard disk
  2001-08-21 19:55 Determining maximum partition size on a hard disk Nick DeClario
@ 2001-08-28 12:23 ` Guest section DW
  2001-08-28 12:53 ` Anton Altaparmakov
  1 sibling, 0 replies; 6+ messages in thread
From: Guest section DW @ 2001-08-28 12:23 UTC (permalink / raw)
  To: nick, linux-kernel

On Tue, Aug 21, 2001 at 03:55:55PM -0400, Nick DeClario wrote:

> I am trying to calculate the maximum size a partition can be on a hard
> drive and I ran into some problems I don't fully understand.  
> 
> First I found that the maximum size of the drive Linux reports is not
> the maximum size I get when I calculate it from the drives geometry. 
> Secondly, the total drive space reported by linux is not the amount
> available for the maximum partition.
> 
> For example, I have a 4.3Gb disk.  The drives geometry is 525 cylinders,
> 255 heads and 63 sectors (525 * 255 * 63 * 512 = 4318272000 or
> 4.318Gb).  
> 
> This is an IDE disk so I found in /proc/ide/hdx/capacity a block size
> 8439184, which when divided by 2048 is 4120.7, ~200Mb less than what I
> calculated as the disk size.

I don't know why you would want to divide by 2048.
Multiply by 512 and find 512*8439184 = 4320862208 bytes.
Since that is more than you thought you had, be happy.

> I assume that the difference between the maximum size that linux reports
> and the maximum partition size is due to linux leaving room for a MBR

No. There are rounding differences. The disk capacity is not an integral
number of cylinders and you lose if you insist on alignment.

Find a lot of details in the Large Disk Howto.

> I thought maybe Linux set 1MB=1000k but that doesn't seem to case.

Well, 1 M = 1000 k by definition of the SI system of units.
This has nothing to do with Linux.
But if you are confused about units, just compute in bytes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Determining maximum partition size on a hard disk
  2001-08-21 19:55 Determining maximum partition size on a hard disk Nick DeClario
  2001-08-28 12:23 ` Guest section DW
@ 2001-08-28 12:53 ` Anton Altaparmakov
  2001-08-28 21:45   ` units - was: Re: Determining maximum partition size Guest section DW
  1 sibling, 1 reply; 6+ messages in thread
From: Anton Altaparmakov @ 2001-08-28 12:53 UTC (permalink / raw)
  To: Guest section DW; +Cc: nick, linux-kernel

At 13:23 28/08/01, Guest section DW wrote:
>On Tue, Aug 21, 2001 at 03:55:55PM -0400, Nick DeClario wrote:
> > I thought maybe Linux set 1MB=1000k but that doesn't seem to case.
>
>Well, 1 M = 1000 k by definition of the SI system of units.
>This has nothing to do with Linux.
>But if you are confused about units, just compute in bytes.

While it is true that M = 10^6 and k = 10^3, surely that doesn't apply to 
byte quantities?!? At least I have always interpreted 1 Megabyte = 1024 
kilobytes = 1024*1024 bytes, and I think the poster meant the same when 
writing 1MB = 1000k...

If we are nitpicking, he probably should have written 1MiB = 1000kiB. [Feel 
free to correct me if I am wrong, but IIRC, Mi and ki are the abbreviations 
for 2^10 multiples rather than 10^3...]

Anton


-- 
   "Nothing succeeds like success." - Alexandre Dumas
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* units - was: Re: Determining maximum partition size...
  2001-08-28 12:53 ` Anton Altaparmakov
@ 2001-08-28 21:45   ` Guest section DW
  0 siblings, 0 replies; 6+ messages in thread
From: Guest section DW @ 2001-08-28 21:45 UTC (permalink / raw)
  To: Anton Altaparmakov; +Cc: nick, linux-kernel

On Tue, Aug 28, 2001 at 01:53:29PM +0100, Anton Altaparmakov wrote:

> > > I thought maybe Linux set 1MB=1000k but that doesn't seem to case.

> >Well, 1 M = 1000 k by definition of the SI system of units.
> >This has nothing to do with Linux.
> 
> While it is true that M = 10^6 and k = 10^3, surely that doesn't apply to 
> byte quantities?!? At least I have always interpreted 1 Megabyte = 1024 
> kilobytes = 1024*1024 bytes


Ah, an old discussion - I imagine it must have occurred here a few times.
Anyway: k is the prefix for 1000, M is the prefix for 1000000. Always.

But there is a natural sloppiness, where people round numbers when either
the precise size is unimportant, or is clear from the context.
If xyzzies come in boxes of 27 and I say that I bought a hundred xyzzies
then that probably means that in fact I bought 108.

Thus, our old PDP8 with 4k of memory had 4096 12-bit words, that is,
6 KiB in modern terminology.

You see two very different situations here: "precise size is unimportant"
and "precise size is clear from the context". When someone says that she
bought a 10 GB disk I will assume that the precise size is somewhere
between 9.5 and 10.5 GB. This is the "rounded" case.
When someone says that she bought a 32 MB SIMM I will assume that this was
32 MiB, that is, 2^25 bytes, since, unlike disks, memory modules tend to
come in power-of-two units. This is the "clear from the context" case.

Andries

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Determining maximum partition size on a hard disk
  2001-08-24  8:47 Determining maximum partition size on a hard disk Paal Chr Birkeland
@ 2001-08-24 13:15 ` Arnvid Karstad
  0 siblings, 0 replies; 6+ messages in thread
From: Arnvid Karstad @ 2001-08-24 13:15 UTC (permalink / raw)
  To: paalchr, linux-kernel


On Fri, 24 Aug 2001 10:47:28 +0200
Paal Chr Birkeland <paalchr@linuxnation.net> wrote:

> >
> > First I found that the maximum size of the drive Linux reports is not
> > the maximum size I get when I calculate it from the drives geometry.
> > Secondly, the total drive space reported by linux is not the amount
> > available for the maximum partition.
> >
> 
> tune2fs -m 2 /dev/hd-whatever-hdd
> 
> For some reason linux still "eats" 5% of the hdd. This for still beeing able 
> to run smooth if hdd is maxed out, or something like that.
> I dont know if the tune2fs is a slackware feature only, but i doubt it. Then
> again I havent really "tried" any other distro.
> Inputs ?


You can you choose this when you make the filesystem..

By using the -m option to mke2fs you can set the
reserved-block-percentage ... and can eay overide this then to 0 or 3
percent...

       -m reserved-blocks-percentage
              Specify the percentage of reserved blocks for the super-user.  This value defaults to 5%.

afaik, the 5% option is a mke2fs default for all distributions.


Best regards,

Arnvid Karstad
Speedroad Networks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Determining maximum partition size on a hard disk
@ 2001-08-24  8:47 Paal Chr Birkeland
  2001-08-24 13:15 ` Arnvid Karstad
  0 siblings, 1 reply; 6+ messages in thread
From: Paal Chr Birkeland @ 2001-08-24  8:47 UTC (permalink / raw)
  To: linux-kernel

>
> First I found that the maximum size of the drive Linux reports is not
> the maximum size I get when I calculate it from the drives geometry.
> Secondly, the total drive space reported by linux is not the amount
> available for the maximum partition.
>

tune2fs -m 2 /dev/hd-whatever-hdd

For some reason linux still "eats" 5% of the hdd. This for still beeing able 
to run smooth if hdd is maxed out, or something like that.
 
root@vixen:~# tune2fs -m 2 /dev/hdb1
tune2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
Setting reserved blocks percentage to 2 (256034 blocks)

Default is 5% (slackware)

This, I think, is from way back when hdds where alot smaler and then ppl 
forgot all about it (?). 5% of an 80 gig hdd gotta be a lot of wasted space 
and in no way required. I always set it lower (2% as above) and gain more 
useable space. Probably 1% would be enough but who's counting :o)

I dont know if the tune2fs is a slackware feature only, but i doubt it. Then
again I havent really "tried" any other distro.

Inputs ?

-- 
Vennlig hilsen / Regards
Paal Chr Birkeland
admin@linuxnation

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-28 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-21 19:55 Determining maximum partition size on a hard disk Nick DeClario
2001-08-28 12:23 ` Guest section DW
2001-08-28 12:53 ` Anton Altaparmakov
2001-08-28 21:45   ` units - was: Re: Determining maximum partition size Guest section DW
2001-08-24  8:47 Determining maximum partition size on a hard disk Paal Chr Birkeland
2001-08-24 13:15 ` Arnvid Karstad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).