Mdadm raid5/dev/md0 lost a disk and recovery from another machine

Source: Internet
Author: User

CentOS-How to add a new disk into a mdadm raid5/dev/md0 whick lost A/DEV/SDC1 disk and revoery at another m Achine?

Fdisk-l--stop/dev/md0
# to force active the raid by Remaind 3 disks. -A--force/dev/md0/dev/sdb1/dev/sde1/dev/sdd1
# Add a new disk into/dev/md0--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 is 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 has a new disk--same compable with the LOST/DEV/SBC1, on Ha nd.

And then we Joury is startiing

    • Check/dev List

ll/dev/

Nothing about/dev/md0.

    • CHECK/DEV/MD0 State:

Cat/proc/mdstat

<none>

... nothing (for the 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 to add a new disk into
Mdadm--manage/dev/md0--add/dev/info for/dev/md0
    • Try get into manage mode, can ' t get config file
[Email protected] dev]# mdadm--assemble/dev/md0--scan--force
Mdadm:/dev/md0 not identified in config file.
    • A key operated is coming, and leads us to a success result.
      All the steps above, we don't stop the/dev/md0 and get many wrong try and get many failed resulte.
Mdadm--stop/dev/md0
Mdadm:stopped/dev/md0
[Email protected] dev]# mdadm--assemble/dev/md0--scan--infilecat / proc/<none>

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

[Email protected] dev]#mdadm-a--force/dev/md0/dev/sdb1/dev/sde1/dev/ sdd1mdadm:/dev/md0 have been started with3Drives (out of4). [Email protected] dev]# mdadm --manage/dev/md0--add/dev/ sdc1 mdadm:added/dev/Sdc1[[email protected] dev]#Cat/proc/mdstat personalities: [RAID6] [RAID5] [raid4] md0:active RAID5 sdc1[5] Sdd1[0] Sde1[4] Sdb1[2]      8790402048Blocks Super1.2Level5, 512k Chunk, algorithm2[4/3] [U_uu] [...............] Recovery =0.0% (184776/2930134016) finish=1321.3min speed=36955k/sec Bitmap:0/ Apages [0KB], 65536KB chunkunused 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 what their position was Ch Anged, 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 on 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.