0

I have created an md array like so:

mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdc /dev/sdd

Then I used the resulting device in a ZFS pool:

zpool attach tank sdb md0

That worked great. ZFS was happy, I was happy.

Now after rebooting the system the md0 device was gone and I don't know how to bring it back. I recreated and resilvered it once, only to face the same situation after reboot.

I am booting my system off of another ZFS pool, but I mount directories from the one I want to attach this device as a mirror to. I'd like that array to come online during boot so ZFS can find it.

I tried doing so with mdadm.conf, but I can't really understand how to set this up. I thought that maybe creating an array would save it's configuration there so it will persist between reboots, but looks like that's not the case.

When I try to recreate the array I get this:

# mdadm --create tank-mirror --level=0 --raid-devices=2 /dev/sdc /dev/sdd
mdadm: /dev/sdc appears to be part of a raid array:
       level=raid0 devices=0 ctime=Thu Jan  1 01:00:00 1970
mdadm: partition table exists on /dev/sdc but will be lost or
       meaningless after creating array
mdadm: /dev/sdd appears to be part of a raid array:
       level=raid0 devices=0 ctime=Thu Jan  1 01:00:00 1970
mdadm: partition table exists on /dev/sdd but will be lost or
       meaningless after creating array
Continue creating array?

I guess that tells me md should be able to bring this array online after reboot, so I'm not sure why it doesn't do that. It's probably dead simple.

However when I do mdadm --assemble --scan I get:

mdadm: No arrays found in config file or automatically  

PS: Original question this one popped out form: How to attach a 2-device striped mirror to a pool?

  • 1
    I think I migth have just found the answer here: superuser.com/questions/287462/… – unfa Mar 7 '18 at 0:15
  • 1
    Not really related to your question, but why would you layer ZFS on top of a RAID0 of two devices? ZFS would probably be better off if you had directly added those devices. I don't see how having MD would do anything of value for you here. BTW, RAID0? You know that is the level that is the most likely to result in a total loss of everything right? – Zoredache Mar 7 '18 at 1:08
  • All of that is discussed in the original question this one emerged from (link is on the bottom). Shorty: I have a single-vdev pool on a 2 TB drive and I have two 1TB drives. I wanted to use the 1TB drives as a mirror in that pool, but I can't do that without using md to expose a single device to ZFS. I know it's less than optimal, I know it might fail, it's not a life or death situation and I prefer to have some redundancy in the pool rather than no redundancy, even if it might fail. I use a separate drive to backup the dataset anyway. – unfa Mar 7 '18 at 12:36

Your Answer

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

Browse other questions tagged or ask your own question.