14th Linux Startup Management (3) _ System Repair mode

Source: Internet
Author: User

3. System Repair mode

3.1 Single-user mode

(1) Select the 2nd item in the Grub interface and press "E" key to enter the editor . and add "1", i.e. "... quiet 1" after "... quiet" , where 1 represents single-user mode . You can then restart to enter single-user mode (note that no user name and password are required to enter at this time).

(2) Common bug fixes in single user mode

  ① Forgotten root password: #passwd Root // to set a password for the root user

② Modify the system default operating level :#vi/etc/inittab    You can change the default run level

3.2 Disc Repair mode

(1) Insert the 1th CD ROM of CentOS into the CD of the virtual machine.

(2) Press "F2" to enter the BIOS, modify the drive from the CD.

(3) Then Select "Rescue installed System", select the appropriate language, keyboard layout,Shell interface and so on. You can enter Repair mode (prompt "bash-4.1#")

bash-4.1# chroot/mnt/sysimage Change the home directory to enter the operating system directory

sh-4.1# Cd/root

(4) The configuration file can be modified at this time, such as:

① Delete login password for grub interface   : sh-4.1# vi/boot/grub/grub.conf then remove the password.

② Change the root password:   #passwd Root

  ③ retrieve lost system files , such as retrieve/etc/inittab files:

SH-4.1# Rpm-qf/etc/inittab Query under/etc/which package does the Inittab file belong to?SH-4.1#mkdir/mnt/cdrom setting up a mount pointSH-4.1#Mount/dev/sr0/mnt/CDROM mounting DiscsSH-4.1# Rpm2cpio/mnt/cdrom/packages/initscripts-9.03. --1. el6.centos.i686.rpm| Cpio–idv./etc/inittab//Extract the Inittab file to the current directorySH-4.1#CPEtc/inittab/etc/inittab//Copy the Inittab file to the specified location

3.3 Linux the security

14th Linux Startup Management (3) _ System Repair mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.