You are not logged in.

#1 2015-05-25 05:09:25

Salkay
Member
Registered: 2014-05-22
Posts: 618

[SOLVED]Can't boot: kernel panic

I was attempting to clean up my hard drives, by copying an old Ubuntu install from sdb to sda. I booted into Ubuntu (sda) to make sure it was working, then deleted the original Ubuntu (sdb) partitions. I then updated the Ubuntu system, including updating grub. Previously I had Arch's grub on sdb, and Ubuntu's grub on sda.

Arch's grub (sdb) now fails. This is fine, as Ubuntu's grub (sda) works fine. If I could boot into Arch, I could easily reinstall its grub. However, when I select Arch from Ubuntu's grub, it fails to boot, with similar text to the following.

Kernel offset
End kernel panic. Not syncing: VFS.
Unable to mount root fs on unknown-block.

Is there a way to restore Arch? fsck shows no errors, and I can mount the Arch partitions fine from within Ubuntu.

Last edited by Salkay (2015-05-25 10:33:38)

Offline

#2 2015-05-25 05:12:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]Can't boot: kernel panic

Chroot in and fix Grub...


Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-05-25 05:33:54

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED]Can't boot: kernel panic

Thanks. However, since my Ubuntu grub is working fine (with the Ubuntu root), doesn't that mean that it's something downstream (e.g. in Arch's root) that is broken as well? As stated in the OP, I can change the sdb grub at a later point, and use sda (Ubuntu) grub in the meantime.

(Also, I'm not 100% specifically how to "chroot in and fix Grub". Are you saying to boot from a live Arch DVD/USB? Or from the Ubuntu system?)

Offline

#4 2015-05-25 05:51:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]Can't boot: kernel panic

Grub is grub. If you are not using UUID's or labels, that is probably all it is. But without your partition table and grub config, it is impossible to say.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-05-25 06:05:49

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED]Can't boot: kernel panic

Thanks again. Perhaps I misunderstand, but (in Ubuntu, on sda) I ran `grub-mkconfig -o /boot/grub/grub.cfg`. One of the lines says `Found Arch Linux (rolling) on /dev/sdb5`, so I figured that grub was already okay. Doesn't that mean it was fixed already?

I'll be a bit more explicit, if that might help. Here is sda
http://i.imgur.com/v7OkyMu.png
and sdb
http://i.imgur.com/IuhaRmH.png

Previously, ubuntu_root and ubuntu_home were at the end of sdb, but I copied them to sda, booted into Ubuntu, deleted the sdb Ubuntu partitions, and extended the Arch ones. The Ubuntu-installed grub in sda works fine to boot Ubuntu, but not Arch. I'm not sure what grub config is required, but here is the output when I update it.

$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.19.0-18-generic
Found initrd image: /boot/initrd.img-3.19.0-18-generic
Found Windows 7 (loader) on /dev/sdb2
Found Arch Linux (rolling) on /dev/sdb5
Found linux image: /boot/vmlinuz-3.19.0-18-generic
Found initrd image: /boot/initrd.img-3.19.0-18-generic
Found Windows 7 (loader) on /dev/sdb2
Found Arch Linux (rolling) on /dev/sdb5
done


-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Last edited by jasonwryan (2015-05-25 06:43:45)

Offline

#6 2015-05-25 06:42:16

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: [SOLVED]Can't boot: kernel panic

Boot the Arch installer from usb, arch-chroot to victory.

Offline

#7 2015-05-25 10:04:42

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Can't boot: kernel panic

Salkay wrote:

copying an old Ubuntu install from sdb to sda

Just out of interest, how exactly did you achieve this?

EDIT: Awebb's solution should work but if you wish to investigate further you should examine /boot/grub/grub.cfg in your Ubuntu system.

Last edited by Head_on_a_Stick (2015-05-25 10:06:42)

Offline

#8 2015-05-25 10:31:59

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED]Can't boot: kernel panic

Thanks Awebb and jasonwryan (and apologies for not following the etiquette). This worked perfectly. To help future people, the full steps were to boot into the Live Arch USB, then run the following.

lsblk -f
mount /dev/sdb7 /mnt
mkdir /mnt/home
mount /dev/sdb8 /mnt/home
arch-chroot /mnt /bin/bash
grub-install --target=i386-pc --recheck --debug /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot now

I still don't totally understand why Ubuntu's grub couldn't see the Arch partition, and why the error occurred in the first place, but it's all fixed now.

Head_on_a_Stick wrote:
Salkay wrote:

copying an old Ubuntu install from sdb to sda

Just out of interest, how exactly did you achieve this?

I had some empty space on sda from a previous Windows partition, so I created a few partitions there with gparted, then used dd to copy the Ubuntu partitions over.

Last edited by Salkay (2015-05-25 10:32:21)

Offline

#9 2015-05-25 10:51:35

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Can't boot: kernel panic

Salkay wrote:
Head_on_a_Stick wrote:
Salkay wrote:

copying an old Ubuntu install from sdb to sda

Just out of interest, how exactly did you achieve this?

I had some empty space on sda from a previous Windows partition, so I created a few partitions there with gparted, then used dd to copy the Ubuntu partitions over.

What was the actual command you used?

From the gparted screenshot, /dev/sda starts on an "extended" partition so this may be why the grub configuration was not being updated properly (ie, a new grub.cfg was created but this was not read by the bootloader) -- I think re-installing GRUB from Ubunut would also have worked.

Anyway, you've fixed it now and I'm only asking this out of idle curiosity -- don't bother replying if you have more important stuff to do wink

Offline

#10 2015-05-25 10:59:17

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED]Can't boot: kernel panic

Head_on_a_Stick wrote:

