Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Log analysis and system fault repair

Shulou Source: shulou.com Published: 2022-06-01 06:16:30 10月04日 Update

Experimental case list: log analysis and system fault repair

Requirements: log file analysis

Fault simulation and repair

Steps:

1 View and analyze / var/log/messsages log file

2 View and analyze the user login log

Last: the command is used to query the user records that successfully logged in to the system

The Lastb command is used to query the user records of login failures.

3 simulation and repair of faults

Simulate MBR sector failure

1. Backing up MBR sector data

Back up the MBR sector of the first hard drive (sda) to the sdb 1 partition of the second fast hard drive (mount channel / opt/)

Under the directory)

two。 Simulate MBR sector failure

Read 512 bytes of data from the device file zerozhoong and overwrite it to the first fast hard disk (sda,), thereby destroying the data in the MBR sector

Restart the system and the message "operating system not found" will appear. The host cannot be started because an available operating system cannot be found.

3. Restore MBR sector data in backup files

Using the REHL5 installation CD boot, when the installation wizard "boot" prompt appears, type "linux rescue" and enter to boot to the linux system in the CD in emergency mode.

Default language

Select "continue" to confirm and continue

Warning whether to initialize disk "No"

After "ok" confirmation, enter the bash shell environment at the "sh-3.2#" prompt.

Mount the hard disk partition (sdb1) where the backup files are saved, and restore the data to the hard disk "/ dev/sda"

After completing the recovery operation, execute the "exit" command to exit the temporary shell environment, and the system will restart automatically.

Tags: System failure data file hard disk log analysis backup command user prompt login CD prompt environment query success operating system host information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia Linux Shulou Tech Info Shulou Information