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.
/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.
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.