MBR recovery with live cd

[root@client ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 10G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 9.5G 0 part
├─VolGroup-lv_root (dm-0) 253:0 0 8.5G 0 lvm /
└─VolGroup-lv_swap (dm-1) 253:1 0 1G 0 lvm [SWAP]
[root@client ~]# dd if=/dev/zero of=/dev/sda bs=1 count=446
446+0 records in
446+0 records out
446 bytes (446 B) copied, 0.0100412 s, 44.4 kB/s
[root@client ~]# init 6[root@client ~]# Connection to 192.168.122.199 closed by remote host.
Connection to 192.168.122.199 closed.

By above command i will corrupt grub
Once i reboot u can see the effect of above command

Select No In above screen

[root@localhost ~]# lsblk

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda      8:0    0   10G  0 disk

├─sda1   8:1    0  300M  0 part /boot

├─sda2   8:2    0  8.7G  0 part /

└─sda3   8:3    0    1G  0 part [SWAP]

sr0     11:0    1  3.6G  0 rom  /media/CentOS_6.7_Final

Installing GRUB using grub-install

go to linux rescue mode then.to reinstall grub.conf follow this one of the method..
1)check that grub.conf exists r not.
check in the cmd pmt about older kernel version,then install same kernel and enjoy…then automatically you will get grub.confif not then install grub by this method;
if it has server with nfs image then select user mode 1
for eg:
chroot /mnt/sysimage
grub install /dev/sda
exit
then type grub
grub> root (hd0,0)
grub> setup (hd0)
quit
restart

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s