Discussion:
Mixing 512 bytes and 4K sector harddrives in a raid1?
Henrik Olsson
2011-02-07 11:41:13 UTC
Permalink
Hi,

One of the drives in my raid1 recently crashed and it looks like all
the replacement disks (2TB) i can find use 4K sectors, but the old
ones were 512 bytes.
Are there any issues with having a raid1 array with different sector
sizes for the drives?

Regards,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Henrik Olsson
2011-02-07 14:08:17 UTC
Permalink
Post by Henrik Olsson
Hi,
One of the drives in my raid1 recently crashed and it looks like all
the replacement disks (2TB) i can find use 4K sectors, but the old
ones were 512 bytes.
Are there any issues with having a raid1 array with different sector
sizes for the drives?
Regards,
Henrik
I can't answer for sure, but I would think there would be no problem =
as long
as you make sure your partitions are 4 KB aligned. =A0AFAIUI, Linux a=
lways
writes in 4K blocks to the disks anyway, so alignment is the only iss=
ue -
and that's a performance issue, not a correctness one.
Yes, that's the impression i've gotten after reading about it too.
As long as i create a 4KB aligned partition on the new drive that is
at least as large as the old one and replace the old one with it in
the array, it should just work?

I run dmcrypt and then lvm on top of the raid array though, trying to
figure out what needs to be done with alignment with those...

Worst case i should be able to create a new properly aligned
array/dmcrypt/lvm on the new drive, copy the old data over and add the
old working drive to the new array since if it's 4K aligned it should
also be 512B aligned?

/Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Roberto Spadim
2011-02-07 15:07:39 UTC
Permalink
speed problem =3D) (i tested eeheheh)
i was talking about it in this list
i don=B4t know yet what the internal raid1 sector size (i think it=B4s =
the
chuck size defined on mdadm --create, but i=B4m not sure)
if you use 4k ssd you can see read/write when making <4kb read on ssd,
if it's a hd no problem, ssd will degrade max ssd speed with wrong
sector size (read/write not aligned)
i'm waiting the chunck size answer if you want wait the list to answer.=
=2E.
Post by Henrik Olsson
Hi,
One of the drives in my raid1 recently crashed and it looks like all
the replacement disks (2TB) i can find use 4K sectors, but the old
ones were 512 bytes.
Are there any issues with having a raid1 array with different sector
sizes for the drives?
Regards,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-raid"=
in
Post by Henrik Olsson
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
--=20
Roberto Spadim
Spadim Technology / SPAEmpresarial
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Brown
2011-02-07 13:56:04 UTC
Permalink
Post by Henrik Olsson
Hi,
One of the drives in my raid1 recently crashed and it looks like all
the replacement disks (2TB) i can find use 4K sectors, but the old
ones were 512 bytes.
Are there any issues with having a raid1 array with different sector
sizes for the drives?
Regards,
Henrik
I can't answer for sure, but I would think there would be no problem as
long as you make sure your partitions are 4 KB aligned. AFAIUI, Linux
always writes in 4K blocks to the disks anyway, so alignment is the only
issue - and that's a performance issue, not a correctness one.


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...