如何使用 mdadm 在 Linux 中挂载由 Windows 创建的软件 RAID1(镜像)?

Gre*_*zzo 8 windows linux software-raid mdadm raid-1

我正在将我的 Windows 服务器切换到 Ubuntu,并试图让我在 Windows 中创建的软件 RAID1(镜像)显示在 Ubuntu 中。我已经读到这里可以使用 mdadm,但是我遇到了麻烦。

这是我正在尝试的:

Script started on Thu 12 Jan 2012 12:22:33 GMT
graeme@MediaCentre:~/Desktop$ cat /proc/partitions

major minor  #blocks  name

   8        0  120060864 sda
   8        1  117974016 sda1
   8        2          1 sda2
   8        5    2083840 sda5
   8       16 1465138584 sdb
   8       17 1465136128 sdb1
   8       32 1465138584 sdc
   8       33 1465136128 sdc1
graeme@MediaCentre:~/Desktop$ sudo mdadm --build /dev/md0 --chunk=128 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
[sudo] password for graeme:
mdadm: array /dev/md0 built and started.
graeme@MediaCentre:~/Desktop$ sudo mkdir /media/WinMirror/
mkdir: cannot create directory `/media/WinMirror/': File exists
graeme@MediaCentre:~/Desktop$ sudo mount -t ntfs /dev/md0 /media/WinMirror
Failed to read last sector (5860544511): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/md0': Invalid argument
The device '/dev/md0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
graeme@MediaCentre:~/Desktop$ exit
exit

Script done on Thu 12 Jan 2012 12:23:23 GMT
Run Code Online (Sandbox Code Playgroud)

当我尝试 64 个块时,如果我以其他顺序列出磁盘,我会得到同样的结果。

有谁知道我在这里做错了什么?

编辑:我正在按照 Paul 的要求添加 fdisk -l 的结果:

graeme@MediaCentre:~$ sudo fdisk -l /dev/sdb
[sudo] password for graeme:

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: 0x181bfef8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  2930275119  1465137528+  42  SFS
graeme@MediaCentre:~$ sudo fdisk -l /dev/sdc

Disk /dev/sdc: 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: 0x181bfef8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  2930275119  1465137528+  42  SFS
graeme@MediaCentre:~$ sudo mdadm --build /dev/md0 --level=1 --raid-devices=2 /dev/sdb     /dev/sdc
mdadm: array /dev/md0 built and started.
graeme@MediaCentre:~$ sudo fdisk -l /dev/md0

Disk /dev/md0: 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: 0x181bfef8

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1              63  2930275119  1465137528+  42  SFS
Run Code Online (Sandbox Code Playgroud)

我想我刚刚发现不可能“构建”RAID1,而“构建”是查看Windows 软件RAID 的唯一方法。有人可以为我确认吗?

这就是我设法从 mdadm 中得到的:

graeme@MediaCentre:~$ sudo mdadm --build --help
Usage:  mdadm --build device -chunk=X --level=Y --raid-devices=Z devices

 This usage is similar to --create.  The difference is that it creates
 a legacy array without a superblock.  With these arrays there is no
 difference between initially creating the array and subsequently
 assembling the array, except that hopefully there is useful data
 there in the second case.

 The level may only be 0, raid0, or linear.
 All devices must be listed and the array will be started once complete.
 Options that are valid with --build (-B) are:
  --bitmap=          : file to store/find bitmap information in.
  --chunk=      -c   : chunk size of kibibytes
  --rounding=        : rounding factor for linear array (==chunk size)
  --level=      -l   : 0, raid0, or linear
  --raid-devices= -n : number of active devices in array
  --bitmap-chunk=    : bitmap chunksize in Kilobytes.
  --delay=      -d   : bitmap update delay in seconds.
Run Code Online (Sandbox Code Playgroud)

Gre*_*zzo 1

我很确定这是不可能的。我尝试了一切都无济于事,最终意识到我已经搞砸了,Windows甚至不再安装它了。不得不使用一些先进的恢复工具。犯了大错!感觉自己像个白痴,在没有备份的情况下依赖突袭,在没有备份的情况下搞乱突袭!那好吧。学过的知识。