centos -- how to add a new disk into a mdadm raid5 /dev/md0 which lost a /dev/sdc1 disk and  revoery at another machine?

fdisk -l

mdadm --stop /dev/md0

# to force active the raid by remaind 3 disks.
mdadm -A --force /dev/md0 /dev/sdb1 /dev/sde1 /dev/sdd1

# add a new disk into /dev/md0
mdadm --manage /dev/md0 --add /dev/sdc1

------------------------------------------------------------------------------------------------------

we build a /dev/md0 on  a Unitek (removeable usb storadge with 4 disks inside) by mdadm software, and  mdadm -create /dev/md0 operated on a HUAWEI server,  our recovery work was done on my laptop ,and we meet many many problems during recovery.

we miss a disk --/dev/sdc1 from the raid /dev/md0, and now have a new disk -- same compable with the lost /dev/sbc1, on hand.

and then our joury is startiing

  • check /dev list

  ll /dev/

  nothing about /dev/md0 .

  • check /dev/md0 state :

  cat /proc/mdstat

Personalities :
unused devices: <none>

  ...nothing( for this is a  totally new machine to the /dev/md0 no conf file ,no superblock...)

  • we  try force mdadm to  assembly to force mdadm auto recovery itself:

     mdadm --assemble --run --force /dev/md0

 mdadm -A --force /dev/md0 /dev/sdb1 /dev/sde1 /dev/sdd1

we get "can't open /dev/md0 array info" or "/dev/sdb1 is busying" and many other error response info;

  • then we try add a new disk into
mdadm --manage /dev/md0 --add /dev/sdc1
mdadm: Cannot get array info for /dev/md0
  • try get into manage mode, can't get config file
[root@localhost dev]# mdadm --assemble /dev/md0 --scan --force
mdadm: /dev/md0 not identified in config file.
  • a key operated is coming, and lead us to a success result.
    all the steps above, we  NOT stop the /dev/md0 and get many wrong try and get many failed resulte.
mdadm --stop /dev/md0
mdadm: stopped /dev/md0
[root@localhost dev]# mdadm --assemble /dev/md0 --scan --force
mdadm: /dev/md0 not identified in config file.
[root@localhost dev]# cat /proc/mdstat
Personalities :
unused devices: <none>

mdadm --force start by remain 3 disks, and add a new disk into /dev/md0, and get into recovery state.

[root@localhost dev]# mdadm -A --force /dev/md0 /dev/sdb1 /dev/sde1 /dev/sdd1
mdadm: /dev/md0 has been started with drives (out of ).
[root@localhost dev]# mdadm --manage /dev/md0 --add /dev/sdc1
mdadm: added /dev/sdc1
[root@localhost dev]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[] sdd1[] sde1[] sdb1[]
blocks super 1.2 level , 512k chunk, algorithm [/] [U_UU]
[>....................] recovery = 0.0% (/) finish=.3min speed=36955K/sec
bitmap: / pages [0KB], 65536KB chunk unused devices: <none>

conclusion:

  • remember to stop /dev/md0 at first step, then do other operates;
  • mdadm create raid5 array, every raid array info were storaged at every physical disk , no matter how their position was changed, madadm can recognize the correct raid array info.
  • mdadm is realy a stronger sofeware at protect our data, if use correctly  we need not worry about our data's safety --- if only lost ONE disk, we can find them back;

-----other relate info reference

1. http://blog.csdn.net/waityoualife/article/details/5612243

