Replace 2nd bay hard drive on DLINK 323 NAS

Two days ago my boss send me an email he ask me to repair office NAS because one of the hard drive fail.My office have 2x2 TB Hard drive on DLINK-323 in the office, He just give me the ip address and admin password for nas storage.
Then I decide access it via ssh first, although the DNS-323 have web interfaces.
next check raid status.

root@xxxx:~# cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1]
md0 : active raid1 sda1[0] sdb1[2](F)
      24418688 blocks [2/1] [U_]



then I see [U_] that mean I have degraded RAID1 Array.
next I'm using dmesg.

root@xxxx:~# dmesg
#######################################
#              HD1 awake now !                               #
#######################################

SCSI error : <1 0 0 0> return code = 0x8000002
sdb: Current: sense key=0x3
    ASC=0x0 ASCQ=0x0
Info fld=0xa707ec94
end_request: I/O error, dev sdb, sector 2802314386
raid1: Disk failure on sdb2, disabling device.
    Operation continuing on 1 devices
raid1: sdb2: rescheduling sector 2800225936
RAID1 conf printout:
 --- wd:1 rd:2
 disk 0, wo:0, o:1, dev:sda2
 disk 1, wo:1, o:0, dev:sdb2
RAID1 conf printout:
 --- wd:1 rd:2
 disk 0, wo:0, o:1, dev:sda2
raid1: sda2: redirecting sector 2800225936 to another mirror    

Broken Hard drive on /dev/sdb,
okay after knowing the problem, then second step is read the manual, how to add/ replace hard drive on DNS-323.
you can read the manual from here
http://wiki.dns323.info/information:known_issues
after read carefully still in the same page i found this link on the section "Adding an extra disc can wipe data on existing drive!!"
http://forum.dsmg600.info/t885-OMFG,-Lost-data!-D-link-terrible!.html
and
http://forum.dsmg600.info/t3113-Arghhh.-Drive-wiped.html.

Hmm.. I found DNS-323 web gui have a bug from that forum, web gui has wrong define hard drive between right bay (hd00) and left bay(hd01). I don't wanna take a risk using web gui. anyways my boss still in vacation in Holland. After lot of searching on google,
Alhamdulillah then I found this manual http://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array.
using sfdisk commands http://linux.die.net/man/8/sfdisk.
but I cannot find sfdisk command on DNS-323. yup another problem has been found :-).

Hey I can put broken hard drive on a pc then read the partition tables using sfdisk,
then I follow the manual from "how to forge" link above, next I put broken disk on pc. dump the partition:
sfdisk -d /dev/sdb > sdb_partition_tables.out

# cat sdb_partition_tables.out
# partition table of /dev/sdb
unit: sectors

/dev/sdb1 : start=       63, size=  1060227, Id=82
/dev/sdb2 : start=  2088450, size=3902815035, Id=83
/dev/sdb3 : start=        0, size=        0, Id= 0
/dev/sdb4 : start=  1060290, size=  1028160, Id=83


then put new hard drive and import it:
sfdisk /dev/sdb < sdb_partition_tables.out

replace new hard drive, access it via ssh,check again using mdstat.


root@xxxx:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1]
md0 : active raid1 sdb2[2](F) sda2[0]
      1951407424 blocks [2/1] [U_]
      [==========================================>]  recovery =210.0% (4098891072/1951407424) finish=28.0min speed=1261990K/sec
unused devices: <none>

it will start recovery now.just wait....

Comments