5

I had some raid problems where the raid5 setup in my PR4100 seems to be lost.

I tried everything and ended up manually rebuilding the raid:

mdadm --create --assume-clean --level=raid5 --raid-devices=4 /dev/md1 /dev/sd[abcd]2

Then assemble again

mdadm --assemble /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2

after that:

mount /dev/md1 /mnt/HD

But terminal says

mount: /mnt/HD: wrong fs type, bad option, bad superblock on /dev/md1, missing codepage or helper program, or other error.

Any idea?

Also, md1 doesn't get assembled on reboot. The Pr4100 doesn't seem te have a mdadm.config.

EDIT:

Output examine:

root@MyCloudPR4100 dev # mdadm --examine --scan
ARRAY /dev/md/0  metadata=1.2 UUID=2f9fcf63:311fbc6c:2ece20fd:88e3cdda name=MyCloudPR4100:0
ARRAY /dev/md/1  metadata=1.2 UUID=6cdcf758:8fcfb194:3f174806:cc46d6c6 name=MyCloudPR4100:1

The old UUID is stored on the disk in a file called HD_volume_info.xml

<config>
  <volume_info>
    <item>
      <volume>1</volume>
      <web_cmd>10</web_cmd>
      <sdx3_flag>0</sdx3_flag>
      <raid_mode>raid5</raid_mode>
      <file_type>ext4</file_type>
      <size>5577</size>
      <device>sdfsdbsdcsda</device>
      <spare/>
      <mount>/dev/md1</mount>
      <to_be_sync/>
      <used_device>/dev/sdf2 /dev/sdb2 /dev/sdc2 /dev/sda2 </used_device>
      <dev_num>4</dev_num>
      <scsi_mapping>15</scsi_mapping>
      <volume_encrypt>0</volume_encrypt>
      <raid_uuid>UUID=2d967dc8:d8e22fa2:c13058f4:b92320f0</raid_uuid>
      <scsi0_serial>sdf:WD-WCC4M6VAUJSJ</scsi0_serial>
      <scsi1_serial>sdb:WD-WCC4M4KUX9VH</scsi1_serial>
      <scsi2_serial>sdc:WD-WCC4M3TUT1DK</scsi2_serial>
      <scsi3_serial>sda:WD-WCC4M1FUE69R</scsi3_serial>
    </item>
  </volume_info>
</config>
6
  • 1
    Chances are you re-created the RAID incorrectly. In that case you shouldn't even attempt to mount it at all. Some things to look out for when using mdadm --create to recover. Do you have --examine output of your old raid array? It would help a great deal finding out the correct values for offsets etc. Commented Feb 24, 2023 at 10:58
  • Thanks @frostschutz, I updated my question Commented Feb 24, 2023 at 11:14
  • What puzzle me is the HD_volume_info.xml with /dev/sdf2, b2, c2 and a2 in this order and the creation with a2, b2, c2 and d2. I guess that something must be wrong. As the linked article pointed by frostschutz, the RAID must be created strictly identically with the previous states. Permutes two disks and you have not the same array. Commented Feb 26, 2023 at 17:20
  • I guess I did this wrong? Any way to revert back and create the raid with the previous settings? Commented Feb 27, 2023 at 11:27
  • @frostschutz did you get my mail? Commented Feb 28, 2023 at 16:18

1 Answer 1

0

Late to the party here but if you still need help I've worked on data recovery cases like this in the past after a mistaken mdadm --create has been performed.

Briefly stated you can use a brute force method that tries all possible RAID parameter combinations like drive order, chunk size, etc. until the right combination is arrived upon and the data can be accessed.

4
  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
    – dr_
    Commented Jun 29, 2023 at 12:17
  • Can you elaborate? How did you do it? Commented Jul 3, 2023 at 12:51
  • It's not easy, the way I do it is via a sample file. That is take a copy of a file that is known to exist on the failed NAS. Then hex search for the sample file contents on each NAS drive. With the hex location of the sample then try assembling the RAID5 using different RAID5 config parameters. On each try you search for an exact match to the sample. When you find the RAID config that gives a sample file match then the RAID5 is assembled correctly and the case turns into a filesystem recovery case which is a much easier task.
    – S.Haran
    Commented Jul 3, 2023 at 16:44
  • I wrote a bunch of shell scripts to automate this tedious time consuming process but it is still a bit of work.
    – S.Haran
    Commented Jul 3, 2023 at 16:52

You must log in to answer this question.

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