Linux Beginner-System startup failure Chapter

Source: Internet
Author: User

Linux Beginner-System startup failure Chapter

In the operation of the system, sometimes accidentally deleted or the operation error caused the system to start up, the following will enumerate several common system startup failure and the solution.

1. Delete or overwrite 446 bytes of MBR

The 446 bytes of the MBR specify that the/boot partition is on the disk in the system startup, so the MBR 446 bytes if deleted or overwritten will cause the system to not find the/boot partition and cannot be opened.

For example, use "dd If=/dev/zero Of=/dev/vda bs=446 count=1" to overwrite the first 446 bytes. Reboot system Discovery failed to start.

The solution to this situation is to:

A, a disc with a system image is required. and boot from the CD.

B. Select the "Troubleshooting" after startup.

C. Select "Rescue a Red Hat Enterprise Linux System".

D, enter "1" and press ENTER.

E, enter "Chroot/mnt/sysimages" to enter the real/boot.

F, enter "Grub2-install/dev/vda", wait for the installation to complete, and prompt "NoError reported".

When the above operation is complete, enter "Exit" two times. Switch back to boot from the hard disk. can solve this problem.

2. Delete boot file "Grub.cfg"

"/boot/grub.cfg" is the boot file of the system boot, for example, if you delete this file, the system will enter the following interface after booting.

This problem should be solved when you need to know their/partition and boot partition in which partition, the local/partition under the VDA3 partition, boot partition under the VDA1 partition. The steps to resolve are as follows:

A, enter "set root= ' hd0,msdos1 '". Press ENTER. "MSDOS1" represents the location of the boot partition.

B, enter "linux16/vmlinuz-3.10.0-327.e17.x86_64 ro Root=/dev/vda3". Press ENTER. "/dev/vda3" is the location of the/partition.

C, enter "Initrd16/initramfs-3.10.0-327.el7.x86_64.img". Press ENTER.

D, enter "boot". Press ENTER.

After completing the above steps, the system can be started, but the "grub.cfg" file is not deleted after startup. The next time it does not start properly, you need to enter the command "Grub2-mkconfig >/boot/grub2/grub.cfg" To recover this boot boot file.

3. Delete Boot hardware device files

If you remove the boot hardware device under/boot, such as "vmlinuz-3.10.0-327.e17.x86_64", the system will not start as shown in. Startup failed, and the file "vmlinuz-3.10.0-327.e17.x86_64" is missing.

The solution at this point is to disassemble the package in the image and restore the file with the following steps:

A. Start with a disc image. Select "Troubleshooting", select "Rescue a Red Hat Enterprise Linux System", enter "1" and press ENTER.

B, enter "DF" to see the disc "/dev/sr0" mounted under "/run/install/repo".

C, enter "Cd/mnt/sysimage//mnt", and enter "rpm2cpio/run/install/repo/packages/kernel-3.10.0-327.e17.x86_64.rpm | Cpio-id ", disassemble" kernel-3.10.0-327.e17.x86_64.rpm "this installation package. When you are finished, you can see the boot directory with the "vmlinuz-3.10.0-327.e17.x86_64" file that was previously deleted.

D, enter "MV Vmlinuz-3.10.0-327.e17.x86_64/mnt/sysimages//boot".

After the file is restored, enter "Exit" and set the boot from the hard disk. The system will start normally.

4. Delete system initialization files

If you delete the system's initialization file under the/boot directory, such as "initramfs-3.10.0-327.el7.x86_64.img", the system does not start properly and the file is less prompt, as shown in.

The solution at this point is:

A. Boot from the disc image. Select "Troubleshooting", select "Rescue a Red Hat Enterprise Linux System", enter "1" and press ENTER.

B, enter "Chroot/mnt/sysimages", enter the real "/boot".

C, enter "mkinitrd/boot/initramfs-$ (UNAME-R) $ (uname-r)". Where "$ (uname-r)" is the kernel version number, which is automatically found and added after it is entered.

D. Enter two "exit" after completion and start again from the hard drive.

5. Forget the root user password

If you forget the root user password, you can modify it at system startup. The specific steps are as follows:

A, the system start Select Interface press the up and down keys to stop it, as shown in.

B, Press "E", enter the configuration interface.

C, find the content of the linux16, from the back to delete, until the removal of "ro" can. As shown in. When finished, enter "RW Rd.break". Press "Ctrl+x" to continue, a shell will appear.

D, enter "Chroot/sysroot", and then enter "passwd" to change the password.

E, enter "Touch/.autorelabel".

After completion, enter two times "exit" to complete the system continue to start, complete the change root user password.

6. Delete/boot

If you delete/boot, there is no doubt that the system is not up.

You need to follow these steps to recover:

A. Boot from the disc image. Select "Troubleshooting", select "Rescue a Red Hat Enterprise Linux System", enter "1" and press ENTER.

B, enter "Chroot/mnt/sysimages" to enter the real "/boot".

C, enter "Grub2-install/dev/vda".

D. Enter "Mount/dev/sr0/opt" to mount the disc under/OPT.

E, "rpm-ivh/opt/packages/kernel-3.10.0-327.e17.x86_64.rpm--force", forcibly reinstall the kernel installation package.

F, "Grub2-mkconfig >/boot/grub2/grub.cfg", Resume boot boot file.

After completing the above steps, enter two "exit" and set the boot from the hard drive, the system will start normally.

Linux Beginner-System startup failure Chapter

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.