Recovering a RAID Disk

DNS-323

Many years ago I was looking for a network drive that I could attach to my home network to centrally save data. I ended up finding a D-Link DNS-323 which is a network drive that has two internal hard drives that are able to operate in either a RAID 0 (stripping without parity) or a RAID 1 (mirroring without parity). I setup the two 500 GB drives in a RAID 1 configuration essentially giving me 500 GB of storage with a full backup.

Life was good until a year or so ago when the NAS itself stopped working. I had used the drive for a variety of reasons, among them as a place to put all of our family photos. When the NAS died, I didn’t worry about it to much because it was in a RAID configuration and I figured the disks themselves were still just fine (it was only the enclosure that had problems).

Last night, I needed to finally get something off of that drive. I grabbed my handy dandy USB->SATA adapter and expected to be able to immediately give it a drive letter without problem (I was doing this on my Windows 10 partition). When I went into system management I could see the disk connected and the partition, but couldn’t actually mount it to the system. I stopped and thought for a minute and figured that the NAS was using a Linux based operating system and so it was likely formatted in EXT* format.

I went decided to go ahead and boot to my Centos partition and try if off of there. I opened up a terminal and ran the lsblk command to see where the drive was attached.

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931.5G  0 disk 
├─sda1        8:1    0   450M  0 part 
├─sda2        8:2    0   100M  0 part /boot/efi
├─sda3        8:3    0    16M  0 part 
├─sda4        8:4    0   499G  0 part 
├─sda5        8:5    0   517M  0 part 
├─sda6        8:6    0     1G  0 part /boot
└─sda7        8:7    0 430.5G  0 part 
  ├─cl-root 253:0    0   370G  0 lvm  /
  ├─cl-swap 253:1    0   7.8G  0 lvm  [SWAP]
  └─cl-home 253:2    0    50G  0 lvm  /home
sdb           8:16   0 465.8G  0 disk 
├─sdb1        8:17   0 517.7M  0 part 
└─sdb2        8:18   0   464G  0 part 
sr0          11:0    1  1024M  0 rom  

I can see that the partition I care about is attached to /dev/sdb2 so I go ahead and try to mount the partition.

mount /dev/sdb2 /mnt
mount: unknown filesystem type 'linux_raid_member'

Hhhhmmm, that’s a new one. I’ve never heard of a “linux_raid_member” file system but I figured it couldn’t be to hard to mount. A little bit of Googling introduced me to the mdadm program which is used to manage RAIDs. I went, and decided to look at the status of the drive.

mdadm --examine /dev/sdb2
/dev/sdb2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : d6ca3f5f:dc7b6b17:ce16dedc:441ce1f8
  Creation Time : Wed Jul 16 13:13:43 2008
     Raid Level : raid1
  Used Dev Size : 486544512 (464.01 GiB 498.22 GB)
     Array Size : 486544512 (464.01 GiB 498.22 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Wed Feb 21 18:39:06 2018
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 2edcfcbb - correct
         Events : 1441525


      Number   Major   Minor   RaidDevice State
this     0       8        2        0      active sync   /dev/sda2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2

Doing a little bit more reading, I discover that the system sees this RAID as /dev/md127 so I want to try and mount it to something new.

mdadm -A -R /dev/md9 /dev/sdb2
mdadm: /dev/sdb2 is busy - skipping

OK, lets just try and force it.

mdadm -A -R --force /dev/md9 /dev/sdb2
mdadm: /dev/sdb2 is busy - skipping

Because the system sees the partition as part of an active RAID (albeit one that is in a failed state because the sister drive is missing), I can mount it. I try a lot of things until finally that I can stop the RAID

mdadm --manage /dev/md127 --stop
mdadm: stopped /dev/md127

OK, making some progress now. Lets see if I can start this as a clean RAID.

mdadm --assemble --run /dev/md9 /dev/sdb2
mdadm: /dev/md9 has been started with 1 drive (out of 2).
mount /dev/md9 /mnt
ls /mnt
sa805-27-k8.bin              KS Refi Documents.pdf  recipes
 benpage2                      Liz                    Sequence 01.wmv
 BT                            Liz Current Laptop     Software
 Desktop                       Liz Laptop             sugar cookies.pdf
 Drawing1.vsd                  liz phone stuff        Taxes
 GA Listing Documents.pdf      Liz's Old Laptop       Timelapse 1.wmv
 GA Purchase.pdf               My Music               Timelapse 2.mp4
 GA Refi Documents.pdf         My Shapes              Troy
 GA Sale.pdf                   Nas_Prog               Troy and Liz Master.jpg
 Insanity Nutrition Guide.pdf  Phlearn Videos         Troy Laptop Backup
 KS Purchase Part 1.pdf        photos                 Ward Quicken
 KS Purchase Part 2.pdf        Pictures               Websites

Success!