Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Luca Berra <bluca@comedia.it>
To: linux-raid@vger.kernel.org
Subject: Re: Partitions with == or \approx same size ?
Date: Sat, 21 Jul 2007 11:25:08 +0200	[thread overview]
Message-ID: <20070721092507.GC18424@percy.comedia.it> (raw)
In-Reply-To: <Pine.LNX.4.58.0707201908020.30683@ybpnyubfg.ybpnyqbznva>

On Fri, Jul 20, 2007 at 07:54:54PM +0200, Seb wrote:
>
>Dear all,
>
>
>First I'd like to thank you for the great work you've done with mdadm.
>It's flexible, powerful and reasonably easy to use.
>
>I have a question that seems both important for the redundancy of my RAID6
>devices and too sharp for me, my friends and the newsgroup
>fr.comp.stockage . I think your understanding of the inner workings of
>mdadm should allow you to already know the answer.
>
>A 12-disks machine was recently assembled with disks coming from several
>sources (Linux Ubuntu server, kernel 2.6.15, RAID6 array). All 12 disks
>are S-ATA with 250 GB capacity.
>
>I understand that partitions should have the same size, meaning the same
>number of bytes. All 12 disks have exactly 250059350016 bytes, but the
>number of blocks that can be allocated are not the same from one disk to
>another, ranging from 244196001 to 244198384. Small difference, but
>significant nonetheless if this means that data can be lost. So I looked
>for a number of blocks that would be the same for all disks. But the
>number of blocks cannot be imposed when creating a partition, only the
>number of cylinders.

since we are living with machines based on a 1980 design,
the usable size of a partitioned device is rounded to disk geometry,
and geometry is read from the partition table (if there is one)
oh, geometry has no real meaning in modern disk drives.


>On the disks with 244196001 blocks, 'fdisk -l' says:
>	Units = cylinders of 16065 * 512 = 8225280 bytes
this disk has 255 head and 63 sectors per track
usable space is
int(size/H/S/512)*H*S*512-S*512   # the subtraction here is to account
                                  # for space used by partition table
int (250059350016/255/63/512) = 30401
30401*255*63*512-63*512 = 250056705024
250056705024 / 1024 = 244196001 *BINGO*

>For the other half, it says:
>	Units = cylinders of 2048 * 512 = 1048576 bytes
this one might be 128H 16S, or any other combination for that matter,
let's see
int (250059350016/1048576) = 238475
238475 * 1048576 = 250059161600
your resulting space is 244198384K
244198384 * 1024 = 250059145216
250059161600 - 250059145216 = 16384 (space used by partition)
16384k is 32 sectors...
so geometry for this one is 238475 Cyl, 64 Heads, 32 Sectors

best thing you can do is make all disk have the same apparent geometry.
usually if you zap partition tables and reboot all disks should come up
with similar geometry.
another issue is to partition your drives with sfdisk, using -C, -H, -S
options to force a geometry.

L.


-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2007-07-21  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 17:54 Partitions with == or \approx same size ? Seb
2007-07-20 19:48 ` Robin Hill
2007-07-20 21:48 ` Neil Brown
2007-07-21  0:41   ` Seb
2007-07-21  7:02     ` Neil Brown
2007-07-21 12:41       ` Seb
2007-07-21  9:25 ` Luca Berra [this message]

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=20070721092507.GC18424@percy.comedia.it \
    --to=bluca@comedia.it \
    --cc=linux-raid@vger.kernel.org \
    /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