Three methods of GRUB single-user mode in Linux

Source: Internet
Author: User
Article Title: in Linux, GRUB directs the single-user mode in three ways. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories as a Linux system administrator, you may forget the Linux Super User Password, set/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/initrd-version.img # 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 (BRL. 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 ora Core (2.6.9-1.667) menu and press:

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 ora Core (2.6.9-1.667) menu and press e:

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> kernel/vmlinuz-2.6.9-1.667 ro

Root =/dev/VolGroup00/LogVol00 rhgb quiet

 
Modify:

Grub edit> 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 the Linux single user mode:

Sh-3.00 #

 
3. manual method:

Press the c key to enter the grub command line: (press the TAB key under the grub command line to obtain the grub Command help and possible grub Command Options)

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 0x83 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

 
(Load kernel modules that support system hardware before kernel boot-initrd image file-/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.