Linux

如何從 RAID1 中的工作驅動程序掛載分區

  • May 16, 2013

陣列中的一個硬碟驅動器已死,我不確定它是 raid0 還是 raid1,我想要實現的是安裝工作驅動器並備份剩餘的驅動器。

如果我掛載/dev/md127,那麼我只能看到一些 grub 文件,總大小約為 100mb。

如果我嘗試mount /dev/md1我得到:

root@rescue:~# mount /dev/md1 /mnt
mount: /dev/md1: can't read superblock

一些輸出:

root@rescue:~# fdisk -l
Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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
Disk identifier: 0x0001f015

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63      208844      104391   fd  Linux raid autodetect
/dev/sdb2          208845    16787924     8289540   fd  Linux raid autodetect
/dev/sdb3        16787925  2930272064  1456742070   fd  Linux raid autodetect

Disk /dev/md127: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders, total 208640 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
Disk identifier: 0x00000000

Disk /dev/md127 doesn't contain a valid partition table


root@rescue:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md127 : active raid1 sdb1[1]
     104320 blocks [2/1] [_U]

unused devices: <none>

  root@rescue:~# mdadm --examine /dev/sdb2
/dev/sdb2:
         Magic : a92b4efc
       Version : 0.90.00
          UUID : fca66a1e:c6aba1f7:ace437e0:ae545265
 Creation Time : Thu Oct 21 01:57:07 2010
    Raid Level : raid0
  Raid Devices : 2
 Total Devices : 2
Preferred Minor : 1

   Update Time : Thu Oct 21 01:57:07 2010
         State : active
Active Devices : 2
Working Devices : 2
Failed Devices : 0
 Spare Devices : 0
      Checksum : 6138e9b8 - correct
        Events : 1

    Chunk Size : 256K

     Number   Major   Minor   RaidDevice State
this     1       8       18        1      active sync   /dev/sdb2

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

如果有人可以分享,如何正確安裝驅動程序以便能夠訪問數據(最好是只讀模式,所以如果可能的話,我不會搞砸任何事情)……

root@rescue:~# mdadm --examine --scan
ARRAY /dev/md127 UUID=0464b5c4:d777ef5e:17b64c46:2e5e61c3
ARRAY /dev/md1 UUID=fca66a1e:c6aba1f7:ace437e0:ae545265
ARRAY /dev/md2 UUID=46c22b6d:dc9668a4:13d0e329:c7b8b0ca

root@rescue:~# mdadm --detail /dev/md126
mdadm: cannot open /dev/md126: No such file or directory

root@rescue:~/dd_rescue# mdadm --detail /dev/md1
mdadm: md device /dev/md1 does not appear to be active.
root@rescue:~/dd_rescue#
root@rescue:~/dd_rescue#
root@rescue:~/dd_rescue#
root@rescue:~/dd_rescue# mdadm --detail /dev/md2
mdadm: md device /dev/md2 does not appear to be active.

聰明的

   root@rescue:~# smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.2-xxxx-std-ipv6-32] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     ST_M13FQBL
Serial Number:    QNR_BFW
Firmware Version: 1117F38F
User Capacity:    4,142,054,400 bytes [4.14 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   6
ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 2
Local Time is:    Thu May 16 01:37:37 2013 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Error SMART Values Read failed: scsi error aborted command
Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: UNKNOWN!
SMART Status, Attributes and Thresholds cannot be read.

Error SMART Error Log Read failed: scsi error aborted command
Smartctl: SMART Error Log Read Failed
Error SMART Error Self-Test Log Read failed: scsi error aborted command
Smartctl: SMART Self Test Log Read Failed
Device does not support Selective Self Tests/Logging

如果其中一個驅動器死了,您將無法再掛載 /dev/md1 - 您必須在仍然活動的驅動器上掛載一個分區:/dev/sdb2 或 /dev/sdb3

您可以使用獲取更多資訊mdadm --examine /dev/sdb2

如果 sdb2 和 sdb3 執行 RAID0,則這些分區上的所有數據都將失去。

掛載分區時必須指定文件系統類型,例如

mount -o ro -t ext3 /dev/sdb2 /mnt

如果你知道它的 ext3。ro - 用於只讀安裝。

引用自:https://serverfault.com/questions/508115