Wednesday, January 11, 2012

Fixing Grub After Installing Windows All Affected



1. Booting to a Linux Live CD or PenDrive Linux

2. Create a directory for mounting it, for example:

$ Sudo mkdir / media / root


3. Mounting the root directory, proc and dev

adjust its device number, yes, I happen to have its root directory on sda4.

$ Sudo mount / dev/sda4 / media / root
$ Sudo mount-t proc none / media / root / proc

$ Sudo mount-o bind / dev / media / root / dev

4. chroot mounting was

$ Sudo chroot / media / root / bin / bash

5. then type grub

# grub

grub> find / boot/grub/stage1

(hd0, 3)

grub> root (hd0, 3)

grub> setup (hd0)

Checking if "/ boot/grub/stage1" exists ... yes
Checking if "/ boot/grub/stage2" exists ... yes

Checking if "/ boot/grub/e2fs_stage1_5" exists ... yes

Running "embed / boot/grub/e2fs_stage1_5 (hd0)" ... Â 16 sectors are embedded.

succeeded

Running "install / boot/grub/stage1 (hd0) (hd0) 1 +16 p (hd0, 3) / boot/grub/stage2

/ boot / grub / menu.lst "... succeeded

Done.

grub> quit

6. restart

No comments:

Post a Comment