Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently made a soft RAID. However, I faced the situation when I have RAID without UUID, because I used --build command instead of usual --create, by the reason that correct mdadm arrays are not readable under Windows. This makes me BIG problem, because mdadm config supports only arrays described by UUIDs. Moreover, directory /dev/disk/by-uuid does not contain links to my RAID drives and I have to access them through /dev/disk/by-id, because their drive names change on each system startup: sdh becomes sdf, sdi becomes sdg and vice-versa.

Now I have to execute this after every startup:

sudo mdadm --build --chunk=64K /dev/md1 --level=0 --raid-devices=2 /dev/disk/by-id/scsi-SATA_Hitachi_HDS7220_JK11A8B9J8X1HF /dev/disk/by-id/scsi-SATA_Hitachi_HDS7230_MN1221F30976BD
sudo mount /dev/md1p2 /media/Extframe

I'd like to run this command automatically on boot and before mount -a executes. How can I achieve this? It seems to me that putting those lines in /etc/rc.local not the right choice, because it starts but doesn't mount.

The sudo mdadm --detail --scan command gives:

ARRAY /dev/md1 metadata=

Also /usr/share/mdadm/mkconf gives such output:

# mdadm.conf
# Please refer to mdadm.conf(5) for information about this file.

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system

# instruct the monitoring daemon where to send mail alerts
MAILADDR hopungo@gmail.com

# definitions of existing MD arrays

The blkid /dev/md1 also gives no output and mdadm --examine /dev/sdf gives:

mdadm: ARRAY line /dev/md1 has no identity information.
   MBR Magic : aa55
Partition[0] :   4294967295 sectors at            1 (type ee)

I have figured it out.

sudo apt-get install dmraid
sudo dmraid -ay -Z

This will activate all available arrays. -Z option will remove underlying devices to not to destroy data accidentally. Arrays will be available at the boot moment allowing you to boot from them. On another system I have such array (on VIA chip) and I successfully booted into Windows 8 from GRUB.

However, on the main system problem did not disappear. Here is the output of sudo dmraid -ay -Z:

hopungo@hopungo-pc:~$ sudo dmraid -ay
[sudo] password for hopungo: 
ERROR: ddf1: seeking device "/dev/dm-3" to 18446744073709421056
ERROR: hpt37x: seeking device "/dev/dm-3" to 4608
ERROR: hpt45x: seeking device "/dev/dm-3" to 18446744073709547008
ERROR: isw: seeking device "/dev/dm-3" to 18446744073708469760
ERROR: sil: seeking device "/dev/dm-3" to 18446744073709289984
RAID set "pdc_baijcbgej" already active
RAID set "pdc_baijcbgej1" already active
RAID set "pdc_baijcbgej2" already active
RAID set "pdc_baijcbgej5" already active
RAID set "pdc_baijcbgej6" already active
share|improve this question
If I understand your linked thread correctly, you used mdadm --build instead of the usual mdadm --create in order to construct the array without destroying existing data on the disks. However you also commented there that you did in fact end up destroying the data - so is there really any good reason not to start over and use --create this time? That will allow the array to be assembled automatically at boot time using the in-partition metatdata. –  steeldriver Sep 11 '13 at 12:06
Your array seems not to be created correctly as steeldriver says. –  gertvdijk Sep 11 '13 at 13:00
@steeldriver, yep, but it then would not be accessible in Windows, so I recreated it there, copied saved data and built it again with --build. I'd like to see answer about how build it on boot without using --create. –  Danatela Sep 11 '13 at 15:39
@gertvdijk, such decision allowed me to use my RAID in both Windows and Ubuntu, and it was the goal. I'd like to see answer about how build it on boot without using --create. –  Danatela Sep 11 '13 at 15:44
Ah, so you're using a Silicon Image precreated RAID set in mdadm. That's calling out for issues here. You should be using dmraid instead! It has support for these fakeraid chips. See manpages.ubuntu.com/manpages/raring/en/man8/dmraid.8.html (and search for Silicon image) –  gertvdijk Sep 11 '13 at 20:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.