Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RAID implementation

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Implement soft raid

1. Fdisk t fd / / modify disk partition type fd

2. Create a raid device

Create a RAID5,5 block hard disk 4 blocks do RAID,1 block do idle hard disk (replace the hard disk)

Mdadm-C / dev/md0-a yes-l 5-n 4-x1 / dev/sd {bmeme creco dje Ji f}

-n #: use # block devices to create this RAID

-l #: indicates the level of RAID to be created

-a {yes | no}: automatically creates the device file for the target RAID device

-c CHUNK_SIZE: indicates the block size

-x #: indicates the number of free disks

Mdadm-D / dev/md0

-D: display the details of the raid letter

Cat / proc/mdstat / / observe the status of md:

3. Mkfs.ext4 / dev/md0 / / format raid devices

4 、 vim / etc/fstab

UUID= "b92ddd51-c555-4948-b1d5-8563b697a2f1" / mnt/raid ext4 defaults 0 0

5. Mdadm-Ds / dev/md0 > / etc/mdadm.conf generate configuration file

Mdadm-S / dev/md0 stop raid

Mdadm-A / dev/md0 starts raid

Out of service: mdadm-S / dev/md0

Activation: mdadm-A-s / dev/md0 activation

Forced startup: mdadm-R / dev/md0

6. Testing

Mdadm / dev/md0-f / dev/sdf1 simulated damage

Mdadm / dev/md0-r / dev/sdf1 Delete member

Mdadm / dev/md0-a / dev/sdf1 increased

Mdadm-G / dev/md0-n 6-a / dev/sdd4 add members

Note: if prompted by mdadm: Failed to initiate reshape! Indicates that the disk expansion (reshape) function does not support reducing the number of devices. Centos7 will have such an error.

7. Delete raid

Umount / mnt/raid

Mdadm-S / dev/md0 stop raid

Rm-f / etc/mdadm.conf

Vi / etc/fstab

Fdisk / dev/sda

Mdadm-- zero-superblock / dev/sdd1 / / Delete raid information

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report