public inbox for linux-kernel@vger.kernel.org
 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-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
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox