0

I have dualboot on my laptop with windows being the primary OS. Today after my linux os froze I hard rebooted the laptop. After that I got a kernel panic. I've been trying to solve it using GRUB.

I did:

#first 
set root = (hd0,msdos3) #this is where my linux os is
#second
linux /boot/vmlinuz-4.13.0-45-generic root=/dev/

and at this point I don't see sda or any sdX folder which I can mount to root. Can it be in another folder or should I look somewhere else?

I'm following these instrunctions that a friend of mine told me to follow.

set root = (linux partition)
linux /boot/vmlinuz... root=/dev/sda1
initrd /boot/initrd.img...
boot
  • I'm not very experienced linux user. If you could clarify whay you mean. I think I reached someting that was (insmod) shell after I didn't specify root. – That Guy Jul 3 '18 at 13:29
  • I got kernel panic again. – That Guy Jul 3 '18 at 13:41
1

GRUB is weird and uses a weird naming scheme. (hd0,msdos3) means "first disk, third partition using msdos partition table". (if you're using GRUB legacy and not GRUB 2, it would be "fourth partition", as GRUB legacy has partitions starting at 0)

Simply change sda1 into sda3 (or sda4, depending on what GRUB version this config is from) and voila.

set root = (hd0,msdos3)
linux /boot/vmlinuz-4.13.0-45-generic root=/dev/sda3

This assuming that

  1. your Linux OS really is on hd0,msdos3
  2. your kernel image really is named "vmlinuz-4.13.0-45-generic" (depending on the distribution you use it would be simpler and safer to just use the usual /linux, /vmlinuz-linux or /boot/vmlinuz-linux copies/links that always reflect "default" kernel image.

Also, can't you just choose a different boot option? All user-friendly distros come with alternative (fallback) boot options. Hold Shift (I think it was left Shift) during boot (more precisely, it needs to be held between the BIOS startup and OS startup) to see the GRUB menu with all the options.

Lastly, there is always a chance that Windows messed something up. It's notorious for behaving like an elephant in a china shop on updates, wrecking booting configurations, bootloaders and partitions.

  • I don't have root=/dev/sdaX (where x is a number) option. Should I just reinstall? – That Guy Jul 3 '18 at 21:57
  • In the GRUB menu? It should be called something else, usually the name of the system, like "Ubuntu 16.04" or "Launch Ubuntu". All the behind-the-scenes stuff is hidden (but you can see and edit it if you press e with an option selected). You can reinstall, but this may be recoverable, so why not just try? And if you do decide to reinstall, make sure to back-up whatever was important. – Deuxis Jul 4 '18 at 10:27

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.