Grub : linux command not found

1

I'm having an issue and I hope someone can help me,

I installed ubuntu 12.10 on my computer (along side windows 7) from a live cd, but when I rebooted my computer after a succefull installation, I get grub prompt, when I type boot in it, it prints "Error 8: Kernel must be loaded before booting".

So I searched and I found this link : Loading Ubuntu From Grub, but when I type linux /vmlinuz root=/dev/sda5 I get this message "Warning! No such command: linux"

Does anybody have any idea about what I should do ?

Note that I reinstalled ubuntu but still get the same issue, and that this is not my first time installing ubuntu (I installed a lot of versions a dozen of times before and this is the first time I face this issue).

Edit :

When I type : kernel /vmlinuz root=/dev/sda5 instead of : linux /vmlinuz root=/dev/sda5 I get Error 15: File not found (I also tried sda4 since find /vmlinuz is printing hd(0,4))

Oussama

Posted 2012-10-30T11:53:18.800

Reputation: 111

Do you have any access to a shell? If so, try to locate the grub using this simple command -> <whereis grub> The command should return something like this -> grub: /usr/sbin/grub /etc/grub.conf /usr/lib/grub /usr/share/man/man8/grub.8.gz Then try to read your grub.conf file, perhaps you can solve the problem with this file.. If possible post your grub.conf file here.. – deepcell – 2012-10-30T11:58:35.363

Thank you for your response. I used the live cd to access a terminal and mounted the /dev/sda5 where my installation is, the command gave me this output : grub : /etc/grub.d /usr/lib/grub /usr/share/grub (I think these are the grub files for the live cd no ?), I executed I searched for grub.conf using find but I could not find it. – None – 2012-10-30T12:17:18.317

Try to use the information in this address -> https://wiki.archlinux.org/index.php/GRUB2#Manually_creating_grub.cfg

– deepcell – 2012-10-30T17:46:11.757

Answers

1

SCSI disk partitions numbering starts from 1, grub partition numbering starts from 0, therefore /dev/sda5 and hd(0,4) are the same.

What you wanted to say in the grub shell is

root (hd0,4)
kernel /vmlinuz root=/dev/sda5
initrd /initrd 
boot

It is likely that your Ubuntu installation did not complete. You may want to reinstall.

Dmitri Chubarov

Posted 2012-10-30T11:53:18.800

Reputation: 614

I did reinstall it but still same issue – None – 2012-10-30T15:41:48.710

1

Well, another alternative might be to re-install grub. Boot using a live disk and open a terminal.

$sudo mount /dev/sdax /mnt #x is the partition in which you have intalled ubuntu
$chroot /mnt
$grub-install --boot-directory=DIR /dev/sda  

#DIR is the directory where your boot/grub2 folder is in my case it is /dev/sda6/boot/grub2 . In your case it must be a different sdx. You have to figure it out.

$update-grub2

Nehal J Wani

Posted 2012-10-30T11:53:18.800

Reputation: 493

There is no grub2-install command, there is grub-install, I tried executing it and it gives me : "Path '/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting" – None – 2012-10-30T15:50:55.317

1I'm sorry grub2-install is in fedora. In ubuntu it is just grub-install. The error that you are reporting arises when your boot folder is in different partition than the one in which your / is . This is the same reason as to why you are unable to boot from grub rescue. It is possible, but it is a bit tricky. For my method, you can see my updated post. – Nehal J Wani – 2012-10-30T17:08:35.423

It would be helpful if you could post the output of the command sudo fdisk -l – Nehal J Wani – 2012-10-30T17:11:55.220

Did you use these set of commands? (i)set root=(hd0,4) (ii)linux /vmlinuz root=/dev/sda4 (iii)initrd /initrd.img (iv)boot – Nehal J Wani – 2012-10-30T17:19:04.503

I did try those commands (see my edit in my question), as for your previous comment, I will try that asap and tell you what I get. thank you for your help – Oussama – 2012-10-31T12:07:58.653