In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what linux single-user mode repair system failures, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Single user mode
The Linux system provides a single-user mode (similar to Windows security mode) and can be maintained in a minimal environment. In single-user mode (runlevel 1), Linux boots into the root shell, the network is disabled, and only a few processes are running. Single user mode can be used to modify file system corruption, restore configuration files, move user data, and so on.
Here are several typical cases of repairing system failures in single-user mode:
Case 1: forget the root password
In single-user mode, Linux does not need a root password (Red Hat systems do not need a root password, but SuSe does, and different Linux systems are slightly different. This article uses Fedora Core 6 as an example), which makes it very easy to change the root password. It is important to understand how to enter single-user mode when the system fails to boot into multi-user mode.
1. During the startup of the system, the start interface will appear and press any key to enter the GRUB menu option. (if you want to avoid this prompt in the future, go directly to the GRUB menu option and delete the "hiddenmenu" item in the configuration file grub.conf. )
2, press the "e" key to edit the GRUB boot menu options, press the "e" key after the GRUB screen. Move down to the kernel line with the arrow keys and press the "e" key
3. Add single at the trailing cursor, press enter to return to the previous screen, press the "b" key to boot, and the system automatically enters single-user mode. If you want to change the root password, execute the command: sh-3.1# passwd root
After the change is successful, execute the command exit to exit and restart.
You can correct many problems that prevent the system from starting normally in single-user mode, such as:
1. Disable services that may stop the system. For example, if you disable the Samba service, execute: sh-3.1# chkconfig smb off the next time the system boots, the Samba service will not be started.
2. Change the default run level of the system. If X Window fails to start or fails, you can edit the / etc/inittab file, log in as text, and change the initdefault boot level to 3:id:3:initdefault:
Case 2: hard disk sector disorder
The most common problem encountered in the startup process is that the hard disk may have bad tracks or sector confusion (data damage), which is mostly caused by abnormal power outage and abnormal shutdown.
When this problem occurs, when the system starts, the screen displays:
Press root password or ctrl+D:
At this point, enter the root password system to automatically enter single-user mode, enter:
Fsck-y / dev/hda6
(fsck is the file system detection and repair command, "- y" sets the error detected to automatically repair, / dev/hda6 is the hard disk partition where the error occurred, please change this parameter according to the specific situation)
After the system is repaired, restart it with the command "reboot".
Case 3. GRUB option setting error
"Error 15" shows that the system cannot find the kernel specified in grub.conf.
GRUB boot error message, we observed that because of the typing error, the kernel file "vmlinuz" was typed as "vmlinux", so the system could not find the kernel executable file.
We can press any key to go back to the GRUB editing interface, correct this error, enter and save, press the "b" key to boot normally, of course, don't forget to modify the error here in the grub.conf file after entering the system.
This is a mistake that many novice Linux users are easy to make when modifying GRUB settings. When this black screen prompt appears, pay attention to observe the error message and fix it.
The above is all the contents of the article "what are the faults of the linux single-user mode repair system?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.