0

I created a /dev/md1 raid0 across two drives, added ext4 filesystem, and it's mountable and working fine.

I created a /dev/md2 raid0 across two drives, added ext4 filesystem, and it's also mountable and working fine.

When I try to make a /dev/md0 raid1 using devices /dev/md1 and /dev/md2 it changes the filesystem to linux raid member, and cannot be mounted.

If I add ext4 to the raid1, will it overwrite the underlying raid0 data, or will it apply only to the raid1? I don't understand how the filesystem interacts with mdadm builds.

1
  • Just like you had to partition and format your raid 0, you have to partition and format your raid 1. Whatever is currently on the raid 0 volumes will be destroyed as is the case when creating any RAID. Jan 2 '19 at 15:40
1

Linux Software RAID member devices do not have filesystems, they are block devices. Once you create the RAID1 using the two underlying devices, the existing ext4 filesystems on those devices are basically not relevant.

You would only create a filesystem once, on top of the RAID1 device.

The only filesystem that would be mounted is the one on top of the RAID1 device.

2
  • So to clarify from a raid build standpoint, I thought it was possible to "add" a mirror. Assuming I am correct (please confirm, thanks) then, in this case, it's not possible to do that because there is not ALREADY an existing raid1? Something like that?
    – gboone
    Jan 2 '19 at 16:03
  • I believe "add a mirror" means add to an existing RAID1. When the RAID1 is first created it has a single member, so "add" means add the second member (and possibly a standby, etc.). Filesystems get created on top of (after) RAID devices. So for your 4 drives total, you could 1. make two RAID0 devices 2. make a RAID1 device on top of the RAID0 devices 3. create a filesystem on top of the RAID1 device.
    – Dan Stoner
    Jan 2 '19 at 20:58

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.