Jump to content






Photo

LINUX-MBR RECOVER



Linux -Mbr recover

To copy out the mbr and boot record from the thumb drive
dd if=/dev/source of=/dev/destination
example
dd if=/dev/sdb of=/dev/sdc (thumb drive copy to thumb drive)
dd if=/dev/sdb of=/root/bootbackup/sdbxyz.bin (thumb drive to a file)
dd if=/root/bootbackup/sdbxyz.bin of=/dev/sdb (file to thumb drive)

another ways to do backup only partially tested
for new empty usb disc, create partition for the usb disc
1. boot with centOS rescue disc

2. create partition for the new usb disc
-fdisk /dev/sdb (sdb sevice detected by linux)
-n , primary, 1 , a, 1 , w
3. format the partition with ext3 filesystem
-mkfs.ext3 /dev/sdb1
4. mount the thumb drive to /boot
-mount /dev/sdb /boot
5. chroot /mnt/sysimage

6. mount /dev/sdb1 into /boot

7. grub-install /dev/sdb

note: if you saw this message, "unable to resolve /boot/grub/..." means
the device are not mounted to /boot

8. after run the "grub-install /dev/sdb" u will saw the message as below
(fd0) dev/fd0
(hd0) dev/sda
(hd1) dev/sdb
(NOTE:DUN INSTALL THE GRUB IN DEV/SDA IT CANT CORRUPT THE SYSTEM)

9.reboot the machine, and remove the rescue disc ,u will come to this screen
grub>

10.setup (hd1)
**hd1 is the /dev/sdb, take note, dun install the mbr in /dev/sda (hd0)
it might corrupt the system

11.unplug the usb disc and copy the boot folder from the backup source and remenber not
to over write anything in it.

eg:
cp -vf * /media/
cp grub.conf /media/grub/
ln -s ./grub.conf menu.lst
cp splash.xpm.gz /media/grub/

12.reboot the machine with the usb disc.



  • 0


November 2014

M T W T F S S
      1 2
3456789
10111213141516
17181920212223
24252627282930

Recent Entries

My Blog Links

Tags

Tags