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 repair the Linux file system

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

Share

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

This article introduces the knowledge about "how to repair Linux file system". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

When a file system is corrupted, if you are using an ext2fs file system, you can run the e2fsck command from floppy disk to correct the corrupted data in the file system. For other types of file systems, you can use the corresponding fsck command. When checking file systems from floppy disks, it is best not to mount.

Note: A common cause of file system corruption is corruption of superblocks, which are the "headers" of the file system. It contains information about the status, size, and free disk blocks of the file system. If a file system's superblock is corrupted (e.g. accidentally writing data directly to the file system's superblock partition), the system may not recognize the file system at all, and thus it cannot be mounted, even with the e2fsck command.

However, file systems of type ext2fs back up the contents of superblocks and store them at the block group boundaries of the driver. You can tell e2fsck to use a superblock backup with the command,e2fsck -b 8193 refers to the partition where the file system is located, and the-b 8193 option is used to display the superblock backup data stored in 8193 blocks of the file system.

recover lost files

If you accidentally delete important system files, although there is no way to restore them directly, you can copy the corresponding files to the hard disk using the emergency disk. For example, if the file/bin/login is deleted, the system cannot run normally to the login interface. You can use the rescue disk to boot the system, install the hard disk file system into the/mnt directory, and then use the following command:

#cp -a /bin/login /mnt/bin

The "-a" option tells cp to preserve access to files while copying. Of course, if the deleted basic file is not in the "rescue disk group," this method cannot be used. If you have done a system backup before, you can also restore it with a previous backup.

"How to fix Linux file system" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

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