Linux Repair MBR sector failure

Source: Internet
Author: User

Add a hard disk to the virtual machine to back up the information for the MBR

Fdisk-l See if the hard drive system knows

Fdisk/dev/sdb to Partition

Fdisk-l See if the partition is out

Mkfs-t EXT4/DEV/SBD1 for formatting

Mkdir/backup

Mount/dev/sb1/backup Mount to Backup

Do a backup before destroying the MBR, back up the system with:

DD IF=/DEV/SDA Of=/backup/sda.mbr.bak bs=512 count=1 back up the SDA front 512 bytes to the backup directory

Ls/backup to see if there are any files backed up

Simulating the destruction of MBR sectors

DD If=/dev/zero OF=/DEV/SDA bs=512 Count=1 destroys the first 512 bytes of the SDA device through a zero file. Because MDMDR exists on the first 512 bytes of this disk

Reboot start the system to see what will be found, can not enter the system.

into the repair mode, no Repair mode can be entered into the disc system. Then bring up the command prompt window. Fdisk-l See if there are any additional disks. Then perform the following command to restore the backup. Rebooting the system is normal.

Fix Grub Boot failure:

The following shows how grub was compromised and how the system started

vim/boot/grub/grub.conf edit this file

Reboot the system and do the operation at the grub prompt

Root (hd0,0) specifies which partition of the hard drive to boot the operating system from

kernel/vmlinuz-(tab) RO root=/dev/sda1 (primary file system) executes from which kernel to boot the system RO back mounted file system in what way to mount Root to represent the location of the root partition

initrd/initramfs-2.6.32

Boot

Linux Repair MBR sector failure

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.