grub-install prints misleading error message
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-
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/
[/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 |
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.