Hi All,
When was recovering the mbr in grub2 in centos 7.3 i accidently mounted the rhel 7 iso and updated the /boot/grub2/grub.cfg, now its flashing the grub rescue prompt, any suggestion how to proceed further to recover my os.
Regards
Kannappan M
grub rescue error
Re: grub rescue error
How much of the MBR did you write? If it's *really* only the MBR, just restore the MBR from a working machine (assuming on UEFI here).
Re: grub rescue error
HI It is not EFI machine it is my vm machine, i did mbr
dd if=/dev/zero of=/dev/sdc bs=512 count=1
so from here could u pls give me the further steps
dd if=/dev/zero of=/dev/sdc bs=512 count=1
so from here could u pls give me the further steps
Re: grub rescue error
If you really have done this you have nuked the partition table of /dev/sdc.knzzz wrote:dd if=/dev/zero of=/dev/sdc bs=512 count=1
I guess it's time for restoring the backup.
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/
Re: grub rescue error
I seem to remember that there may be some tools that can scan your disk and possibly extract enough info to recreate the mbr/partition table.
Google and see if you find something.
Google and see if you find something.
Re: grub rescue error
That means write zeros over the sdc disk for a length of 512 bytes. What you've done is overwrite the bootrap, the partition tbale and the signature with zeros. The following are the sizes for an MBR ("classic" BIOS):dd if=/dev/zero of=/dev/sdc bs=512 count=1
446: Bootstrap.
64: Partition table.
2: Signature.
If you have a disk with the same partition layout and size (both physical and logical) as the broken (sdc) disk you could do:
dd if=/dev/<disk_that_works> of=<removable_media_mountpoint>/mbr.bak bs=512 count=1
dd if=<removable_media_mountpoint>/mbr.bak of=/dev/sdc bs=512 count=1 # NOTE: 512 bytes will be bootstrap and partiting information, use 446 for only the bootstrap.
Another way of copying a partition table:
sfdisk -d /dev/<disk_that_works> > <removable_media_mountpoint>/<disk_that_works>.partition.table
sfdisk -f /dev/sdc < <removable_media_mountpoint>/<disk_that_works>.partition.table
Otherwise you're looking at something like TestDisk, SystemRescueCD or even gpart to see if repair is possible. Something in the back of my mind tells me that there is a "backup" partition table, maybe there is or maybe there is not, but either way one of the above tools could probably tell you.
Re: grub rescue error
GPT partitioning has a backup partition table at the end of the disk.aks wrote:Something in the back of my mind tells me that there is a "backup" partition table, maybe there is or maybe there is not
MBR partitioning has not.
German speaking forum for Fedora and CentOS: https://www.fedoraforum.de/