Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Expand an existing RAID arrays and remove the failed disk in a RAID     - Use Markdown editor for document work under Linux (Linux)

- Ubuntu 14.10 splash screen brightness settings (Linux)

- Ftp user to create multiple virtual machines to support different access rights Examples (Server)

- SUSE Linux network configuration and firewall configuration (Linux)

- Elixir: the future of programming languages (Programming)

- Restrict console access to Linux servers to improve security (Linux)

- Copy and paste in Linux terminal and Vim (Linux)

- iscsiadm command usage (Linux)

- C ++ free store and heap (Programming)

- Flask installation environment (Linux)

- How to configure Proftpd server on Fedora 22 (Server)

- JavaScript original values and complex values (Programming)

- iOS GCD multithreading simple to use (Programming)

- Web cache basics: terminology, HTTP headers, and caching policies (Server)

- Zabbix monitoring platform to extract a single server graphical Python implementation of concurrent (Server)

- SSH configuration under Linux (Linux)

- Four levels of intrusion on Linux server and counter-measures (Linux)

- Introduction to Linux Shell (Programming)

- Kali Linux 2.0 U disk installation errors Your installation cd-rom could not be mounted (Linux)

- How to use the Docker Machine cluster deployment Swarm (Server)

  Expand an existing RAID arrays and remove the failed disk in a RAID
  Add Date : 2017-01-08      
  Each novice will array (array) represent the meaning of the word puzzled. Just a collection of disk arrays. In other words, we can call the array as a set (set) or a group (group). Like a group of egg contains 6 different. Similarly RAID array comprising a plurality of disks may be 2,4,6,8,12,16, etc., I hope you now know what is an array.

Here we will see how to extend existing array or RAID group. For example, if we use two disks in the array to form a raid 1 set, in some cases, if the group needs more space, you can use mdadm -grow command to extend the size of the array, just added to a disk to an existing array can be. Having extended in (add disks to an existing array), we will look at how to remove the failed disk from the array.

Expansion RAID arrays and remove the failed disk

Suppose there is a disk in question need to remove the disk, but we need to add a spare disk before removing the disk to expand the mirror, because we need to save our data. When a disk fails we need to remove it from the array, which is the topic we will learn to.

Characteristics of RAID expansion

We can increase (expand) the size of any RAID set.
We can remove the failed disk after disk expansion with a new RAID array.
We can extend RAID array without downtime.

To expand a RAID array, we need an existing RAID group (array).
We need to extend the additional disk array.
Here, we use a disk to expand an existing array.
Before we understand the array expansion and recovery, we must understand the basics of RAID levels and settings.

My server settings

Operating System: CentOS6.5Final
IP Address:
Host Name: grow.tecmintlocal.com
Two existing disk: 1 GB
An extra disk: 1 GB
Here, we already have a RAID, there are two disks, each size is 1GB, we now add a disk to our existing RAID array, and its size is 1GB.

Expand an Existing RAID Array

1, before the expansion of the array, the first to use the following command to list the existing RAID arrays.

# Mdadm --detail / dev / md0

Check Existing RAID Array

Note: The above output shows that already have two disks in a RAID array, the level of RAID 1. Now we add a disk to an existing array inside.

2, let us now add a new disk "sdd", and use the fdisk command to create partitions.

# Fdisk / dev / sdd
Use the following steps to create a new partition for / dev / sdd.

Create a new partition by n.
Then press P to select a primary partition.
Next, select the partition number 1.
Simply press the Enter key twice to select the default value.
Then, press P to print the created partition.
Press L, lists all the available types.
Press t to modify the partition.
Type fd is set to Linux RAID type, and then press Enter.
Then use p again see our changes.
Use w to save your changes.

Create a new partition for sdd

3, once the new sdd partition is created, you can use the following command to verify it.

# Ls -l / dev / | grep sd

Confirm sdd partition

