Re: Partitions with == or \approx same size ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
       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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux