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:
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.
sudo mdadm --detail --scan command gives:
ARRAY /dev/md1 metadata=
/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 HOMEHOST # instruct the monitoring daemon where to send mail alerts MAILADDR firstname.lastname@example.org # definitions of existing MD arrays
blkid /dev/md1 also gives no output and
mdadm --examine /dev/sdf gives:
mdadm: ARRAY line /dev/md1 has no identity information. /dev/sdf: MBR Magic : aa55 Partition : 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