glasnhost
August 26th, 2009, 05:53 PM
Hi,
I had a working dual boot PC WindowsXP+Ubuntu.
When I reinstalled windows, ubuntu disappeared from the boot list.
I discovered that this is a well known problem and I tried the steps in
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
and its many variations.
However grub fails at the command "setup" with "error 12 invalid device requested":
ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda5 /mnt/root
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/root/dev
ubuntu@ubuntu:~$ sudo chroot /mnt/root /bin/bash
root@ubuntu:/# sudo grub
sudo: unable to resolve host ubuntu
Probing devices to guess BIOS drives. This may take a long time.
root@ubuntu:/# sudo grub
grub> find /boot/grub/stage1
(hd0,5)
grub> root (hd0,5)
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)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... failed
Error 12: Invalid device requested
grub>
I also tried grub-install:
ubuntu@ubuntu:~$ sudo mkdir /media/root
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /media/root
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/root /dev/sda
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
The file /media/root/boot/grub/stage1 not read correctly.My fdisk output is:
sudo fdisk -l
/dev/sda1 1 11 88326 de Dell Utility
/dev/sda2 * 12 8729 70027335 7 HPFS/NTFS
/dev/sda3 8730 14201 43953840 f W95 Ext'd (LBA)
/dev/sda4 13941 14201 2096451 dd Unknown
/dev/sda5 8730 13721 40098177 83 Linux
/dev/sda6 13722 13940 1759086 82 Linux swap / Solaris
I'll keep trying, if anybody has any suggestion, please let me know.
This problem is very annoying.
thanks
I had a working dual boot PC WindowsXP+Ubuntu.
When I reinstalled windows, ubuntu disappeared from the boot list.
I discovered that this is a well known problem and I tried the steps in
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
and its many variations.
However grub fails at the command "setup" with "error 12 invalid device requested":
ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda5 /mnt/root
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/root/dev
ubuntu@ubuntu:~$ sudo chroot /mnt/root /bin/bash
root@ubuntu:/# sudo grub
sudo: unable to resolve host ubuntu
Probing devices to guess BIOS drives. This may take a long time.
root@ubuntu:/# sudo grub
grub> find /boot/grub/stage1
(hd0,5)
grub> root (hd0,5)
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)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... failed
Error 12: Invalid device requested
grub>
I also tried grub-install:
ubuntu@ubuntu:~$ sudo mkdir /media/root
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /media/root
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/root /dev/sda
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
The file /media/root/boot/grub/stage1 not read correctly.My fdisk output is:
sudo fdisk -l
/dev/sda1 1 11 88326 de Dell Utility
/dev/sda2 * 12 8729 70027335 7 HPFS/NTFS
/dev/sda3 8730 14201 43953840 f W95 Ext'd (LBA)
/dev/sda4 13941 14201 2096451 dd Unknown
/dev/sda5 8730 13721 40098177 83 Linux
/dev/sda6 13722 13940 1759086 82 Linux swap / Solaris
I'll keep trying, if anybody has any suggestion, please let me know.
This problem is very annoying.
thanks