修复DS411 raid crash

June 6, 2012

DS411 的raid是纯软件raid

4块硬盘,每个硬盘3个分区,4块盘第一个分区组成raid1的md0 。根目录mount在上面 。第二个分区组成raid1的md1,大小和md0一样大,应该是自动镜像md0的内容恢复系统用。第三个分区组成raid5的md3就是在管理界面看见的volume1,我们真正使用的数据空间。

用以下命令可以查看具体raid和磁盘的信息

raid信息

DiskStation> cat /proc/mdstat
Personalities : [raid1] [linear] [raid0] [raid10] [raid6] [raid5] [raid4]
md2 : active raid5 sda3[0] sdd3[3] sdc3[2] sdb3[1]
      5846376768 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

md1 : active raid1 sda2[0] sdb2[1] sdc2[2] sdd2[3]
      2097088 blocks [4/4] [UUUU]

md0 : active raid1 sda1[0] sdb1[1] sdc1[2] sdd1[3]
      2490176 blocks [4/4] [UUUU]

unused devices: <none>

 

DiskStation> mdadm -E /dev/sda1
/dev/sda1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 0a9e8a7a:17229176:3017a5a8:c86610be (local to host DiskStation)
  Creation Time : Sat Jan  1 08:00:03 2000
     Raid Level : raid1
  Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
     Array Size : 2490176 (2.37 GiB 2.55 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

    Update Time : Wed Jun  6 21:12:59 2012
          State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
  Spare Devices : 0
       Checksum : 4bccbcb9 – correct
         Events : 18

      Number   Major   Minor   RaidDevice State
this     0       8        1        0      active sync   /dev/hda1

   0     0       8        1        0      active sync   /dev/hda1
   1     1       8       17        1      active sync   /dev/hdb1
   2     2       8       33        2      active sync   /dev/sdc1
   3     3       8       49        3      active sync   /dev/sdd1
DiskStation>

 

磁盘信息

DiskStation> fdisk -l /dev/sda

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1         311     2490240  fd Linux raid autodetect
Partition 1 does not end on cylinder boundary
/dev/sda2             311         572     2097152  fd Linux raid autodetect
Partition 2 does not end on cylinder boundary
/dev/sda3             588      243201  1948793440+ fd Linux raid autodetect
DiskStation>

 

DiskStation> df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/md0                  2.3G    395.0M      1.9G  17% /
/tmp                    249.9M    844.0K    249.0M   0% /tmp
/dev/md2                  5.4T    514.6G      4.9T   9% /volume1

DiskStation> mount
/dev/root on / type ext4 (rw,relatime,barrier=0,journal_checksum,data=ordered)
/tmp on /tmp type tmpfs (0)
none on /dev/pts type devpts (gid=4,mode=620)
/sys on /sys type sysfs (0)
/proc/bus/usb on /proc/bus/usb type usbfs (0)
/dev/md2 on /volume1 type ext4 (usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,synoacl)
/dev/sdq1 on /volumeUSB1/usbshare type fuseblk (rw,allow_other,blksize=4096,default_permissions)
none on /proc/fs/nfsd type nfsd (0)

如果在管理界面看见volume crash,8成就是raid5的md3 有问题,可以尝试用下面的方法恢复

mdadm -A /dev/md3 /dev/sd[a/b/c/d]3

Comments are closed.