0

I have four drives from a Buffalo Terastation NAS. My understanding is that the Terastation either uses mdadm for RAID or is at the very least compatible with it.

I've take my drives and cloned each one with dd, and now I'm trying to re-create my raid from the dd images.

If I look at each of my images I get the following information:

[me@workstation ~]$ sudo fdisk -l /dev/loop0p1
Disk /dev/loop0p1: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73736572

Device         Boot      Start        End    Sectors   Size Id Type
/dev/loop0p1p1      1920221984 3736432267 1816210284   866G 72 unknown
/dev/loop0p1p2      1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/loop0p1p3               0          0          0     0B  0 Empty
/dev/loop0p1p4        27722122   27722568        447 223.5K  0 Empty

Partition table entries are not in disk order.


[me@workstation ~]$ sudo fdisk -l /dev/loop1p1
Disk /dev/loop1p1: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73736572

Device         Boot      Start        End    Sectors   Size Id Type
/dev/loop1p1p1      1920221984 3736432267 1816210284   866G 72 unknown
/dev/loop1p1p2      1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/loop1p1p3               0          0          0     0B  0 Empty
/dev/loop1p1p4        27722122   27722568        447 223.5K  0 Empty

Partition table entries are not in disk order.

[me@workstation ~]$ sudo fdisk -l /dev/loop2p1
Disk /dev/loop2p1: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73736572

Device         Boot      Start        End    Sectors   Size Id Type
/dev/loop2p1p1      1920221984 3736432267 1816210284   866G 72 unknown
/dev/loop2p1p2      1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/loop2p1p3               0          0          0     0B  0 Empty
/dev/loop2p1p4        27722122   27722568        447 223.5K  0 Empty

Partition table entries are not in disk order.

[me@workstation ~]$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x734de3f1

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   1026047   1024000   500M  7 HPFS/NTFS/exFAT
/dev/sda2       1026048 976771071 975745024 465.3G  7 HPFS/NTFS/exFAT

If I use mdadm to examine them I get the following:

[me@workstation ~]$ sudo mdadm --examine  /dev/loop0p1
/dev/loop0p1:
   MBR Magic : aa55
Partition[0] :   1816210284 sectors at   1920221984 (type 72)
Partition[1] :   1953653108 sectors at   1936028192 (type 6c)
Partition[3] :          447 sectors at     27722122 (type 00)


[me@workstation ~]$ sudo mdadm --examine  /dev/loop1p1
/dev/loop1p1:
   MBR Magic : aa55
Partition[0] :   1816210284 sectors at   1920221984 (type 72)
Partition[1] :   1953653108 sectors at   1936028192 (type 6c)
Partition[3] :          447 sectors at     27722122 (type 00)


[me@workstation ~]$ sudo mdadm --examine  /dev/loop2p1
/dev/loop2p1:
   MBR Magic : aa55
Partition[0] :   1816210284 sectors at   1920221984 (type 72)
Partition[1] :   1953653108 sectors at   1936028192 (type 6c)
Partition[3] :          447 sectors at     27722122 (type 00)


[me@workstation ~]$ sudo mdadm --examine /dev/sda
/dev/sda:
   MBR Magic : aa55
Partition[0] :      1024000 sectors at         2048 (type 07)
Partition[1] :    975745024 sectors at      1026048 (type 07)

The last disk (/dev/sda) is actually not an image its the original physical disk that was in the array but I provided that information to give you an idea of what the disk originally looked like.

The array was in a RAID5 configuration and had an NTFS partition on it. I'm by no means an MDADM expert I'm simply trying to fuss around with it to (hopefully) recover my data.

Unfortunately I do not have backups of this data (lesson learned). That said, the data on this drive would be nice to have but the world won't come to an end if it is lost.

So my question is how can I re-create my RAID array using MDADM and access my data again? Or can I? Am I totally hosed? :) Any help would be appreciated.

Thank You, Brad


UPDATE

With the help of @DerfK I am now seeing the following:

