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

How to avoid automatic reorganization of soft Raid under Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to avoid soft Raid automatic reorganization under Linux". In daily operation, I believe that many people have doubts about how to avoid soft Raid automatic reorganization under Linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to avoid soft Raid automatic reorganization under Linux"! Next, please follow the editor to study!

Sometimes we need to output iSCSI hard drives from two different machines to another machine. To ensure high availability, we can use these two iSCSI hard drives to make a soft Raid. However, when we restart this machine and run the hanging disk of iscsi, when login*** iSCSI Target, as soon as the * hard disk is identified, we find that the soft Raid automatically reorganizes but automatically reorganizes the MDRaid, which is degraded because there is only one hard disk at the bottom, as shown below:

Root@ubuntu01:~# iscsiadm-m node-T iqn.2001-04.com.example:serv01-l Logging in to [iface: default, target: iqn.2001-04.com.example:serv01, portal: 192.168.1.4 jue 3260] (multiple) Login to [iface: default, target: iqn.2001-04.com.example:serv01, portal: 192.168.1.4 jue 3260] successful. Root@ubuntu01:~# cat / proc/mdstat Personalities: [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md127: inactive sdb [0] (S) 511936 blocks unused devices: root@ubuntu01:~# iscsiadm-m node-T iqn.2001-04.com.example:serv02-l Logging in to [iface: default, target: iqn.2001-04.com.example:serv02, portal: 192.168.1.5ju 3260] (multiple) Login to [iface: default Target: iqn.2001-04.com.example:serv02, portal: 192.168.1.5 portal 3260] successful. Root@ubuntu01:~# cat / proc/mdstat Personalities: [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md127: active raid1 sdc [1] sdb [0] 511936 blocks [2go 2] [UU] [= = >.] Resync = 18.9% (97024max 511936) finish=6.6min speed=1024K/sec unused devices:

As can be seen above, when we identify * iSCSI hard drives, the soft Raid is reassembled, and when we hang the second iSCSI hard disk, data synchronization occurs. Therefore, we need to reorganize the soft Raid ourselves to avoid degradation and data synchronization. Disable the automatic reorganization of MDRaid. The method is as follows: edit the configuration file / etc/default/mdadm:

AUTOCHECK=false START_DAEMON=false

Add a line to the / etc/mdadm/mdadm.conf file:

AUTO-all

At this point, we manually reorganize the soft Raid so that there will be no degradation and data synchronization:

Root@ubuntu01:~# iscsiadm-m discovery-t st-p 192.168.1.4 192.168.1.4 192.168.1.4 iqn.2001-m discovery-t st-p 192.168.1.4 192.168.1.4 192.168.1.4 192. Portal: 192.168.1.4 iface 3260] (multiple) Login to [iface: default, target: iqn.2001-04.com.example:serv01, portal: 192.168.1.4 Magi 3260] successful. Root@ubuntu01:~# cat / proc/mdstat Personalities: [linear] [multipath] [raid0] [raid1] [raid5] [raid4] [raid10] unused devices: root@ubuntu01:~# iscsiadm-m node-T iqn.2001-04.com.example:serv02-l Logging in to [iface: default, target: iqn.2001-04.com.example:serv02, portal: 192.168.1.5 (multiple) Login to [iface: default, target: iqn.2001-04.com.example:serv02 Portal: 192.168.1.5,3260] successful. Root@ubuntu01:~# cat / proc/mdstat Personalities: [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] unused devices: root@ubuntu01:~# mdadm-A / dev/md/mdtest / dev/sdb / dev/sdc mdadm: / dev/md/mdtest has been started with 2 drives. Root@ubuntu01:~# cat / proc/mdstat Personalities: [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md127: active raid1 sdb [0] sdc [1] 511936 blocks [2Unip 2] [UU] unused devices: at this point, the study on "how to avoid automatic reorganization of soft Raid under Linux" is over. I hope to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

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

12
Report