root@bew:~# uname -a
Linux bew 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:15:33 UTC 2013 i686 i686 i386 GNU/Linux
root@bew:~# fdisk -l
Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 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: 0x000a6462
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 389302271 194650112 fd Linux raid autodetect
/dev/sda2 389304318 398295039 4495361 5 Extended
/dev/sda5 389304320 398295039 4495360 fd Linux raid autodetect
Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 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: 0x000cd49d
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 389302271 194650112 fd Linux raid autodetect
/dev/sdb2 389304318 398295039 4495361 5 Extended
/dev/sdb5 389304320 398295039 4495360 fd Linux raid autodetect
Disk /dev/md127: 199.3 GB, 199321649152 bytes
255 heads, 63 sectors/track, 24232 cylinders, total 389300096 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: 0x000048ac
Device Boot Start End Blocks Id System
/dev/md127p1 63 385110179 192555058+ 83 Linux
/dev/md127p2 385110180 389287079 2088450 5 Extended
/dev/md127p5 385110243 389287079 2088418+ 82 Linux swap / Solaris
root@bew:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md127 : active raid1 sdb1[1]
194650048 blocks [2/1] [_U]
No Array listed in /etc/mdadm/mdadm.conf
automatically tag new arrays as belonging to the local system
HOMEHOST <system>
我删除了它希望重建。
root@bew:~# dmraid -dtay
DEBUG: not isw at 2064645120
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 2063563264
DEBUG: not isw at 2064645120
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 2063563264
no raid disks
root@bew:~# mdadm --create /dev/md0 --name=0 --chunk=256 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to be part of a raid array:
level=raid0 devices=0 ctime=Wed Dec 31 16:00:00 1969
mdadm: partition table exists on /dev/sda1 but will be lost or
meaningless after creating array
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: super1.x cannot open /dev/sdb1: Device or resource busy
mdadm: /dev/sdb1 is not suitable for this array.
mdadm: create aborted
root@bew:~# mdadm -Evvvvs
mdadm: No md superblock detected on /dev/md127p5.
/dev/md127p2:
MBR Magic : aa55
Partition[0] : 4176837 sectors at 63 (type 82)
mdadm: No md superblock detected on /dev/md127p1.
/dev/md127:
MBR Magic : aa55
Partition[0] : 385110117 sectors at 63 (type 83)
Partition[1] : 4176900 sectors at 385110180 (type 05)
mdadm: No md superblock detected on /dev/sdb5.
/dev/sdb2:
MBR Magic : aa55
Partition[0] : 8990720 sectors at 2 (type fd)
/dev/sdb1:
Magic : a92b4efc
Version : 0.90.00
UUID : 63621c2f:6fa023e2:e368bf24:bd0fce41
Creation Time : Mon Jan 23 14:19:49 2012
Raid Level : raid1
Used Dev Size : 194650048 (185.63 GiB 199.32 GB)
Array Size : 194650048 (185.63 GiB 199.32 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 127
Update Time : Mon Mar 24 13:11:57 2014
State : clean
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
Checksum : cac6a6e5 - correct
Events : 1834362
Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/sdb1
0 0 0 0 0 removed
1 1 8 17 1 active sync /dev/sdb1
/dev/sdb:
MBR Magic : aa55
Partition[0] : 389300224 sectors at 2048 (type fd)
Partition[1] : 8990722 sectors at 389304318 (type 05)
mdadm: No md superblock detected on /dev/sda5.
/dev/sda2:
MBR Magic : aa55
Partition[0] : 8990720 sectors at 2 (type fd)
/dev/sda1:
MBR Magic : aa55
Partition[0] : 385110117 sectors at 63 (type 83)
Partition[1] : 4176900 sectors at 385110180 (type 05)
/dev/sda:
MBR Magic : aa55
Partition[0] : 389300224 sectors at 2048 (type fd)
Partition[1] : 8990722 sectors at 389304318 (type 05)
root@bew:~# mdadm --examine /dev/sdb
/dev/sdb:
MBR Magic : aa55
Partition[0] : 389300224 sectors at 2048 (type fd)
Partition[1] : 8990722 sectors at 389304318 (type 05)
root@bew:~#
root@bew:~# mdadm --examine /dev/sda
/dev/sda:
MBR Magic : aa55
Partition[0] : 389300224 sectors at 2048 (type fd)
Partition[1] : 8990722 sectors at 389304318 (type 05)
root@bew:~# mdadm --examine /dev/md0
mdadm: cannot open /dev/md0: No such file or directory
root@bew:~# mdadm --examine /dev/md127
/dev/md127:
MBR Magic : aa55
Partition[0] : 385110117 sectors at 63 (type 83)
Partition[1] : 4176900 sectors at 385110180 (type 05)
root@bew:~# mdadm --assemble --run --force /dev/md0 /dev/sda1
mdadm: Cannot assemble mbr metadata on /dev/sda1
mdadm: /dev/sda1 has no superblock - assembly aborted
as you can see above it says there is a superblock and then here that there isn't.
root@bew:~# cat /proc/mdstat personalities
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md127 : active raid1 sdb1[1]
194650048 blocks [2/1] [_U]
unused devices: <none>
cat: personalities: No such file or directory
root@bew:~# umount --force /dev/md127p1
umount2: Device or resource busy
umount: /: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount2: Device or resource busy
我发现系统已关闭,昨晚崩溃了,唯一可以启动的方式是使用boot in degraded
从启动菜单中选择恢复模式后启动。我也无法启动到桌面。我们得到的只是行命令。
我最初只是尝试将md127
重命名为md0
,但结果总是unable to gain exclusive access
,然后我尝试添加 ,但总是收到繁忙消息。有一次我将 编辑 adadm.conf
为md0
而不是md127
,然后重建内核,没有帮助,仍然启动到 ,md127
尽管 conf 有md0
。有一次我收到一条错误消息,指出 magic 不同,它们是 ,虽然我不知道这是怎么发生的,一个是 ,aa55
另一个是数字和字母的混合,这在我访问过的论坛中似乎很常见。
我已经研究了好几天,但没有成功,请帮我解决一下这个问题..谢谢。
答案1
将此标记为已修复。我做了什么..
首先我做了很多研究,修复了超级块,但是,我认为这不是必需的。我编辑了 /dev/mdadm/mdadm.conf,将 md127 改为 md0。我让报告坏的驱动器失效,然后运行“update-initramfs -u”,然后重新启动,注意不要从发生故障的驱动器启动。第一次这样做时,由于某种原因没有成功,不得不重复这个过程。也许我没有保存 conf 文件或什么的。但如果重新启动后 cat /proc/mdstat 报告 md0 而不是 md127,它就可以正常工作。之后,我只需使用 mdadm --manage --add /dev/md0 /dev/sda1 将发生故障的驱动器重新添加到阵列中,记住它是阵列的一部分,而不是驱动器本身。添加后,我再次运行“cat /proc/mdstat”以查看它是否正在同步,是的,我等待同步完成..几个小时后我重新启动并修复了所有问题..我遇到的问题是我正在重建内核而不是只进行更新。只要“cat /etc/mdadm/mdadm.conf”报告 ARRAY /dev/md0 UUID=63621c2f:6fa023e2:e368bf24:bd0fce41 而不是 ARRAY /dev/md127 UUID=63621c2f:6fa023e2:e368bf24:bd0fce41 您已准备好进行“update-initramfs -u”,然后重新启动并添加故障驱动器..这可能在没有驱动器故障的情况下起作用,但这只是我为了解决这个问题所做的事情......md127 似乎是现在,只要阵列进入降级模式,就会出现一个默认的 md 编号,但处理起来比想象的要容易。虽然我花了一天的时间..查看有关链接,希望我几天前就发现它。
答案2
首先,dmraid
是针对 fakeraid 的;它与 mdadm 软件 raid 无关,因此您甚至不应该安装它。其次,您永远不应该尝试在现有阵列之上创建阵列;这会破坏现有阵列。幸运的是,mdadm 不允许您这样做。
显示为 md127 而不是 md0 的原因在于您没有在 mdadm.conf 中列出数组。这其实不是什么大问题,但如果您确实修复了 mdadm.conf,则必须运行update-initramfs
以将更改传播到 initramfs 中。
最后,您似乎只需要使用“sudo mdadm /dev/md127 --add /dev/sda1”将第一个分区重新添加到阵列。此外,您似乎在每个磁盘上都有一个指定用于 raid 的第二个分区(编号 5),但您没有使用。