An example of losing /dev/sdb after restarting the Linux operating system

A certain redhat7.4 operating system cannot enter the system after restarting. Through the console, enter the rescue mode, enter the root user name and password to log in to the system.

Check the error report during the startup process, and found that there are access timeout errors for directories including /home, /var, and /tmp.

 Execute lvscan and see that several file systems are inactive.

Through pvs and other commands, it is also found that there is a PV whose name is unknown, and the corresponding uuid also indicates that this device cannot be found.

 Enter the /etc/lvm/backup directory, see only one VG information VolGroup, execute cat /etc/lvm/backup/VolGroup, you can also see pv0 and pv1 and the corresponding uuid, and device information, you can confirm here The uuid of the error report corresponds to /dev/sdb1, so the target needs to repair /dev/sdb1.

 Trying to repair uuid and /dev/sdb1 failed, because the current /dev/sdb1 device system does not think it exists. The command format is:

pvcreate /dev/sdb1 --uuid xXCy4W-tohc-e6ra-HX0q-mJPC-EOcl-jL20Jn --restorefile /etc/lvm/backup/Volgroup 

So I decided to rebuild /dev/sdb1 first. Recreate sdb1 through fdisk /dev/sdb.

After execution, check pvs and lvscan and find that the PV has been retrieved, and the access to the file system is also normal.

Guess you like

Origin blog.csdn.net/szuwangjl/article/details/121592697