1

I have RAID0 that was built using windows dynamic disk. I've read that this is a legacy array and can be assembled using build in mdadm. I've gotten the array to build and mount using the following commands:

sudo mdadm --build /dev/md0 --chunk=64 --level=0 --raid-devices=2 /dev/sdc1 /dev/sdb1
sudo mount -t ntfs-3g /dev/md0 /media/raid

This works great!

Now I'm working on getting this array to mount on boot. I've added the following entry to fstab:

 /dev/md0 /media/raid ntfs-3g defaults,locale=en_US.utf8 0 0

This is where my problem arises. Before md0 can be mounted though, it needs to be assembled. Everything I've read says to run the following:

sudo mdadm --detail --scan

And to put the output into mdadm.conf. However the output is:

ARRAY /dev/md0 metadata=

Since the array is legacy, it does not have a uuid or any meta-data, and mdadm can't build it solely off ARRAY /dev/md0 in the conf file.

What should I put into mdadm.conf in order for the raid to be assembled in legacy mode on boot?

2
  • 1
    I'm not sure if it can be done automatically via mdadm.conf. However you can make a script with the correct mdadm command and have it run on boot (either from /etc/rc.local or from /etc/init.d - ideally before the mounting of all filesystems start).
    – Marki555
    May 15, 2015 at 19:10
  • I added my two original commands to an init.d script and it successfully mounts now. Thanks! I am still curious if there is a way to mount a legacy raid with mdadm.
    – TheBat
    May 15, 2015 at 19:19

1 Answer 1

1

As mdadm.conf specifies arrays for assembly, it can be used only for "normal" arrays and not legacy ones. The manpage states that for legacy arrays (build mode):

This usage is similar to --create. The difference is that it creates an array without a superblock. With these arrays there is no difference between initially creating the array and subsequently assembling the array, except that hopefully there is useful data there in the second case.

So these arrays are not assembled. I guess this is because there is no way of checking if the array has been built successfully. mdadm in this case only makes the new device without care on what data are on those original devices.

The solution for you is to build the array on boot using a script in /etc/init.d (or /etc/rc.local) which will be called before all fstab filesystems get mounted.

You can try this line in mdadm.conf, but I don't think it will work: ARRAY /dev/md0 level=0 devices=/dev/sdc1,/dev/sdb1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .