快速业务通道

mdadm

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-16
Array Size : 112320 (109.71 MiB 115.02 MB) Device Size : 112320 (109.71 MiB 115.02 MB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Sat Jan 1 05:08:27 2000 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 UUID : 797b80d8:4b70e2d1:7e427c7e:c9546d1b Events : 0.10 Number Major Minor RaidDevice State 0 8 10 0 active sync /dev/sda10 1 8 26 1 active sync /dev/sdb10 # cat /proc/mdstat Personalities : md0 : active raid1 sda10[0] sdb10[1] 112320 blocks [2/2] [UU] raid autodetect unused devices: <none> # mount /dev/md0 /share/raid (挂载raid) # cp /share/partitionA2 /share/raid # ls /share/raid lost found asdf.asf netatalk.tar # umount /share/raid # mdadm /dev/md0 -f /dev/sda10 # mdadm /dev/md0 -r /dev/sda10 (将sda10从raid中移除) # mdadm -D /dev/md0 /dev/md0: Version : 00.90.01 Creation Time : Sat Jan 1 02:45:14 2000 Raid Level : raid1 Array Size : 112320 (109.71 MiB 115.02 MB) Device Size : 112320 (109.71 MiB 115.02 MB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Sat Jan 1 05:30:28 2000 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : 797b80d8:4b70e2d1:7e427c7e:c9546d1b Events : 0.52 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 26 1 active sync /dev/sdb10 # cat /proc/mdstat Personalities : 将sda10的分区类型改为linux (即83),然后重启,重新挂载,查看分区里的文件: md0 : active raid1 sdb10[1] 112320 blocks [2/1] [_U] ­ unused devices: <none> # fdisk /dev/sda # reboot 和原来作为raid时的内容完全一样,说明raid1 的确是在每个硬盘都写入数据,有较高的可靠性. t-->11 --> 83 --> w # mount /dev/sda10 /share/partition # ls /share/partition lost found asdf.asf netatalk.tar 4.3 数据恢复: 下面在sda上新建另一分区,sda11,并把它作为raid1的一个分区,即替代原来的sda10; # mdadm /dev/md0 -a /dev/sda11 mdadm: hot added /dev/sda11 # mdadm -D /dev/md0 /dev/md0: Version : 00.90.01 Creation Time : Sat Jan 1 02:45:14 2000 Raid Level : raid1 Array Size : 112320 (109.71 MiB 115.02 MB) Device Size : 112320 (109.71 MiB 115.02 MB) Raid Devices : 2 Total Devices : 3 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Sat Jan 1 05:50:00 2000 State : clean Active Devices : 2 Working Devices : 3 Failed Devices : 0 Spare Devices : 1 UUID : 797b80d8:4b70e2d1:7e427c7e:c9546d1b Ev

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号