update-grub /usr/sbin/grub-probe: error: failed to get canonical path of `/dev/sdd2'.

Asked by Paullux

i have an error when i would like to update grub in chroot mode:

~# update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/sdd2'.
~#

Question information

Language:
English Edit question
Status:
Answered
For:
Cubic Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Cubic PPA (cubic-wizard) said :
#1

Perhaps other users can provide guidance on customizing the grub theme in a container environment.

Revision history for this message
Cubic PPA (cubic-wizard) said (last edit ):
#2

TRANSCRIPT FROM BUG REPORT..

Cubic PPA (cubic-wizard) wrote 1 hour ago: #1

Which version of Cubic are you using?
Which version of Ubuntu are you customizing?
Which version of Ubuntu are you running Cubic in?
Hide
Cubic PPA (cubic-wizard) wrote 1 hour ago: #2

The command `update-grub` invokes `grub-mkconfig`. See...

    $ cat /usr/sbin/update-grub

From https://linuxhint.com/grub2_mkconfig_tutorial/...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
What grub2-mkconfig Does:

grub2-mkconfig is a really simple tool. All it does is scan the hard drives of your computer for installed bootable operating systems (including Window, Mac OS and any Linux distributions) and generates a GRUB 2 configuration file. That’s it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Base on this, does `update-grub` `grub-mkconfig` make sense in the context of an an isolated chroot environment or container (Cubic version 2020.06) where there are no mounted "hard drives" with multiple bootable OSs?
Hide
Paullux (paulwoisard) wrote 49 minutes ago: #3

i use the release version of cubic
i customize kubuntu 20.04
the version of ubuntu is kubuntu 20.04

in one of my package i create a theme for grub and after i did update-grub to apply the new theme for the future os or when the people update the theme of grub, so it is not possible to retry update-grub for all user.

it's possible to detect if we are in cubic chroot environment ?
Hide
Paullux (paulwoisard) wrote 47 minutes ago: #4

my cubic folder is install in my /home partition in this disk there isn't grub
my grub is install in my SSD. i have a dual boot with windows 10
Hide
Cubic PPA (cubic-wizard) wrote 11 minutes ago: #5

(Just a note, Cubic 2020.06 in Ubuntu 18.04+ does not use a chroot environment any more, it uses a container).

Cubic doesn't know about Windows or other OSs installed on your host machine. It is an isolated environment. This avoids a situation where you configure a single OS in your virtual environment, and then you run update-grub. If there were no isolation, update-grub would go and update the grub configuration on your host computer, and make Windows inaccessible!

If you need to add additional grub entries, use the `/etc/grub.d` directory. Specifically, you can add your entries to /etc/grub.d/40_custom. I am sure you are already making changes to files inside `/usr/share/grub`, since you mentioned you have a customized grub theme.

There is no need to run grub-update inside Cubic, because this is taken care by the installer of when you install your customized OS, onto your computer.

In other words, you can ignore this error inside the virtual environment, or simply not run update-grub inside the virtual environment.

Also, please note that your grub theme changes will apply after your customized OS is installed. But the Live "CD" will still use the original Kubuntu theme. To change the theme for Grub for the Live "CD" you have to modify some other files in...

    /home/<your home directory>/<your cubic project name>/custom-disk

(Cubic only allows you to change the Grub ISO Boot files, but does not allow you to add custom images or fonts, etc. that those files may need. So if you need to change those, you have to do it using Dolphin, Kate, and other tools outside of Cubic).
Hide
Cubic PPA (cubic-wizard) wrote 4 minutes ago: #6

It also sounds like you need a way to control possible inadvertent changes to grub that might over-write you theme when users execute `apt install` or `appt-upgrade`.

A trick I use is to automatically execute a program after every package install. Perhaps you can do something similar...

Add an entry to `/etc/apt/apt.conf.d/80update`.
This entry should invoke a script that makes the updates/changes that you want.

For example, to the file:
    /etc/apt/apt.conf.d/80update
Add:
    DPkg::Post-Invoke {"/opt/apt/grub-blacklist-nouveau";};

Then create the file:
    /opt/apt/grub-blacklist-nouveau

With the contents:

#!/bin/bash

# Blacklist the Nouveau display driver for X.org is in Grub, if it is
# not already blacklisted.
#
# Usage: sudo grub-blacklist-nouveau

match=$(cat /etc/default/grub | grep 'modprobe.blacklist=nouveau')
if [[ ! $match ]]; then
    echo "Blacklist the Nouveau display driver for X.org in Grub."
    sed --in-place "s|splash|splash modprobe.blacklist=nouveau|g" /etc/default/grub
    update-grub
else
    echo "The Nouveau display driver for X.org is already blacklisted in Grub, so no changes are necessary."
fi
grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
echo

Revision history for this message
Cubic PPA (cubic-wizard) said :
#3

Oops, excuse the typo above.
It should have said "TRANSCRIPT FROM BUG REPORT.."

Revision history for this message
aberlanas (angel-berlanas) said :
#4

I just experience the same:

Which version of Cubic are you using? : 2020.06-26-release~202006050139~ubuntu20.04.1
Which version of Ubuntu are you customizing? Xubuntu 20.04
Which version of Ubuntu are you running Cubic in? Xubuntu 20.04

When you install the Live System (after creation), the /dev/sda is unable to be booted (in spite of has a system installed in /dev/sda5).
Another info that i can provide is that the blkid execution has no result. Nothing is show

Revision history for this message
Cubic PPA (cubic-wizard) said :
#5

angel-berlanas,

I think Paullux's question was a little different. He was trying to execute `grub-update` in the virtual terminal; it gives an error if you try to do that, but that is normal.

Is your question related to this?

Revision history for this message
aberlanas (angel-berlanas) said :
#6

I think i have the same "problem", i have the error in the virtualTerminal and when i finish the ISO this is bootable and can be used as "live" but their installation not provides a "bootable system"

Revision history for this message
Cubic PPA (cubic-wizard) said :
#7

Are you using Legacy Boot or UEFI?
During the installation, did you install the boot loader to a /sda (or to dedicated EFI partition)?
Does your boot partition have the "boot" flag set?

Revision history for this message
aberlanas (angel-berlanas) said :
#8

Thanks for the ideas, i think i have a problem in my VirtualHardDisk.

I am using the ISO in real machines and I have no problem.

Can you help with this problem?

Provide an answer of your own, or ask Paullux for more information if necessary.

To post a message you must log in.