Raid 1 to Raid 5 reshape error

  • Trying to reshape my RAID 1 to a RAID 5


    The first step is to modify the Raid 1 into a 2 disk Raid 5, and this fails:


    Code
    # mdadm -G /dev/md0 --chunk=64 -l5 -n2
    mdadm: /dev/md0: could not set level to raid5


    I also tried that with a 4k chunk. Made no difference, same error.


    dmesg (kernel log) output:


    Code
    [6917822.770378] md: md0: raid5 would not accept array


    mdadm status output:



    Can anyone shed any light on this?


    If the worst comes to the worst, I'll have to degrade the RAID-1 fail out one device, add in another, and make a new 2 disk raid-5 out of the two, copy all the data on and destroy the remaining RAID-1, followed by adding in the third disk to the RAID-5.


    I'd much much rather get this reshape to work, but the commands aren't telling me much about /why/ they're failing, only that they are.


    Appreciate any help, thanks

    • Offizieller Beitrag

    I think the version of mdadm and/or kernel version is too old in Debian Squeeze to do this conversion. You could boot from SystemRescueCD to do it.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Ah, I did wonder about that.


    I saw some postings about the code going in to mdadm at 2.6.30 for this, but yeah, the omv kernel is a bit long in the tooth.


    I'm slightly concerned about running a reshape with a newer kernel though, that the array will still be mountable by the 2.6.32 kernel in omv.


    I have Virtual Box installed on my OMV, so I'll set up an omv-in-omv with a mirror configuration, and try it out on there first.


    Thanks for the suggestion.



    Update:


    In my virtual mini-OMV, I set it up and the reshape worked.


    The difference is, My configuration builds md0 on top of partitions, whereas OMV builds them on whole-disk devices.


    I used partitions to equalize the number of blocks between hard drives from different vendors who are nominally 2.0TB


    If I build my virtual OMV with a RAID using partitions, I get the same error.


    So now I'll try a rescue CD and see if I can reshape with that, without losing my virtual data, before risking my real data.

  • Edit:


    It's the partition that did it, because the partition is not a multiple of 4K, so RAID5 won't accept it at all.


    I'm going to have to


    1) shrink the fs by a small amount


    2) shrink the array by the same


    3) reshape to 2 disk RAID 5


    4) add the new RAID 5 member to go to 3 disk RAID 5.


    On a live system :/



    Edit:


    Just run through that whole procedure on a VM and it didn't break anything.


    What I /will/ do, is add the new 2TB drive to the OMV server first, copy all the data on to that one drive. Then reshape the mirror into a 2 disk raid 5. Then I have something to fall back on if I break the array. Hopefully I won't.


    Then clear out and add the new disk to make a 3 disk raid 5. That sounds the safest.


    Sorry for wittering to myself mostly, and thanks for the help above, it did point me in the right direction.


    Hope the thread might help someone else one day. I'll add the full detail of what I did once I've done it.

  • The 2TB drives from different manufacturers have slightly different numbers of blocks, so I used partitions 'fd' type (I think - Linux Raid Autodetect) to get an exact number of blocks on each physical partition.


    Turns out, I picked a really rubbish partition size. Didn't account for the 4k divisor when I did my partitioning.


    Surely, using whole disks means you get physical disks with differing sizes? If I'd had two disks with 1,000,000 blocks on, and added a third with 999,980 blocks, that wouldn't be good either.


    Anyway, I have a plan and step 1 is to buy another 2TB disk. Which I haven't done yet.


    I will document all I do and post it up here in case it helps anyone else, but it'll be a while.

  • If you do not use partitions mdadm will identify the best usable size based on the smallest disk automatically. Nothing to worry about and no reason to use partitions for that.

    Everything is possible, sometimes it requires Google to find out how.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!