This chapter includes: recover/etc/fstab file in rescue mode 1.1 recover/etc/fstab file in rescue mode 1.1.1 fault-free fstab file failure simulation move the fstab file in the/etc/directory to/opt/ after the directory is moved, it is found that no matter what operation is done in the system, it is changed to a read-only system. Start startup press F2 to enter BIO
This chapter includes: repairing/etc/fstab files in rescue mode
1.1 Use rescue mode to repair/etc/fstab file 1.1.1 fault-free fstab file
Fault simulation moves the fstab file in the/etc/directory of the system to the/opt/directory, and finds that no matter what operations are performed in the system, it turns into a read-only system.
Boot boot press F2 key enter BIOS tune CD-ROM Drive to first boot from disc.
After setting, press F10 to save and exit!
Select system rescue mode
Select the language default. select OK!
Select the keyboard type to keep the default value!
NO network is required to fix the system. therefore, NO is selected here!
The Rescue program will check whether a linux system has been installed on the current hard disk. by default, in Rescue mode, the root partition of the hard disk will be mounted to the/mnt/sysimage Directory of the CD Linux environment, the default option "continue" indicates that the mounting permission is Read-only and Read-only. to fix the system, you need to have Read and write permissions. Generally, the default option "continue" is selected ".
The rescue program searches for linux and hard disk partitions installed on the hard disk. the search result shows that the Linux partition cannot be found because the/etc/fstab file is deleted, therefore, the system cannot read the Linux partition, but if it is found, it will be mounted to/mnt/sysimage.
Select OK in the startup shell window!
Use fdisk-l to view hard disk partitions and find the disk partitions in the original system/directory, as shown in:
Mount the root directory of the original system to the new Mount point, as shown in:
Enter the mount point to move the fstab from the current opt directory to the original etc directory and view the moving result.
Restart the system
System Recovery
1.1.2 error message in the fstab file
We intentionally added several letters to the swap partition UUID in the/etc/fstab file and set it to automatic detection and automatic backup at startup.
The system cannot be started when it is started up. the error message is as follows:
As prompted above, enter the root user password to go to the/etc/fstab file and modify its error location! (I didn't expect it to be even unable to read the write permission)
Exit and try another method to re-mount/partition in read/write mode.
Save the modification error in/etc/fstab and exit! The modified result is as follows:
Restart the system
Success!