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

Re: mdadm - two questions



Hi Kamil,

On Tue, Nov 29, 2016 at 01:26:55AM +0100, Kamil Jońca wrote:
> My first plan was somehow migrate to RAID10. I thought that is simply
> "raid0 over some raid1 arrays" so it should be legal to use 2*1TB +
> 2*1GB devices and then extend 2*1G => 2*1TB. But it not work that
> way. All devices in linux mdadm raid10 array must be the same, or I'm
> missing something.

In <[🔎] 87d1hnff79.fsf@alfa.kjonca> you said you were hoping to go from
2*1TB to 4*1TB. What's the "2*1TB + 2*1GB" you mention now?

Yes all your devices will need to be the same size. You've already
been advised of a way to go from RAID-1 to RAID-10¹, so if you
really do have a total of four 1TB drives I can't see why you can't
do that.

Your proposed solution…

> So simplest way in my case is to make second device and assign it as PV
> to VG.

…has the advantage of simplicity, and perhaps that you do not need
to reboot² (assuming hot swap insertion of new drives). But really,
if you have four identical drives that you intend to use for the
same purpose it would really be neater and perhaps more performant
to have them all in one RAID-10, wouldn't it? Data will get striped
across four devices instead of two.

If you really do need to make a separate md array and add it to your
VG, you may want to use RAID-10 on it anyway (md RAID-10 works fine
with less than four devices). It is a little bit faster than RAID-1.

The other thing you could try, if forced to use two PVs, is configure
your LVM to stripe extents across both PVs instead of just
allocating them linearly from one PV or another. That would get you
back a bit of the performance.

Cheers,
Andy

¹ Namely:

  0. Have backups in case one of the new drives encounters an error
     during step (6) below.

  1. Make a four device RAID-10 with two missing devices

  2. Copy your data from your existing RAID-1 to the new (degraded)
     RAID-10

  4. Adjust config to make new RAID-10 the real thing that's used

  5. Reboot to test it all

  6. Take a deep breath and consider that after what you're about to
     do, any kind of error on the two devices running your RAID-10
     will result in you needed to go to your backups from step
     (0).

     Kill your RAID-1 and add its devices to your RAID-10, so
     it's not degraded any more.

  7. Breathe out in relief as your data is now on a redundant array
     again.

² You don't need to reboot to go from RAID-1 to RAID-10 as already
  discussed, either, but I think I'd be a bit nervous of the machine
  not booting correctly after I had switched everything over to
  using the new (temporarily degraded) RAID-10, and so I'd want to
  test the full boot process before consigning my working RAID-1 to
  oblivion.

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: