1

English is not my first language, so sorry in advance for any grammar errors.
A partner configured a raid 5 of raids 0 with mdadm (I did not wanted to put the data on any thing that was not one of the default configurations). Here are the basic commands he used:

mdadm --create --verbose /dev/md11 --level=0 --raid-devices=2 /dev/sdb /dev/sdc
mdadm --create --verbose /dev/md12 --level=0 --raid-devices=2 /dev/sdd /dev/sde
mdadm --create --verbose /dev/md13 --level=0 --raid-devices=2 /dev/sdf /dev/sdg
mdadm --create --verbose /dev/md14 --level=0 --raid-devices=2 /dev/sdh /dev/sdi
mdadm --create --verbose /dev/md15 --level=0 --raid-devices=2 /dev/sdj /dev/sdk
mdadm --create --verbose /dev/md5 --level=5 --raid-devices=5 /dev/md11 /dev/md12 /dev/md13 /dev/md14 /dev/md15
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

After a server reboot the raid was not rebuild.

This is the /etc/mdadm/mdadm.conf file:

ARRAY /dev/md3 metadata=0.90 UUID=0a820b7d:49f63cdd:a4d2adc2:26fd5302
ARRAY /dev/md2 metadata=0.90 UUID=2fe084f0:e0a7b781:a4d2adc2:26fd5302
ARRAY /dev/md11 metadata=1.2 name=PostgresMain:11 
UUID=47f54c97:58c905d5:c09c5a80:2d1dcdd7
ARRAY /dev/md12 metadata=1.2 name=PostgresMain:12 
UUID=95587959:f50147c1:3a3f7458:fa308077
ARRAY /dev/md13 metadata=1.2 name=PostgresMain:13 
UUID=8c99c82a:a9ada5df:af25626d:5a5356fd
ARRAY /dev/md14 metadata=1.2 name=PostgresMain:14 
UUID=92a99a99:47e18be4:1734c0d3:b13806ef
ARRAY /dev/md15 metadata=1.2 name=PostgresMain:15 
UUID=01d3b8b9:da2c6924:39abd96b:fd0bd6e6
ARRAY /dev/md5 metadata=1.2 spares=1 name=PostgresMain:5 
UUID=a2915206:fd364e54:210972b3:694cdf77
ARRAY /dev/md0 metadata=1.2 name=PostgresMain:0 
UUID=abf769d3:792cba00:193ab174:1baccc38

Please ignore the other devices is just the ones that belong to the RAID5, that is: md11 to md15 and the RAID 5 itself: md5

Some extra information: cat /proc/mdstat Personalities : [raid1] [raid0] [raid6] [raid5] [raid4] [linear] [multipath] [raid10] md3 : active raid1 sda3[0] 3748952384 blocks [12/1] [U___________]

md2 : active raid1 sda2[0] 523200 blocks [12/1] [U___________]

Clearly the RAID5 is not there.

From this article mdadm disappears after reboot I try to do the scan, and as expected from /proc/mdstat the Raid5 is not there:

mdadm --detail --scan
ARRAY /dev/md2 metadata=0.90 UUID=2fe084f0:e0a7b781:a4d2adc2:26fd5302
ARRAY /dev/md3 metadata=0.90 UUID=0a820b7d:49f63cdd:a4d2adc2:26fd5302

From the same article he never run update-initramfs -u.

I try to reassemble the raid using the command:
mdadm --assemble /dev/md5 --uuid a2915206:fd364e54:210972b3:694cdf77

It does not display any error but it does not build the device (notice that I id try to build one of the raid 0 devices and it did not work either). With verbose I get:

mdadm: looking for devices for /dev/md5
mdadm: no recogniseable superblock on /dev/md3
mdadm: no recogniseable superblock on /dev/md2
mdadm: cannot open device /dev/sr0: No medium found
mdadm: no recogniseable superblock on /dev/sdk1
mdadm: Cannot assemble mbr metadata on /dev/sdk
mdadm: no recogniseable superblock on /dev/sdl1
mdadm: Cannot assemble mbr metadata on /dev/sdl
mdadm: no recogniseable superblock on /dev/sdj1
mdadm: Cannot assemble mbr metadata on /dev/sdj
mdadm: no recogniseable superblock on /dev/sdi1
mdadm: Cannot assemble mbr metadata on /dev/sdi
mdadm: no recogniseable superblock on /dev/sdg1
mdadm: Cannot assemble mbr metadata on /dev/sdg
mdadm: no recogniseable superblock on /dev/sdh1
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: no recogniseable superblock on /dev/sdf1
mdadm: Cannot assemble mbr metadata on /dev/sdf
mdadm: no recogniseable superblock on /dev/sde1
mdadm: Cannot assemble mbr metadata on /dev/sde
mdadm: no recogniseable superblock on /dev/sdd1
mdadm: Cannot assemble mbr metadata on /dev/sdd
mdadm: no recogniseable superblock on /dev/sda5
mdadm: /dev/sda3 has wrong uuid.
mdadm: /dev/sda2 has wrong uuid.
mdadm: Cannot assemble mbr metadata on /dev/sda1
mdadm: Cannot assemble mbr metadata on /dev/sda
mdadm: no recogniseable superblock on /dev/sdc1
mdadm: Cannot assemble mbr metadata on /dev/sdc
mdadm: no recogniseable superblock on /dev/sdb1
mdadm: Cannot assemble mbr metadata on /dev/sdb
mdadm: no recogniseable superblock on /dev/loop5
mdadm: no recogniseable superblock on /dev/loop4
mdadm: no recogniseable superblock on /dev/loop3
mdadm: no recogniseable superblock on /dev/loop2
mdadm: no recogniseable superblock on /dev/loop1
mdadm: no recogniseable superblock on /dev/loop0

I don't want to loose any data. Will it be safe to run each one of the creation commands and then run mount and then run update-initramfs -u? The devices appear to have the metadata:

mdadm --examine /dev/sdk
/dev/sdk:
MBR Magic : aa55
Partition[0] :   4294967295 sectors at            1 (type ee)
jkl
  • 11
  • 1
  • I found this that appears to indicate that is almost safe to run the commands in the same order with the same parameters: https://serverfault.com/questions/347606/recover-raid-5-data-after-created-new-array-instead-of-re-using/347786#347786 – jkl May 27 '19 at 23:04

0 Answers0