Enter single-user root mode without Password

Source: Internet
Author: User
Enter the single-user root mode without a password-general Linux technology-Linux technology and application information. The following is a detailed description. As a Linux system administrator, you may forget the Linux Super User Password and/etc/inittab or/etc/rc. d/rc. files such as sysinit are incorrectly edited, which makes the system fail to start normally?

To solve the preceding problems, you need to enter the linux root file system in read/write mode.

The following describes three methods for Linux single-user mode under GRUB boot:

(1) hardware environment:
Intel P4/1g ram/sata 80G

(2) software environment:
1) Fedora Core 3 (FC3) and Windows2000 advance server Dual System

2) LVM manages Linux partitions

3)/boot/grub. conf file content:
# Grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a/boot partition. This means that
# All kernel and initrd paths are relative to/boot/, eg.
# Root (hd0, 2)
# Kernel/vmlinuz-version ro root =/dev/VolGroup00/LogVol00
# Initrd-version.img/initrd
# Boot =/dev/sda
Default = 1
Timeout = 1000
Splashimage = (hd0, 2)/grub/splash.xpm.gz
Hiddenmenu
Title Fedora Core (2.6.9-1.667)
Root (hd0, 2)
Kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 rhgb quiet initrd/initrd-2.6.9-1.667.img
Title windows 2000 adv
Rootnoverify (hd0, 0)
Chainloader + 1

First, start the computer and the screen displays the following prompt:
Press any key to enter the menu Booting windows 2000 adv in 999 seconds...

Skip the timer with one click and go to the next step:
Gnu grub version 0.95 (639 K lower/103924 K upper memory) Fedora Core (2.6.9-1.667) Windows 2000 adv

The following is the GRUB prompt:
'E' edit the startup command line before booting
'A' edit the kernel parameters before booting
'C' go to the grub command line
Then, press the three different keys 'E', A', and 'C' to enter three different operations:

1. Quick Method:
Select the Fedora Core (2.6.9-1.667) menu

Press key:
Grub append> ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Modify:
Grub append> ro root =/dev/VolGroup00/LogVol00 single quiet

Press ENTER to complete the modification and booting to ENTER the Linux single-user mode.
Sh-3.00 #

2. Simple Method:
Select the Fedora Core (2.6.9-1.667) menu

Press the e key:
Root (hd0, 2)
Kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Initrd/initrd-2.6.9-1.667.img select kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 rhgb quiet command line

Press the e key:
Grub edit & gt; kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Modify:
Grub edit & gt; kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 single quiet

Press ENTER to complete the modification.

Press the B key booting to enter Linux single user mode
Sh-3.00 #

3. manual method:
Press the c key to enter the grub command line:

(Press the TAB key on the grub command line to obtain the options for grub Command help and grub command)

Grub> fstest (grub> filesystem tracing is now on)
Grub> root (hd0, 2)
(Specify the partition that stores the Linux kernel as the third partition of the first hard disk)
Grub> filesystem type is ext2fs, partition type 0 × 83
Grub> kernel/vmlinuz-2.6.9-1.667 ro root =/dev/VolGroup00/LogVol00 single quiet
(Specify the Kernel File as/boot/vmlinuz-2.6.9-1.667, the kernel parameter is ro-readonly, the root partition is/dev/VolGroup00/LogVol00, rhgb-graphical startup, quiet-do not output boot Information)

Grub> initrd/initrd-2.6.9-1.667.img

(How does one load the initrd image file, the kernel module that supports system hardware devices, before kernel startup? /Boot/initrd-2.6.9-1.667.img and initialize RAM disk)

Grub> boot

If the system configuration and script file are correct, the above three methods will appear in the Booting command-list:

Remounting root filesystem in read-write mode: [OK]

Indicates that the root file system in linux single-user mode is readable and writable.

If the system configuration and script file are incorrect, the root file system in linux single-user mode is read-only file system:

Sh-3.00 # mount? O remount rw? T ext3/

By re-mounting the root file system to read/write, you can edit the system files with errors.
Related Article

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.