[me@worstation ~]$ sudo mdadm --create /dev/md0 --assume-clean --level=5 --verbose --chunk=64 --raid-devices=4 --metadata=0.90 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3
mdadm: layout defaults to left-symmetric
mdadm: /dev/loop0 appears to be part of a raid array:
       level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: partition table exists on /dev/loop0 but will be lost or
       meaningless after creating array
mdadm: /dev/loop1 appears to be part of a raid array:
       level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: partition table exists on /dev/loop1 but will be lost or
       meaningless after creating array
mdadm: /dev/loop2 appears to be part of a raid array:
       level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: partition table exists on /dev/loop2 but will be lost or
       meaningless after creating array
mdadm: /dev/loop3 appears to be part of a raid array:
       level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: partition table exists on /dev/loop3 but will be lost or
       meaningless after creating array
mdadm: size set to 488386496K
mdadm: automatically enabling write-intent bitmap on large array
Continue creating array? n
mdadm: create aborted.

I'm not sure why MDADM is picking this up as RAID0 instead of RAID5.

I was also able to connect the devices back up to the terastation array and I see the following information:

~# /sbin/mdadm --misc --detail /dev/md0
/dev/md0:
        Version : 00.90.00
  Creation Time : Mon Nov 15 22:02:27 2004
     Raid Level : raid1
     Array Size : 385408 (376.38 MiB 394.66 MB)
    Device Size : 385408 (376.38 MiB 394.66 MB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Thu Oct 27 15:45:24 2016
          State : active, degraded, recovering
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

 Rebuild Status : 36% complete

           UUID : 255e2f38:69d2ef57:dd46a9d4:ed86dcee
         Events : 0.3522

    Number   Major   Minor   RaidDevice State
       0       0        0        0      faulty removed
       1      22        1        1      active sync   /dev/hdc1
       2       0        0        2      faulty removed
       3      34        1        3      active sync   /dev/hdg1

One of the disks in the array is failed, another is partially failing. What I mean by that is that sometimes it will read and sometimes it won't read. Thus I used dd to image it but... not sure if that dd image would be valid or not :(

Here's also a screenshot from the terastation webUI:

Terastation Web UI

  • What command did you use to take the original image? dd if=/dev/sda of=/some/file? What command did you use to get the image mounted to /dev/loop# and what did you do to cause the kernel to partition it /dev/loop#p#? – DerfK Nov 21 '16 at 22:40
  • To image the disks: sudo dd if=/dev/sda of=/disks/disk1.img conv=noerror,sync bs=512 sudo dd if=/dev/sda of=/disks/disk2.img conv=noerror,sync bs=512 sudo dd if=/dev/sda of=/disks/disk3.img conv=noerror,sync bs=512 sudo dd if=/dev/sda of=/disks/disk4.img conv=noerror,sync bs=512 As far as mounting: I used the gnome disk utility 3.20.2 to mount the image (via GUI) so not sure how that mounted them. – Brad Nov 21 '16 at 22:52
  • 1
    Undo the gnome disk utility thing. Then manually assign the first image to a device eg sudo losetup /dev/loop0 /disks/disk1.img then try mdadm --examine /dev/loop0. Does it look like /dev/sda originally looked? – DerfK Nov 22 '16 at 0:51
  • Yes it does. When I try to create a RAID using: [me@workstation ~]$ sudo mdadm --create /dev/md0 --assume-clean --level=5 --verbose --chunk=64 --raid-devices=4 --metadata=0.90 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 – Brad Nov 22 '16 at 1:24
  • I get: mdadm: layout defaults to left-symmetric mdadm: /dev/loop0 appears to be part of a raid array: level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969 mdadm: partition table exists on /dev/loop0 but will be lost or meaningless after creating array mdadm: /dev/loop1 appears to be part of a raid array: level=raid0 devices=0 ctime=Wed Dec 31 19:00:00 1969 mdadm: partition table exists on /dev/loop1 but will be lost or meaningless after creating array mdadm: cannot open /dev/loop2: No such file or directory – Brad Nov 22 '16 at 1:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.