4. Next, add to the array before the first check whether there RAID disk partitions.

# Mdadm --examine / dev / sdd1

Check sdd partition in RAID

Note: The above output shows that the disk has not found super-blocks, it means that we can add new disks to an existing array.

5. To add a new partition / dev / sdd1 to an existing array md0, use the following command.

# Mdadm --manage / dev / md0 --add / dev / sdd1

Add a disk to a RAID array

6. Once the new disk is added, check our newly added disk array.

# Mdadm --detail / dev / md0

Be sure to add the new disk to the RAID

Note: In the above output, you can see the disk has been added as a backup. Here, we have an array of two disks, but we look forward to have three disks in the array, so we need to expand the array.

7, to expand the array, we need to use the following command.

# Mdadm --grow --raid-devices = 3 / dev / md0

Extended Raid Array

Now we can see a third disks (sdd1) has been added to the array, after the third block disks are added, it will synchronize the data from the other two disks.

# Mdadm --detail / dev / md0

Confirm Raid Array

Note: For large-capacity disk will take several hours to synchronize data. Here, we used a 1GB virtual disk, so it will be completed very quickly within a few seconds.

Remove the disk from the array

8, after the data from the other two disks are synchronized to the new disk sdd1, now three data disks have the same (mirror).

As I said earlier, assuming a disk problem that needs to be removed. So now I suppose sdc1 disk problem, and needs to be removed from an existing array.

Before removing a disk we want to mark it as invalid, then we can remove it.

# Mdadm --fail / dev / md0 / dev / sdc1
# Mdadm --detail / dev / md0

Simulated disk failure in a RAID array

From the above output, we clearly see the disk in the following are marked as faulty. Even if it is faulty, we can still see the raid device has three, one damaged, the state is degraded.

Now we want to delete the faulty disk array, raid devices will as before continue to have two devices.

# Mdadm --remove / dev / md0 / dev / sdc1

Remove Raid disk array

9, once the failed disk is removed, then we can only use two disks to expand raid arrays.

# Mdadm --grow --raid-devices = 2 / dev / md0
# Mdadm --detail / dev / md0

In a RAID disk array expansion

We can see from the above output, we have an array of only two devices. If you need to expand the array again, follow the same procedure as described above will be. If you need to add a disk as a backup, mark it as spare, therefore, if a disk fails, it will automatically go to the top and reconstruct the data.

in conclusion

In this article, we have seen how to extend the existing RAID set and remove the failed disk from an array How to resynchronize data after the existing disk. All of these steps can be done without downtime. During data synchronization, system users, files and applications are not affected.
- How to Check notebook CPU temperature in Ubuntu (Linux)
- Getting Started with Linux system to learn: how to check the version of SSH on Linux (Linux)
- Ubuntu 12.04 64-bit installation Redmine + Git + ReviewBoard (Linux)
- CentOS yum source deployment (Linux)
- Linux system security infrastructure Highlights (Linux)
- Linux loopback adapter Driven Design (Programming)
- Linux Platform Oracle 11g Single Instance Installation Deployment Configuration Quick Reference (Database)
- C ++ 11 feature: auto keyword (Programming)
- How to Install 3.16.7 CKT2 kernel in Ubuntu 14.10, Ubuntu 14.04 and its derivative versions (Linux)
- Linux Firewall IPCop Profile (Linux)
- How to use the ps command to monitor progress in the implementation of Linux commands (Linux)
- Ubuntu 14.04 compile and install Apache (Server)
- Embedded Linux Optimization (Programming)
- Some common Linux commands Study Notes (Linux)
- Use 3G wireless network card under Linux (Linux)
- ARM runtime environment built from scratch using QEMU emulator (Linux)
- Linux bash: scp: command not found the problem (Linux)
- Linux and hardware (Linux)
- The most simple drive to write and test procedures under linux (Programming)
- Using Vagrant to build multi-platform environment (Server)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.