public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guest section DW <dwguest@win.tue.nl>
To: nick@guardiandigital.com, linux-kernel@vger.kernel.org
Subject: Re: Determining maximum partition size on a hard disk
Date: Tue, 28 Aug 2001 14:23:15 +0200	[thread overview]
Message-ID: <20010828142315.A20775@win.tue.nl> (raw)
In-Reply-To: <3B82BCCB.377BCC4@guardiandigital.com>
In-Reply-To: <3B82BCCB.377BCC4@guardiandigital.com>; from Nick DeClario on Tue, Aug 21, 2001 at 03:55:55PM -0400

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.

  reply	other threads:[~2001-08-28 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21 19:55 Determining maximum partition size on a hard disk Nick DeClario
2001-08-28 12:23 ` Guest section DW [this message]
2001-08-28 12:53 ` Anton Altaparmakov
2001-08-28 21:45   ` units - was: Re: Determining maximum partition size Guest section DW
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24  8:47 Determining maximum partition size on a hard disk Paal Chr Birkeland
2001-08-24 13:15 ` Arnvid Karstad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010828142315.A20775@win.tue.nl \
    --to=dwguest@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@guardiandigital.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox