0

I installed kali 1.0.9a-amd64 a month ago on dual boot with windows 7,I created 4 partitions from it, one swap one /home one /boot and one / yesterday

I wanted to free another partition from windows for Ubuntu server so freed 10GB with wizard, downloaded from internet(same I used for kali, went well) went fine, today morning when I started my computer I had grub rescue mod. I couldn't solve it.

I tried almost everything. I can't even open BIOS. It doesn't work. I tried everything on forums: Found the Linux partition, then tried the set root set prefix method, then insmod normal then normal, on forums on that point it should boot normally and let me be able to fix the grub by reinstalling it. Instead I get the grub normal mode. Now I tried further solutions with that insmod loopback, Linux, iso9660, and fat(since the ISO was on USB) still after that I don't find the casper file nor the vmlinuz.

I find the vmlinuz just like that as "vmlinuz" no .efi at (hd0,msdos8)/ and I find initrd.img with it at that folder BTW, my prefix isn't /boot/grub its /usr/lib/grub(on forums it says /usr/lib/grub/i386-pc, but if I do that normal mode doesn't start it. Says normal.mod not found,it works with /usr/lib/grub/ though) any solutions please ? I am dying here

UPDATE :

After the set root set prefix insmod i went as usual to the normal grub screen,and i tried inintrd initrd.img and it booted into the usb drive,however all the choices(live,install,failsafe....) went too the same screen,black screen with nothing,untill hit ESC then it takes me to another black screen,saying boot: so i entered many choices,none worked,the oly one that seemed like good was /boot/efi.img but still it said failed to load kernel(pressing enter takes me back to the choice screen,the kali boot screen),so i burned ubuntu on the usb stick and now i can boot into it from the usb,i can access internet and stuff,what should i do now to fix it? + I can access BIOS now

  • yes regularr BIOS,havent made any change in it,can't acces the bios to make bootrepair mate,i can't no f2 no esc no delete no nothig it simply cant access the BIOS and the proof for that,is when i access the normal grub mode it doesnt show the boot choices as in the other solutions, nothing i can o to access bios,that link,is useless,because i can't boot at all,i can't neither sudo nor bootreapair nor nothing + i am not on ubuntu,am using kalii – LaravelOnly Mar 1 '16 at 20:54
  • I've never done it this way but here are some instructions on how to recover from the grub command line. If it doesn't take you to grub rescue, I'm pretty sure you just have to press C to enter grub command line. ibm.com/developerworks/library/l-GRUB2-features – mchid Mar 1 '16 at 20:57
  • Also, Toshiba bios is F2 in case it makes a difference. – mchid Mar 1 '16 at 20:58
  • Mate plz read my post carefully,your solution doesn't work i told you it doesn't work that way,i tried that aleady – LaravelOnly Mar 1 '16 at 21:00
  • You need to run the individual lines from what should be the regular config one by one as single commands. If I read correctly, (hd0,msdos8) is this the partition that contains Kali. Usually, there is not a separate partition for boot as one is not needed for a standard MBR/ legacy BIOS type setup vmlinuz and initrd.img are usually linked to individual files in /boot so you may have to specify those accordingly using the full path to each file (vmlinuz* and initrd.img*) found in the boot partition instead of (hd0,msdos8). – mchid Mar 1 '16 at 21:17
1

1) From grub rescue:

Type the following commands:

ls (hd0,msdos8)/
set root=(hd0,msdos8)
set prefix=(hd0,msdos8)/boot/grub
insmod linux
insmod normal
normal
boot

If you get an error with insmod normal try with insmod.old or insmod linux

2) Boot from live CD

Reinstall Linux images on your boot partition

sudo mount /dev/sday /mnt/myroot/boot 

and

   sudo mount ‐‐bind /dev /mnt/myroot/dev
   sudo mount ‐‐bind /proc /mnt/myroot/proc
   sudo mount ‐‐bind /sys /mnt/myroot/sys

Mount all of your other partitions /boot,/var,/usr,/tmp etc. Make sure you have mounted them all.

Copy resolv.conf

 cp -L /etc/resolve.conf /mnt/example/etc/resolve.conf

chroot

 sudo chroot /media/bin:/sbin:/usr/bin:/usr/sbin /mnt/tmp...

Reinstall missing kernel image

move initrd.img from root:

   mv initrd.img initrd.img.OLD

install Linux image

  apt-cache search 'linux-image'
  apt-get install linux-image-x.x-generic

Replace linux-image-x.x-generic with yours.

restore grub

sudo grub-install /dev/sdX

Reboot

  • doesn't work + already told you,my prefix is (hd0,msdos8)/usr/lib/grub + when i set it the right way and do the normal command,it takes me o the grub screen if i enter boot there it says error you need to load the kernel first – LaravelOnly Mar 2 '16 at 13:32
  • @mmrrobot Try setting your prefix to the boot partition instead but keep the root set as msdos8. Normally, when the system is running, fstab mounts the boot partition to the /boot directory in the filesystem which is why your /boot directory is empty. For example, if the boot partition is msdos7, set the prefix to (hd0,msdos7)/grub or (hd0,msdos7)/ Additionally, use ls (hd0,msdos7)/ to display the contents to see if that's where your vmlinuz and initrd.img files are at. – mchid Mar 2 '16 at 21:09
  • @gad3r I think it says to load the kernel because you forgot to add the initrd and linux lines that specify the location of the initrd and vmlinuz files. – mchid Mar 2 '16 at 21:15
0

If you get the normal prompt rather than a menu, it is because you are missing your /boot/grub/grub.cfg to tell it what to put on the menu. Manually load the kernel with:

set root=(hd0,msdos8)
linux /vmlinuz root=/dev/sda8
initrd /initrd
boot

After successfully booting, run update-grub to generate grub.cfg.

  • doesn't work says error initrd not a command(in the rescue page) if i try it in the grub screen (is displayed after i set root and set prefix and insmod normal) it says need to load kernel first – LaravelOnly Mar 2 '16 at 13:36
  • @mmrrobot, yes, you need to get to normal mode first. Sorry, I tend to get the linux and initrd commands backwards; just swap their order. – psusi Mar 2 '16 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.