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

What is the method of repairing disk disorder without restarting in linux

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "linux does not restart to repair disk disorder method is what", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "linux does not restart to repair disk disorder method is what" it!

Do not restart repair / dev/sdx disk disorder

The / dev/sdx name may be out of order during the disk hot plug process. You can delete and re-add the disk and update the disk device name without restarting the node.

Delete the device to stop the OSD service, release the occupied disk resources, and take stopping OSD1 and releasing its / dev/sdd as an example

[root@demo cephuser] # mount-l

...

/ dev/sda1 on / boot type xfs (rw,relatime,attr2,inode64,noquota)

/ dev/sdc1 on / var/lib/ceph/osd/ceph-0 type xfs (rw,noatime,nodiratime,attr2,inode64,logbsize=256k,noquota)

/ dev/sdb4 on / var/lib/ceph/osd/ceph-2 type xfs (rw,noatime,nodiratime,attr2,inode64,logbsize=256k,noquota)

/ dev/sdd1 on / var/lib/ceph/osd/ceph-1 type xfs (rw,noatime,nodiratime,attr2,inode64,logbsize=256k,noquota)

[root@demo cephuser] # systemctl stop ceph-osd@1

[root@demo cephuser] # systemctl disable ceph-osd@1

Removed symlink / etc/systemd/system/ceph-osd.target.wants/ceph-osd@1.service.

[root@demo cephuser] # umount / dev/sdd1

Be sure to make sure that the corresponding disk resources have been released before you can perform the following operations.

[root@demo cephuser] # cat / sys/block/sdd/device/state

Running

[root@demo cephuser] # echo "offline" > / sys/block/sdd/device/state

[root@demo cephuser] # cat / sys/block/sdd/device/state

Offline

[root@demo cephuser] # ls / dev/sd

Sda sda1 sda2 sdb sdb1 sdb2 sdb3 sdb4 sdc sdc1 sdd sdd1

[root@demo cephuser] # echo "1" > / sys/block/sdd/device/delete

[root@demo cephuser] # ls / dev/sd

Sda sda1 sda2 sdb sdb1 sdb2 sdb3 sdb4 sdc sdc1

Re-add [root@demo cephuser] # ls / dev/sd

Sda sda1 sda2 sdb sdb1 sdb2 sdb3 sdb4 sdc sdc1

[root@demo cephuser] # echo "- -" | tee / sys/class/scsi_host/host5/scan

[root@demo cephuser] # ls / dev/sd

Sda sda1 sda2 sdb sdb1 sdb2 sdb3 sdb4 sdc sdc1 sdd sdd1

If you cannot confirm the specific hostx name, you can execute the above command with all the corresponding host. For example, there are 5 host here.

[root@demo cephuser] # ls / sys/class/scsi_host/host

Host0/ host1/ host2/ host3/ host4/ host5/

[root@demo cephuser] # for i in {0.5}; do echo "- -" | tee / sys/class/scsi_host/host$ {I} / scan;done

-Thank you for your reading. The above is the content of "what is the method of not rebooting to repair disk disorder in linux". After the study of this article, I believe you have a deeper understanding of what is the method of repairing disk disorder in linux, and the specific usage still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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