mdadm Raid5 /dev/md0 lost a disk and recovery from another machine的更多相关文章

  1. vmware启动虚拟机报错VMware Workstation has paused this virtual machine because the disk on which the virtual machine is stored is almost full. To continue, free an additional 1.4 GB of disk space.

    报错VMware Workstation has paused this virtual machine because the disk on which the virtual machine i ...

  2. How to Add Memory, vCPU, Hard Disk to Linux KVM Virtual Machine

    ref: https://www.thegeekstuff.com/2015/02/add-memory-cpu-disk-to-kvm-vm/ In our previous article of ...

  3. the algebra of modulo-2 sums disk failure recovery

    x=y x_+_y=0 The bit in any position is the modulo-2 sum of all the bits in the corresponding positio ...

  4. 使用mdadm创建磁盘RAID10整列,RAID5出现故障,自动替换硬盘

    首先需了解mdadm的参数使用 . 第一步: 先在虚拟机中添加四块硬板 第二步:使用mdadm命令创建RAID10名称为"/dev/md0" -C代表创建操作,v 显示创建过程,- ...

  5. 专题:mdadm Raid & LVM

    >FOR FREEDOM!< {A} Introduction Here's a short description of what is supported in the Linux R ...

  6. mdadm命令详解及实验过程

    一.概念 mdadm是multiple devices admin的简称,它是Linux下的一款标准的软件 RAID 管理工具,作者是Neil Brown 二.特点 mdadm能够诊断.监控和收集详细 ...

  7. mdadm语法

    mdadm命令详解及实验过程   一.概念 mdadm是multiple devices admin的简称,它是Linux下的一款标准的软件 RAID 管理工具,作者是Neil Brown 二.特点 ...

  8. [daily][archlinux][mdadm][RAID] 软RAID

    一, 使用mdadm创建RAID 参考:https://wiki.archlinux.org/index.php/RAID 1.  安装 mdadm /home/tong [tong@TStation ...

  9. mdadm详细使用手册

    1. 文档信息 当前版本 1.2 创建人 朱荣泽 创建时间 2011.01.07 修改历史 版本号 时间 内容 1.0 2011.01.07 创建<mdadm详细使用手册>1.0文档 1. ...

随机推荐

  1. HZOI String STL的正确用法

                                                                      String          3s 512 MB描述硬盘中里面有n ...

  2. Android-使用ViewFlipper实现轮番切换广告栏

    所谓的轮番切换广告栏,指的是下面这个东西,笔主不知道该怎么确切描述这货... 笔主没有百度研究过其他大牛是怎么实现这个功能的,在这里笔主充分发挥DIY精神,利用ViewFlipper闭门土制了一个,下 ...

  3. 如何用setInterval调用类的方法

    setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式.setInterval() 方法会不停地调用函数,直到 clearInterval() 被调用或窗口被关闭.由 se ...

  4. spring中Constructor、@Autowired、@PostConstruct的顺序【转】

    其实从依赖注入的字面意思就可以知道,要将对象p注入到对象a,那么首先就必须得生成对象p与对象a,才能执行注入.所以,如果一个类A中有个成员变量p被@Autowired注解,那么@Autowired注入 ...

  5. Pycharm 创建 Django admin 用户名和密码

    1.  问题 使用PyCharm  创建完Django 项目  想登录admin  页面   却不知道用户名和密码. 用的默认sqlit   2.解决办法   2.1 打开manage.py 控制界面 ...

  6. kubernetes 参考资料

    kubernetes 参考资料 非常建议先花20分钟,完成这个官方的交互式指南:https://kubernetes.io/docs/tutorials/kubernetes-basics/ 这个教程 ...

  7. Linux 下打包报错:enospc (no space left on device)

    昨天打了个包,早上发现很多页面js加载404,一查原来打包的min文件夹下是空的,打包出错了 Error code: enospc du -sh * rm -f 文件名称 rm -rf 目录名称 前端 ...

  8. Nginx中的长连接

    在nginx中,对于http1.0与http1.1是支持长连接的 我们知道,http请求是基于TCP协议之上的,那么,当客户端在发起请求前,需要先与服务端建立TCP连接,而每一次的TCP连接是需要三次 ...

  9. BZOJ 3994: [SDOI2015]约数个数和

    3994: [SDOI2015]约数个数和 Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 898  Solved: 619[Submit][Statu ...

  10. 【洛谷 P4289】[HAOI2008]移动玩具(搜索)

    其实这题可以不用状压.. 提供一种新思路. 我们在读入目标棋盘的时候,把当前位置的数和当前棋盘进行比较,如果不一样,如果当前是\(1\),目标是\(0\),那么我们就把当前位置加入\(needmove ...