reconnect raid5 device after reinstall ubuntu server
I created a soft raid5 array (4 hard drives) in ubuntu 9.04 server and wanted to test if my server crashes due to hardware failure (I use an old computer as a file server) I can reuse the raid device after reinstall the ubuntu server back on, but I've been having troubling getting the raid5 device, /dev/md0 to mount and recover the data back. I'd like to make sure I can recover the data before I commit to add more important data to the raid5 array. Any expert in mdadm please help.
I create raid5 using mdada:
sudo mdadm –create –verbose /dev/md0 –level=5 –raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
and I did format the partition:
sudo mkfs -t ext3 /dev/md0
created a mount point:
and edit fstab:
sudo edit /etc/fstab with following line
/dev/md0 /media/samba ext3 defaults 0 3
Now the raid5 device works fine in the current environment. But I wanted to make sure when the server crash due to hardware problem and I have to reinstall the server again, I'd be able to recover the data from the raid5 array, but I have been stuck here. Everytime I try to reinstall server, either Ubuntu server 8.10 or Ubuntu 9.04 server, I can assemble the array:
sudo mdadm --assemble --scan
and I got this added to the /etc/mdadm/mdadm.conf
ARRAY /dev/md0 level=raid5 num-devices=4 UUID=15181fa0:e0b47e28:b62cfa25:81e9a18b
which is the the correct UUID. However, I can't mount the array, it says mount: wrong fs type, bad option, bad superblock on /dev/md0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
unless I format the raid5 array again, then it let me mount the device, but that mean I'd loose all my data. Would anyone who has experience with this like to share their knowledge?
Last edited by albengy; 08-18-2009 at 11:45 AM.