/dev/sda does not have any corresponding BIOS drive.

Asked by Karl.Mo

I am unable to boot into Ubuntu (Intrepid) I recently installed windows and after installing it I ran a live cd to restore grub but when I type in "find /boot/grub/stage1" I receive "Error 15: File not found" In checking my /boot/grub I only have
 default device.map menu.lst menu.lst~
 I have tried to run "grub-install /dev/hda" to restore the files but I end up with "/dev/sda does not have any corresponding BIOS drive."
Here is the output to fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfeebaf6a

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 5740 46106518+ 7 HPFS/NTFS
/dev/sda2 5741 18746 104470695 f W95 Ext'd (LBA)
/dev/sda3 18747 19457 5711107+ b W95 FAT32
/dev/sda5 5742 14613 71264340 83 Linux
/dev/sda6 14614 18503 31246393+ 83 Linux
/dev/sda7 18504 18746 1951866 82 Linux swap / Solaris
I also tried supergrub disk but had no success.
So the question is what does '/dev/sda does not have any corresponding BIOS drive' mean? And how can I fix it?

Karl.Mo

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Karl.Mo
Solved:
Last query:
Last reply:
Revision history for this message
Wyatt Smith (wyatt-smith) said :
#1

Your grub folder is missing quiet a few files.
Please copy all the files from

/usr/lib/grub/i386-pc
to
/boot/grub

Then you can reinstall grub

sudo grub
grub> find /boot/grub/stage1
grub> find /grub/stage1

One of the above commands should return your Ubuntu partition in the form of (hdX,Y) where X and Y are numbers, for example (hd0,4), but use whatever it returns as follows:
Code:

grub> root (hdX,Y)
grub> setup (hdX)
grub> quit

Hope this helps

Revision history for this message
Karl.Mo (partyboi2) said :
#2

Thanks wyatt, I copied over the contents of /usr/lib/grub/i386-pc to /boot/grub but when I type in
find /boot/grub/stage1
 I receive
 Error 15: File not found

Revision history for this message
Remy Pagniez (remy-pagniez-deactivatedaccount) said :
#3

Yes you can have an error like "Error 15: File not found". So try the other command "
grub> find /grub/stage1" as Wyatt Smith explained you above...

There is informations about how to restore grub from a livecd here :
http://ubuntuforums.org/showthread.php?t=224351
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Hope that's will help you...

Revision history for this message
Karl.Mo (partyboi2) said :
#4

I have tried both those guides to restore grub already but thanks anyway. I have made a little progress and now when I do
grub> find /boot/grub/stage1
I get (hd0,5)
 as I am meant to, but when I input the 2nd command I get
grub> find /grub/stage1

Error 15: File not found

Revision history for this message
Remy Pagniez (remy-pagniez-deactivatedaccount) said :
#5

Ok! that's good.
You can continue to apply these tutorials...
In fact, if "find /boot/grub/stage1" works, you don't have to run "find /grub/stage1".

So that's mean, you can now run
sudo grub
grub> find /boot/grub/stage1

it will return you (hd0,5)

So now, you can run
grub> root (hd0,5)
grub> setup (hd0)
grub> quit

And you can reboot here...

Revision history for this message
Karl.Mo (partyboi2) said :
#6

This is is what happens when I follow those commands
grub> root (hd0,5)

grub> setup (hdo)
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"... succeeded
Done.

grub> quit
But when I reboot I get a error 2

Revision history for this message
Karl.Mo (partyboi2) said :
#7

I have also tried
sudo grub-install --root-directory=/mnt /dev/sda
which returns
The file /mnt/boot/grub/stage2 not read correctly.

Revision history for this message
Remy Pagniez (remy-pagniez-deactivatedaccount) said :
#8

There is another way to restore grub with a livecd
in a terminal, become root
"sudo -s"

I don't know how you partitioned your hard drive.
I supposed that /dev/sda5 is /boot and /dev/sda6 is /.
Correct next commands with your good data...

Mount all devices in a temporary folder:
"mkdir /mnt/tmp"
"mount /dev/sda6 /mnt/tmp"
"mount /dev/sda5 /mnt/tmp/boot"
"mount -o bind /dev /mnt/tmp/dev"
"mount -o bind /proc /mnt/tmp/proc"
"cp /proc/mounts /mnt/tmp/etc/mtab"

Go into the chroot:
"chroot /mnt/tmp/ /bin/bash"

Reinstall grub easily (or with the last method):
"/sbin/grub-install /dev/sda"

Exit the chroot
"exit"

Unmount all devices:
"umount /mnt/tmp/dev"
"unmount /mnt/tmp/proc"
"unmount /mnt/tmp/boot"
"unmount /mnt/tmp"

And reboot...

Revision history for this message
Karl.Mo (partyboi2) said :
#9

This is what happened
ubuntu@ubuntu:~$ sudo -s
root@ubuntu:~# mkdir /mnt/tmp
root@ubuntu:~# mount /dev/sda6 /mnt/tmp
root@ubuntu:~# mount -o bind /dev /mnt/tmp/dev
root@ubuntu:~# mount -o bind /proc /mnt/tmp/proc
root@ubuntu:~# cp /proc/mounts /mnt/tmp/etc/mtab
root@ubuntu:~# chroot /mnt/tmp/ /bin/bash
root@ubuntu:/# /sbin/grub-install /dev/sda
You shouldn't call /sbin/grub-install. Please call /usr/sbin/grub-install instead!

Could not find device for /boot: Not found or not a block device.
root@ubuntu:/# /usr/sbin/grub-install /dev/sda
Could not find device for /boot: Not found or not a block device.
root@ubuntu:/# grub-install --root-directory=/mnt /dev/sda
Could not find device for /mnt/boot: Not found or not a block device.
root@ubuntu:/#
I forgot to mention earlier that sda6 is my / partition and that sda5 is my /home partition, I don't use a separate /boot partition.

Revision history for this message
Karl.Mo (partyboi2) said :
#10

Well I managed finally get my ubuntu to boot, I ended up creating a dedicated grub partition. Don't understand why all of a sudden I have needed one as I have dual booted since dapper and have never had to use one. Anyway thanks Remy and Wyatt for your assistance.

Revision history for this message
Remy Pagniez (remy-pagniez-deactivatedaccount) said :
#11

A few weeks ago, i restored a grub with the "chroot" method on a computer with windows XP as you tried to do...
But i didnt used "/usr/sbin/grub-install /dev/sda", because i have an error too (i cant remember what the error was). So i used the method with:
grub> root (hdX,Y)
grub> setup (hdX)
grub> quit

And it worked perfectly...

In fact you can use a separate /boot partition but it's not required. So I think that your solution is not the "good" solution, you have another problem :) Something wrong happened when you upgraded your computer....

I'm sorry to not help you more. I'm not a Grub expert :'(

Revision history for this message
Karl.Mo (partyboi2) said :
#12

When my copy of Intrepid arrives from shipit I will probably do a clean install and remove the /boot partition and hopefully everything will be well. But in the mean time a /boot partition is a good enough workaround for me. Thanks for your help. :)