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

Repair Scheme of ext File system under Server Linux system

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

Share

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

Fault description

The server is a dell 730series server, the storage array is the Lun of MD3200 series storage 5T, the operating system is Linux centos 7, and the file system type is EXT4. Due to an unexpected power outage, the system cannot start normally. After repair, the system can start normally, but the mounted 5T partition cannot be accessed normally. After the repair is completed, the file system is normal, but some files are lost. After a closer look, some of the missing files are in the lost+found folder, and the file name has been changed.

Second, fault analysis

1. Backup data

Remap the 5T lun stored by MD3200 to a windows 2008 backup server in read-only mode, and then use professional tools to sector the entire 5T volume to the prepared backup space to ensure customer data security, and subsequent analysis and recovery operations are carried out on the backed up data.

2. Analyze the cause of the failure

After a careful analysis of the underlying data of the 5T volume, it is found that the sudden power outage of the server leads to the destruction of the directory entries in the directory of the failed virtual machine, but this destruction will not affect the important data, but only destroys the directory entries of the files. can be solved by manual repair. After the fsck repair of the file system, the damaged directory items are not repaired successfully. If you directly put them under the lost+found folder named by the directory node number, the corresponding data area index of the directory items will be cleared, and the actual data of the deleted files will not be affected. In this case, fragments can be matched and merged in the free space of the VMFS volume according to the file system in the deleted virtual disk file and the file type in the virtual disk, and the deleted virtual disk file can also be recovered eventually.

III. Implementation Direction

After the ext4 file system file is lost, the node information of the file is cleared, so it cannot be restored according to the node information of the file. It can only be matched according to the node number of the directory item of the missing file and the name of the file in lost+found, because the file in lost+found is named after the node number of the directory entry of the file. So the previous directory structure can be restored by extracting the directory item node number and matching the file name of lost+found.

IV. Restore data

Carries on the bottom analysis according to the implementation direction train of thought, according to the EXT4 file system structure information, scans the area of the directory item in the bottom space, and counts its quantity and calculates the node number of the directory item. Then integrate the scanned directory item node number according to the information of the file system in the disk, record the scanned directory item node number into the database, and then match the file record number in lost+found with the record number in the database.

V. Restoration summary

At first, the customer data was suddenly cut off, which led to file system problems, then artificial fsck repair led to the loss of a large number of file directory structure, and rewrote part of the data, resulting in the possibility of data overwriting. Due to a good understanding of the underlying structure of the ext4 file system and experience in dealing with similar failure types. So the whole recovery process is quite smooth. After matching, the data is restored normally, and it is verified that there is no problem, and the whole data is restored successfully.

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