grub-install prints misleading error message

Bug #1961085 reported by Oliver
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

When i try to install grub on an usb stick without root permissions with the following command line, i get a misleading error message:

[code]
~$ grub-install --recheck --boot-directory=/media/ubuntu-mate/usbstick/boot/ /dev/sda
Installing for i386-pc platform.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-install: error: disk `hostdisk//dev/sda1' not found.
[/code]

This error message is misleading. The disk does exist. The command works without errors, when i put a sudo in front of it.
The error message should be something like:

"You need to be root to have write access"

There should be a check if grub2 does have write access and if it doesn't, the error message should tell the user, that he doesn't have permissions and should change to root or use sudo.

This was tested on Ubuntu 21.10

Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Julian Andres Klode (juliank) wrote :

It seems that grub_disk_open() returns GRUB_ERR_UNKNOWN_DEVICE when it receives EACCESS. I suggest working with upstream to address this issue if this interests you, as I don't think fixing this is a priority for us, since users normally do not run grub-install themselves.

Changed in grub2 (Ubuntu):
status: New → Triaged
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The problem still occurs in Lunar.

tags: added: foundations-todo
removed: access error grub-install grub2 message misleading permissions root write
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.