mdadm: Cannot add disks to a 'member' array, perform this operation on the parent container

  • Hi OMV Support Team,


    My Nas is currently running with OMV6 on a separate SSD and Data on a Raid5 with 4x 2Tb.

    It is full at 82%, so I decided not to wait the last minute to upgrade and replace my disks to 4x 5Tb.


    I removed the 1st 2Tb disk from the Nas and copied the partition on the 1st 5Tb with GParted on another computer.

    On the 5Tb there was no formated partition.

    I successfully cloned/copied the 2Tb partiton to the 5Tb disk: of course only 2Tb is used.....I want to resize it later.

    I wanted to try my cloned disk by putting it into the 2Tb disk, I didn't knew that I had to 1st go the disk management menu and remove the 2Tb.

    Which has for consequence to show my raid5 as clean/degraded.

    Of course the new disk was detected in the Disk menu, but in the Raid menu/ recovery, I could not select it....because not erased/cleaned.

    - Then I put back the original 2Tb at its location, but the Raid was still displayed as clean/degraded.

    - I tried to recover it, but could not select it.

    - So I deleted it under the Disk menu, now in the Raid/Recovery menu I can select it but when I click save to execute the recovery, it returns me the following error message:

    mdadm: Cannot add disks to a 'member' array, perform this operation on the parent container


    See also the attached image below.


    It returns the same message when i try in CLI:


    root@wd-omv:~# cat /proc/mdstat

    Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]

    md126 : active raid5 sdc[2] sdd[1] sde[0]

    5860536320 blocks super external:/md127/0 level 5, 64k chunk, algorithm 0 [4/3] [_UUU]


    md127 : inactive sde[3](S) sdb[2](S) sdc[1](S) sdd[0](S)

    9568 blocks super external:imsm


    unused devices: <none>


    root@wd-omv:~# fdisk -l | grep "Disk "

    Disk /dev/sdc: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors

    Disk model: WDC WD2000F9YZ-0

    Disk /dev/sda: 111,79 GiB, 120034123776 bytes, 234441648 sectors

    Disk model: KINGSTON SA400S3

    Disk identifier: 66C03338-D551-4160-A0E7-225F99E7DD16

    Disk /dev/sde: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors

    Disk model: WDC WD2000F9YZ-0

    Disk /dev/sdd: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors

    Disk model: WDC WD20EARS-42S

    Disk /dev/sdb: 1,82 TiB, 2000398934016 bytes, 3907029168 sectors

    Disk model: WDC WD2000F9YZ-0

    Disk /dev/md126: 5,46 TiB, 6001189191680 bytes, 11721072640 sectors

    Disk /dev/loop0: 49,84 MiB, 52260864 bytes, 102072 sectors

    Disk /dev/loop2: 49,84 MiB, 52260864 bytes, 102072 sectors

    Disk /dev/loop3: 55,61 MiB, 58310656 bytes, 113888 sectors

    Disk /dev/loop1: 10,66 MiB, 11182080 bytes, 21840 sectors

    Disk /dev/loop4: 55,61 MiB, 58314752 bytes, 113896 sectors

    root@wd-omv:~# mdadm --detail --scan --verbose

    ARRAY /dev/md/imsm0 level=container num-devices=4 metadata=imsm UUID=8ff3cce2:34c9c3d5:edb2ce61:d6ae4cc5

    devices=/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde

    ARRAY /dev/md/Volume0 level=raid5 num-devices=4 container=/dev/md/imsm0 member=0 UUID=a0a6b7ac:570dc38b:4e516081:0ae75967

    devices=/dev/sdc,/dev/sdd,/dev/sde


    root@wd-omv:~# mdadm --add /dev/md126 /dev/sdb

    mdadm: Cannot add disks to a 'member' array, perform this operation on the parent container


    I'm not an expert, so that's why I need your support and would to know how to "perform this operation on the parent container"

    Or any other way to fix it and recover one of those 2 disks into the Raid5 array.

    Best Regards


    Youness

  • Youns

    Added the Label OMV 6.x
    • Official Post

    Well that's a mess, never seen anything like this before, kudos to you for having a go at upgrading the drives but in hindsight, which is great thing you would have better served asking in here :)


    What I think you have done is nested an array within an array, how I don't know but this -> "I removed the 1st 2Tb disk from the Nas and copied the partition on the 1st 5Tb with GParted on another computer" was the first error. I understand why you did it, it makes sense, but that is not the way to upgrade your drives within mdadm. TBH I have no idea how to get out of this :/


    The array is currently in a clean/degraded state (or one of them is or something is) do you have a backup?

    How much data is on the array?

    You say you are replacing with 5TB drives surely you mean 6TB?


    Post the output of the following;


    mdadm --detail /dev/md126

    mdadm --detail /dev/md127 please the code box </> on the thread menu to paste the results makes it easier read.


    Looking at the output of cat /proc/mdstat I am assuming that /dev/md127 is the actual array, two reasons;

    1) It's inactive

    2) mdadm determines whether an array is local or foreign md0=local md127=foreign, but device nodes work up from md0 and down from md127, so your md126 I believe is the nested one (this is just supposition at this stage)


    The output of fdisk would also suggest, but not sure, that the /dev/loop is the remaining space or at least some of it on the current drives


    Also mdadm is software it would require some user input somewhere for that nested array to be created

    Raid is not a backup! Would you go skydiving without a parachute?


    OMV 7x amd64 running on an HP N54L Microserver

  • I never liked trying to upgrade an array. I always preferred to make a new one and then copy data to it. I find it much faster and less chance of things going sideways than having to replace drives one at a time, waiting for a rebuild each time one is replaced before proceeding to the next one, then doing a grow once they are all replaced. Once done, I just point any shares to the new array and remove the old one.


    To that end if I were you, if you don’t have enough sata ports to do this, I would put a cheap $30-$50 multi-port sata card in the system, hook up the new drives to it, build the new array then rsync the data from the old one to the new one. Based on your comment above, it sounds like you can still see the data since it is raid 5 with one drive missing, so you should have no issues copying the data. You can leave the sata card in for more ports if you need them or just keep it around as a tool for the next time you have to do this.

  • Hi Gaeves and BernH,


    Thank for your fast replies.


    Here are the answer to your questions:


    - Yes, I still have access to my data.

    - My data on the array takes 4.38Tb: around 600Gb are important personal data that I'm currently backuping over a remote 1Tb drive( remaining 3 hours over 23 ) and the rest are movies (less critical) that I can also backup later on another spare Drive of 4Tb (but that would take forever to copy and restore them later : any faster method you would know is welcome )

    - for the upgrade I've prepared 4disks: 2x5Tb and 2x6Tb like in the picture below, which means that it's like 4x 5Tb....no? except that I missed something.


    Here is the output of:


    and

    As we can see the sdb drive is in the md127 array..... as you said, it looks like md127 (container) is nested in md126.....how is it possible????

    I never had that md127 array before. Only had md126.

    Code
    sudo fdisk -l

    returns:

    Questions:


    I my case what would I had to do to upgrade my nas properly and easlily?

    apparently not cloning the partitions, are those steps the proper way?


    - Removing the 1st 2Tb (sdb) drive from disk menu,

    - Removing it physiclly from the Nas,

    - Inserting in the new 5Tb,

    - Wiping it in the disk menu,

    - and finally recover the Raid array from the Raid menu,

    Is that correct?


    If there's no commands to help recovering that drive , I think that the easy way in my case would be to:


    - Backup all my data remotely like I'm currently doing,

    - Remove all the 2Tb drives from the Nas ( should I also remove them from the disk menu first?),

    - Insert the new drives in the Nas,

    - Wipe them from the Disk menu,

    - Then?????? ,

    - Recover the md126 array???? Are those 2 arrays md126 and md127 will still be present?,

    - Or just wait a new array to be generated then restore my data back,

    - ????


    Please confirm,



    For my personal knowledge: why cloning then expanding the partitions is not working? is it because I have Raid5 or it just don't work anyway?

    I've read online that some people used that method to upgrade their Nas.....


    Best Regards


    Youness

    • Official Post

    My data on the array takes 4.38Tb:

    Well that's a bonus


    I'm going to answer your questions before I make a suggestion on how you should proceed

    for the upgrade I've prepared 4disks: 2x5Tb and 2x6Tb like in the picture below, which means that it's like 4x 5Tb....no

    Yes, the array would be built upon the smallest drive within the array

    I my case what would I had to do to upgrade my nas properly and easlily

    Sorry there is no easy way, I am more concerned about preserving your data initially

    As we can see the sdb drive is in the md127 array..... as you said, it looks like md127 (container) is nested in md126.....how is it possible????

    Don't know never seen that before

    apparently not cloning the partitions, are those steps the proper way

    Whilst I am aware of cloning partitions within an array this is only ever down when facing a sh!t storm within a non functioning array.


    The correct way is to fail then remove a drive from the array, that means using mdadm --fail then mdadm --remove, that way mdadm knows what is happening, it's software it has to have instruction. You then add a new drive and allow the array to rebuild, you do this for each drive that you want to replace.


    Downside to this procedure, which has been performed more than once on the forum, is a drive physically failing during one of the rebuilds, this has also happened on the forum.

    _________________________________________________________________________________________________________________


    This is how I would approach this, you're not going to like it :) -> reinstall


    Remove the drive /dev/sdb from the server, make sure it's that drive, leaving the array in clean/degraded state, install one of the 6TB wipe it then add an ext4 filesystem.

    Once complete use rsync to copy the data to that 6TB drive, I use rsync but you'll need to perform this from the root of that array to the 6TB (if you do this I can tag someone to help) this can be done from the GUI.


    When rsync is complete disconnect all data drives and reinstall OMV, update, set time etc, then connect the 2x5TB and the remaining 6TB create an array with those 3 drives add a filesystem, shutdown, connect the 6TB with the data on it and rsync it back to the new array. You'll then have to set your shared folders etc.

    Once that's done wipe that 6TB drive using secure then grow the array with that drive giving you the 4 new drives.


    OK I can see you now saying.......no way!!! and I fully understand that, but this is the safest and cleanest way of doing this, trying to sort your current mess is far riskier, one wrong command and your going to be doing that anyway.

    I can't even set this up in a VM to try and work out how to resolve it because I simply don't know how it happened

  • Geaves,


    Personal data are backup-ed so far on a spare 1Tb drive and currently backuping the rest on a remote 4Tb drive: 24hours remains over 61hours....

    just copied them, not used rsync.

    This is how I would approach this, you're not going to like it :) -> reinstall

    Should I really reinstall?

    Because as I've wrote it in my first post, my OMV install is running from a separate ssd (a 5th drive: sda), only data and shares are located on the 4 normal drives (sdb to sde).

    I think that I won't have to reinstall, and I would proceed like so, after reinserting the 4 new drives:

    - wipe them from Disk menu,

    - generate a new array from Raid menu,

    - Add new shares folders named like in the old config,

    - then Depending of the name of the new array that would have been freshly generated (md0, mdxx) replace(or not) that name in the shares mapping paths everywhere needed (OMV interface, containers config and so....) to point the new shared folders.

    - Restore the data from remote Drives.


    Et Voila!!!! :)


    It's possible to proceed like that...No?


    Regards


    Youness

  • If you are taking a backup and intend to restore, then no you shouldn't have to re-install, if there is nothing wrong with the installation to have caused the nested array state. If you wipe the disks and re-create the arrays, make sure it is not nested before you copy the data back.


    I think the re-install recommendation from geaves was meant to ensure there is nothing wrong with the install that would create the issue again and/or cause a problem with the in-place upgrade on the last disk that he was proposing.


    I still prefer my recommended route though since it is only one copy of the data to be made instead of two, you so have to have the available ports though.

    • Official Post

    I think that I won't have to reinstall, and I would proceed like so, after reinserting the 4 new drives

    Sounds like a plan, good for you never gave that a thought, but>>>>> :) there's always a but or an however :)


    You'll have to 'clean' your current installation and you can only do that once that data has been backed up, so to this;


    remove/delete all smb shares

    remove/delete all shared folders

    remove/delete the raid array in raid management, if the array is mounted in file systems it will have to be unmounted first before deleting the array check to ensure there is no reference to the array in file systems after it's deletion from raid management

    shutdown the server disconnect and remove the old drives, reboot, this is so you can check there are no residual parts of the previous array, even run a cat /proc/mdstat from ssh


    Why clean, because your current setup will be stored within OMV's database file


    If it all looks good then shutdown install the new drives and start again


    I'm going to take a guess as well that the cloning had something to do with the current state of the array, what, I don't know, but it's the only thing that makes sense.

    I think the re-install recommendation from geaves was meant to ensure there is nothing wrong with the install that would create the issue again and/or cause a problem with the in-place upgrade on the last disk that he was proposing

    Exactly a clean install would guarantee there was nothing left from the current setup and a clean install takes what...........30 mins, it's the setting up and updating that takes the time


    For a me a clean install and full setup takes a few hours, it's the data restore that is the most time consuming

    • Official Post

    Should I really reinstall?

    If you want you can try this. How to regenerate a complete OMV system. If you describe your system to me, I will tell you if you can have complications or not, and I can help you overcome them. I would need to know fundamentally the output of

    dpkg -l | grep openmediavault

    With that I could give you certain special instructions if necessary.

    It can save you all the time reconfiguring your system after a clean install.

    You don't really lose anything, you can do this on a new USB, if it doesn't work for any reason go back to your original system drive. And it's quick to do.

  • Hi all,


    I agree that a clean install will avoid me to have surprises....and doesn't take that long but the configuration and reinstalling all my plugins and containers (5 installed from Portainer) and configure them and all the others small things running aside will take much more time, that's why I wanted to avoid that option and reuse my current install database and as Geaves said reconfigure only the shares and the paths.


    If you want you can try this. How to regenerate a complete OMV system.

    That's interessting....

    I would need to know fundamentally the output of

    dpkg -l | grep openmediavault

    here is the output for that command:


    What else do you from me as description of my system for you to be able to help?


    Quote from geaves
    Why clean, because your current setup will be stored within OMV's database file

    There is absolutely nothing that I can keep from that database? and as I was thinking : just rename in that database what would be only necessary.


    Regards

    Youness

    • Official Post

    There is absolutely nothing that I can keep from that database

    No, especially as far as shares are concerned as the change of the raid config is going to create new UUID's

    reinstalling all my plugins and containers (5 installed from Portainer) and configure them and all the others small things running aside will take much more time

    This is where the use of Portainer stacks come in to their own, you copy and paste a stack into an editor such as notepad ++ all you do then is to change the newly created bind mounts that point to the newly created shares on the new raid setup


    What will take the time is the creation of the new raid, adding a filesystem and putting the data back

    • Official Post

    here is the output for that command:

    I have never tried a regeneration with these plugins


    openmediavault-apttool -> I don't know what exactly it does. But if they are just utilities to manage apt it shouldn't be a problem.

    openmediavault-cputemp -> You will have to install sensors again and configure it. The plugin does not.

    openmediavault-diskstats -> I don't know what exactly it does. But if it's just disk usage statistics, it shouldn't be a problem.

    openmediavault-fail2ban -> I don't know how this plugin works, but I guess it just creates rules in the frontend so it shouldn't be a problem.

    openmediavault-tftp -> No idea. I don't know how it works. In the worst case reconfigure.

    openmediavault-usbbackup -> Should not be a problem. It is similar to other disc recognition settings etc.


    It seems to me that they shouldn't cause any problems but I can't guarantee it. It's just a matter of trying. The other plugins I know will work fine.

    all the others small things running aside

    Do you have configurations done in CLI? If you have read the link you will know that they are going to disappear. You will have to redo this later.

    and containers (5)

    I don't see openmediavault-compose. Do you have containers installed on CLI and/or with Portainer?

    Any way to backup the containers database?

    Where is docker installed?

  • Hi all,


    I agree that a clean install will avoid me to have surprises....and doesn't take that long but the configuration and reinstalling all my plugins and containers (5 installed from Portainer)

    Hi, As I wrote it I installed them from Portainer, that's why I don't have openmediavault-compose.

    I like the idea of geaves to copy the stacks in notepad ++ and rearange them lon the new install.


    Docker is installed in OMV extra, see the attached capture.



    Regards


    Youness

    • Official Post

    Hi, As I wrote it I installed them from Portainer, that's why I don't have openmediavault-compose.

    Well, in your first post this was not there, you edited it while I was replying. Does not matter. The point is that you will have to reinstall them because you have them in Portainer, if you had them in openmediavault-compose it would be all automatic.

    I like the idea of geaves to copy the stacks in notepad ++ and rearange them lon the new install.

    That is precisely what openmediavault-compose does. If you have the stack of all containers I would suggest using it, after a minimal learning curve it is more useful than Portainer.

    Docker is installed in OMV extra, see the attached capture.

    That will go away. Do you have any reason to make a backup of that? Where are your container configuration volumes?

  • Hi Chente,


    -That's right that Ive udated my post to be more accurate to your question, sorry.

    -that will be the good opportunity to switch to openmediavault-compose

    -

    That will go away. Do you have any reason to make a backup of that? Where are your container configuration volumes?

    Don't understand your question sorry:

    do mean on which drive (a separate ssd sda, independate from 4 drives to replace )? or over which interface ( I use portainer ).

    But not sure that I'm answering properly to your question sorry.....

    just tell me how to have this answer: where to look or any command that I can type to help


    Regards

    Youness

    • Official Post

    Don't understand your question sorry:

    In all (or almost all) containers you will have volumes transferred to the container. The folders where you store the container's configurations, data folders for the container to access, etc.

    What I'm interested in knowing is where you have the configuration folders. I just want to make sure they aren't in / as they would be gone. If you have them on any other drive, then all is well.

    The /var/lib/docker folder is not important, unless you have some special reason, containers designed by you, etc.

    • Official Post

    I just tested the regeneration in a vm configured the same as your server. Everything has worked fine.

    You will only find the following:

    openmediavault-apttool-> If you had packages installed, they will appear in the list, but not installed. Just select and reinstall. Now I know what apttool is for :)

    openmediavault-cputemp-> You will have to reinstall lm-sensors and configure sensors

    Everything else works without a problem.


    What I did to simulate your case is to create a raid mdadm. So I diverted all shared folders to folders on another drive, you said you have one for docker, you can use that one temporarily.

    Then I copied the data with the script that you have in the last post of the thread that I told you about.

    Before regenerating, look in the config.xml of the backup for the fstab section. Select the mntent section corresponding to your Raid and delete it. It will be a section similar to this one, use the uuid to identify it.


    Make a copy before. Make sure you don't touch the spaces of other lines, it's an xml file, the spaces are important, if you touch them it will stop working.


    Follow the thread procedure. If you have doubts ask me.


    One more thing, if you copy the original /etc/passwd and /etc/shadow files you will also have your users with their respective passwords. It will only be necessary to put them in the groups in which they were in addition to users. I keep trying to perfect this procedure.


    By the way, I would take the opportunity to install docker on another disk, not in /var/lib/docker and I would also take the opportunity to start using openmediavault-compose.

    • Official Post

    I have stayed out of this thread because I am totally confused as to what is going on!!


    The total clean/new install would be my approach as I stated creating a new raid, filesystem and copying the data back is the time consumption


    But Youns #6 got my grey cells working and my #8 lays out how to go about doing that, that is simply to remove all references to the current raid setup, then remove the raid, nothing else changes within the current omv install


    Once the new raid and shared folders are running the only thing to change then are the bind mounts within any docker containers , why? because with the creation of a new array there will be the changes to the drive/raid UUID


    If a new install was initiated then the regeneration option would be a consideration, but if Youns you don't want to go down that route then any reference to the old raid setup, including the array must be removed using the GUI for the system to hopefully remain stable.

  • Hi all,

    So far I've followed the Gaeves method step by step.


    Now I've:

    - reinserted the 4 new drives,

    - cleaned/deleted them from disk menu

    - added a new Raid 5 array ( disk have been clean and synchronized.....over night)

    - added a new EXT4 File System


    But for some reason this morning my raid array is showing as Clean Degraded (edited the post sorry...) well as the new Ext4 Volume.

    I think that I had an issue with the disk sdc and it appears as "unknown" in SMART menu.

    I Disk Menu all 4 disk +ssd are present.

    see attached pictures



    Should I try to re-add an Array + FS or try a recovery.....or something else solve that?


    Regards



    forum.openmediavault.org/wsc/index.php?attachment/29555/


    forum.openmediavault.org/wsc/index.php?attachment/29558/

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!