0

I had a very simple RAID0 set up with just two disks, and it was assembling fine for a long time after rebooting.

Then suddenly it is not loading anymore.

mdadm.conf:

DEVICE partitions

ARRAY /dev/md0 level=raid0 num-devices=2 metadata=1.2 name=simernes:0 UUID=xxxxxxxx:xx1337xx:xxxxxxxx:xxxxxxxx devices=/dev/sda,/dev/sdc

What could be the reason for this happening, and how should I start troubleshooting?

I've seen in some old posts people referencing a mdadm service, but there is no such service found on my computer (Fedora 31).

$ sudo systemctl status mdadm
Unit mdadm.service could not be found.

1 Answer 1

1

I can see that you did not create a partition table before creating the RAID. I have the same issue in one of the server with same setup. You can try reassemble the RAID by using "assume clean". I do it every time when the server reboot.

sudo mdadm --create --assume-clean --level=0 --raid-devices=2 /dev/md0 /dev/sda /dev/sdc --run

If you wish to read more before doing this, refer to RAID Recovery

6
  • On a sidenote, do you think it's a good idea to reference the disks with /dev/sd* or should I preferably use some sort of UID?
    – simernes
    Feb 21, 2020 at 15:24
  • 1
    This is a good question. AFAIK The mdam recognizes the disks by reading the superblock from each disk, so it is safe to create a RAID array with /dev/sd*, and reassemble it in the same way if nothing changed in the server. In the event that the identifier has changed, you most likely couldn't assemble the RAID since the superblock is missing (I used 'most likely' because I never test it, but in theory it should work that way). By then you will need to run mdadm --detail --scan to scan and identify the RAID members.
    – teclinux
    Feb 21, 2020 at 15:48
  • This seems to have worked at least in restoring the raid, but there are no files on the raid now anymore. I expected something like this to happen, so I didn't have any important data on the raid. Are you saying that I should have created a partition table first before creating the raid?
    – simernes
    Feb 24, 2020 at 12:34
  • 1
    Have you tried putting in the metadata=1.2 and try again? Also, just make sure you put in the right device. I can see u skipped sdb, and only use sda and sdc. Hope that is intended and not a typo. Yes, always create a partition table first before configure a RAID.
    – teclinux
    Feb 24, 2020 at 12:38
  • So the files actually started showing up after a while, even without the metadata=1.2. If you have some information available on the subject, could you direct me to how I should go about creating a partition table in this manner?
    – simernes
    Feb 25, 2020 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.