Fri 23 May 2014 03:08:13 PM UTC, original submission:
System details:
OS: Arch Linux x86_64
Grub: 2.02.beta2 installed on a GPT disk with protective MBR
Boot: using BIOS
GPT partition /dev//boot:
Using grub-probe on this setup works fine when running it with sudo:
$ sudo grub-probe --target=partmap /
gpt
$ sudo grub-probe --target=drive /
(hostdisk//dev/sda,gpt1)
However, running grub-probe as a user without read access to /dev/sda*, produces misleading errors, and ultimately gives incorrect information:
$ grub-probe --target=partmap /
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: error: disk `hostdisk//dev/sda1' not found.
$ grub-probe --target=drive /
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
(hostdisk//dev/sda1)
Running the above commands under strace (filtering on open, stat, execve events, see attached files) shows that grub-probe running as unprivileged user encounters permission errors (EACCES) but doesn't report these to the user.
The errors which grub-probe does report are misleading: the disk does exist, but the current user simply has no permission to access it.
Also the final info is incorrect, as it doesn't identify the partition as being a GPT partition.
Both these issues can lead users trying to diagnose problems to look in the wrong place, or worse, apply the wrong fixes.
Note that in some environments such as SELinux, even running grub-probe under sudo, one might not have permission to access some devices!
From reading several reports on the net about grub-probe reporting "warning: disk does not exist", I think that grub-probe not reporting permssion problems may lie at the heart of at least some of these reports.
Please consider fixing grub-probe to report permission errors directly to the user.
|