24 October, 2013

Reinstall Grub Windows XP/Debian

Run from Hirens Boot (Linux Live CD)

root:~#mount -f ext4 /dev/sdaX /mnt

(Where sdax is Partition with Debian)

root:~#grub-install /dev/sda --root-directory=/mnt 

(Here you do not write number of sda)

root:~#Reboot

root@bt:~# nano /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

### BEGIN /etc/grub.d/40_custom ###
(Add This Lines)

menuentry "Windows XP (on /dev/sda1)" {
 insmod ntfs
 set root=(hd0,1)
 chainloader +1
}

Done !