4

I have two hard drives, with two corresponding Grubs. One is from Arch Linux, and the other is from Ubuntu. Using Arch's grub, I can boot into either distribution. However, using Ubuntu's grub, I can see both Arch and Ubuntu, but cannot boot into Arch. I get the error:

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

I compared grub.cfg for both distributions. In Ubuntu's grub, I can see an entry for Arch, with the following line.

initrd /boot/intel-ucode.img

I changed it to follow Arch's grub.cfg:

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

Now I can boot into Arch from Ubuntu's grub. It appears that Ubuntu is not appending this required option by default. How can I make Ubuntu automatically create the correct entry?

Edit

I'm updating Arch's grub with grub-mkconfig -o /boot/grub/grub.cfg. In Ubuntu, I've tried both update-grub and the raw command above (which it is aliased to).

Edit 2

The uncommented lines of /etc/default/grub

GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="3"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
  • Did you tried with "update-grub" and "grub-mkconfig" commands? – MasterPiece May 26 '15 at 0:00
  • @MasterPiece Yes, sorry, I've clarified in an edit. – Sparhawk May 26 '15 at 0:27
  • update-grub2? It's a bit different. I believe the latest ubuntu uses that. Can you also drop in your grub.cfg. Odds are you just need an entry for ArchLinux in your config. I'm surprised it wasn't auto detected. – csgeek May 26 '15 at 0:39
  • update-grub2 is aliased to update-grub. I actually do see an Arch entry, and it is detected; it just has the wrong settings. I'll clarify in an edit. – Sparhawk May 26 '15 at 0:44
  • 1
    There's a bug report on bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1635781 – Bohr Feb 10 '17 at 8:22
2

Actually, there are two files that need to be modified to solve this problem. I've tested this on my Lubuntu 16.04.1 and Manjaro Linux.

In Ubuntu:

1) File /usr/lib/linux-boot-probes/mounted/40grub2 there is a function parse_grub_menu that doesn't handle all initrd parameters. You need to modify 'case "$1" in ... initrd)':

a) remove assignment

initrd="$(echo "$2" ...)"

b) add two lines in place of the removed one:

shift 1
initrd="$(echo "$@" | sed 's/(.*)//')"

2) File /etc/grub.d/30_os-prober within a for loop fix the assignment of LINITRD:

for LINUX in ${LINUXPROBED}; do
...
    LINITRD="`echo ${LINUX} | cut -d ':' -f 5 | tr '^' ' '`"

The first fix takes all available initrd info for Manjaro into account. The second fix cleans up the generated initrd line by changing some '^' characters to spaces.

2

I'm running Manjaro and Arch but, ironically, Manjaro will make a similar mistake as Ubuntu. So perhaps the following patch in 30_os_prober can still help someone.

After:

LINITRD="`echo ${LINUX} | cut -d ':' -f 5 | tr '^' ' '`"

Add:

if [ "${OS}" = "Arch Linux" ] ; then
  LINITRD="/boot/intel-ucode.img ${LINITRD}"
fi
  • Hi, Naiky. I'm no longer using Ubuntu, nor dual booting, so I can't test this any more. Thank you for posting though, and welcome to SE. +1 for your effort joining and posting! – Sparhawk May 19 at 21:34

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.