What was the actual command you used?

From the gparted screenshot, /dev/sda starts on an "extended" partition so this may be why the grub configuration was not being updated properly (ie, a new grub.cfg was created but this was not read by the bootloader) -- I think re-installing GRUB from Ubunut would also have worked.

Anyway, you've fixed it now and I'm only asking this out of idle curiosity -- don't bother replying if you have more important stuff to do wink

I'm actually quite curious myself as to why it failed! These are the commands.

sudo dd if=/dev/sdb5 bs=1M | pv | sudo dd of=/dev/sda5 bs=1M
sudo dd if=/dev/sdb6 bs=1M | pv | sudo dd of=/dev/sda6 bs=1M

You are correct that they are now on extended partitions (but they were before too). I updated Grub (sdb) from Arch, then booted into Ubuntu (via Arch's Grub), then deleted the original Ubuntu partitions. I immediately updated Grub (sda) from Ubuntu, and booting via this Grub worked fine. Obviously, since I had deleted the Ubuntu partitions "out" of Arch, I had no way to update Grub (sdb) from within Arch. Perhaps the problem with Arch's Grub (sdb) was that it was expecting Ubuntu partitions that didn't exist?

Offline

#11 2015-05-25 11:21:23

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Can't boot: kernel panic

Salkay wrote:

Perhaps the problem with Arch's Grub (sdb) was that it was expecting Ubuntu partitions that didn't exist?

Yes, perhaps.

The answer lies in Ubuntu's grub.cfg -- examine the Arch entry in that file to determine how exactly it was attempting to load Arch.

Also:

# dd if=/dev/sdWX of=/dev/sdYZ bs=1M

Offline

#12 2015-05-25 23:08:40

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED]Can't boot: kernel panic

Ah good thought! For some reason, Ubuntu's grub.cfg was missing a bit in the Arch entry. It said,

initrd /boot/intel-ucode.img

I changed it to follow Arch's grub.cfg

initrd /boot/intel-ucode.img /boot/initramfs-linux.img

And now it works fine; I can boot into Arch from Ubuntu's grub. I'll ask on an Ubuntu site as to why it's not working by default.

Isn't your dd command identical to mine? I just pipe mine through pv so I can see the progress.

Offline

#13 2015-05-26 11:32:33

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Can't boot: kernel panic

Salkay wrote:

Isn't your dd command identical to mine? I just pipe mine through pv so I can see the progress.

Yes indeed -- sorry, I have an aversion to unnecessary commands and I didn't realise why you were using `pv`...
hmm

Glad you got to the bottom of this though -- I hate unsolved mysteries.

Offline

#14 2015-08-02 04:24:42

cribbageSTARSHIP
Member
Registered: 2015-07-31
Posts: 21

Re: [SOLVED]Can't boot: kernel panic

I just wanted to say thank you for posting this. You've saved me much frustration fixing my laptop after putting another distro on. +1 for you kind sir/madam!

Salkay wrote:

Thanks Awebb and jasonwryan (and apologies for not following the etiquette). This worked perfectly. To help future people, the full steps were to boot into the Live Arch USB, then run the following.

lsblk -f
mount /dev/sdb7 /mnt
mkdir /mnt/home
mount /dev/sdb8 /mnt/home
arch-chroot /mnt /bin/bash
grub-install --target=i386-pc --recheck --debug /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot now

I still don't totally understand why Ubuntu's grub couldn't see the Arch partition, and why the error occurred in the first place, but it's all fixed now.

Head_on_a_Stick wrote:
Salkay wrote:

copying an old Ubuntu install from sdb to sda

Just out of interest, how exactly did you achieve this?

I had some empty space on sda from a previous Windows partition, so I created a few partitions there with gparted, then used dd to copy the Ubuntu partitions over.

Offline

#15 2018-03-20 18:36:48

arobe176
Member
Registered: 2018-03-20
Posts: 10

Re: [SOLVED]Can't boot: kernel panic

Salkay wrote:

Thanks Awebb and jasonwryan (and apologies for not following the etiquette). This worked perfectly. To help future people, the full steps were to boot into the Live Arch USB, then run the following.

lsblk -f
mount /dev/sdb7 /mnt
mkdir /mnt/home
mount /dev/sdb8 /mnt/home
arch-chroot /mnt /bin/bash
grub-install --target=i386-pc --recheck --debug /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot now

I ran into a very similar problem that you did, so I tried running this, and now Arch's grub won't even recognize Ubuntu. Originally I had Arch installed on my computer, and I decided to try to dual boot with Ubuntu, so I went through everything and installed ubuntu on the remaining empty memory on my hard drive with a swap as well. I didn't have to move anything around I just took the 250 GB I wasn't using and put Ubuntu on it. Ubuntu booted fine and recognized Arch as bootable, but when I tried to boot it I got a similar error that you did, so I tried to fix it with your solution, and now I can boot into arch with its grub, but its grub doesn't say that I can boot into Ubuntu. Any ideas? You seem a lot better at this than I am.
A little more information, arch is on sda1-3 1 being /boot 2 being / and 3 being /home, I'm not entirely sure what sda4 is, it's only 1K, sda5 is my swap partition, and sda6 is where Ubuntu is.

Last edited by arobe176 (2018-03-20 18:37:19)

Offline

#16 2018-03-20 18:49:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: [SOLVED]Can't boot: kernel panic

Similar error or not, please do not necrobump. Create a new topic for your problem, and include exact error messages.

https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#17 2018-03-20 18:51:40

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]Can't boot: kernel panic

Welcome to the forums arobe176 smile

Please take the time to  familiarise yourself with the forums Code of Conduct, especially the section regarding old threads/necro-bumping.

Closing this old thread.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB