Linux emergency mode

Source: Internet
Author: User
Article Title: linux emergency mode. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Improper modification of/etc/fstab,/etc/rc. d/rc. sysinit and other system startup files

Linux cannot be accessed, and a rescue disk can be easily repaired. This method is suitable

Repair the system when the rescue disk does not exist.

[Color = "#000000"] Select linux [color = "#007700"] From the grub menu. [color = "# 0000bb"] by e [color = "#007700"], [color = "# 0000bb"] e [color = "#007700"], enter edit mode,

Kernel [color = "#007700"] ([color = "# niubb"] hd0 [color = "#007700"], [color = "# BB"] 0 [color = "#007700"]) /[color = "# 0000bb"] vmlinuz root [color = "#007700"] =/[color = "# 0000bb"] dev [color = "#007700"]/[ color = "# BB"] hda2 [color = "#007700"] ...... add at the end of this line

Init [color = "#007700"] =/[color = "# niubb"] bin [color = "#007700"]/[color = "# niubb"] bash [color = "#007700"], [color = "# 0000bb"] After modification, press enter [color = "#007700"], B boot

The modified boot information is similar to the following:

Kernel (hd0, 0)/vmlinuz root =/dev/hda2 init =/bin/bash

In this way, the boot system can get a bash shell

The system is read [color = "#007700"]-[color = "# 0000bb"] only [color = "#007700"]. First, use fsck to check the system.

Fsck [color = "#007700"]-[color = "# BB"] a [color = "#007700"]/[color = "# BB"] dev [color = "#007700"]/hdaX process the root partition X is the root Partition Number, such as hda2

Fsck [color = "#007700"]-[color = "# BB"] R [color = "#007700"]-[color = "# BB"] A [color = "#007700"]-a processes other partitions

If the system is restarted normally, the file system is uninstalled normally,

You can directly mount the system to read [color = "#007700"]-write without using the fsck check.

[Color = "#000000"] mount [color = "#007700"]/[color = "# BB"] proc

[Color = "#000000"] mount [color = "#007700"]/-[color = "# niubb"] o remount [color = "#007700"], rw

[Color = "# BB"]

Swapon [color = "#007700"]-a opens all swap partitions

Source [color = "#007700"]/[color = "# 0000bb"] etc [color = "#007700"]/profile

After the system is repaired, Remount the system to ro to restart the system safely.

Mount [color = "#007700"]/-[color = "# niubb"] o remount [color = "#007700"], ro

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.