Bug#865141: more info

Josip Rodin joy at debbugs.entuzijast.net
Wed Feb 27 21:38:25 GMT 2019


Not only does it not work, it errors out with:

% sudo update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/oldvgname-lvroot'.

Which is to say:

% sudo sh -ex /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
+ set -e
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ prefix=/usr
+ exec_prefix=/usr
+ sbindir=/usr/sbin
+ bindir=/usr/bin
+ sysconfdir=/etc
+ PACKAGE_NAME=GRUB
+ PACKAGE_VERSION=2.02~beta3-5+deb9u1
+ host_os=linux-gnu
+ datadir=/usr/share
+ [ x = x ]
+ pkgdatadir=/usr/share/grub
+ export pkgdatadir
+ grub_cfg=
+ grub_mkconfig_dir=/etc/grub.d
+ basename /usr/sbin/grub-mkconfig
+ self=grub-mkconfig
+ grub_probe=/usr/sbin/grub-probe
+ grub_file=/usr/bin/grub-file
+ grub_editenv=/usr/bin/grub-editenv
+ grub_script_check=/usr/bin/grub-script-check
+ export TEXTDOMAIN=grub
+ export TEXTDOMAINDIR=/usr/share/locale
+ . /usr/share/grub/grub-mkconfig_lib
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ datadir=/usr/share
+ bindir=/usr/bin
+ sbindir=/usr/sbin
+ [ x/usr/share/grub = x ]
+ test x/usr/sbin/grub-probe = x
+ test x/usr/bin/grub-file = x
+ test x = x
+ grub_mkrelpath=/usr/bin/grub-mkrelpath
+ which gettext
+ :
+ grub_tab=
+ test 2 -gt 0
+ option=-o
+ shift
+ argument -o /boot/grub/grub.cfg
+ opt=-o
+ shift
+ test 1 -eq 0
+ echo /boot/grub/grub.cfg
+ grub_cfg=/boot/grub/grub.cfg
+ shift
+ test 0 -gt 0
+ fgrep -qs ${GRUB_PREFIX}/video.lst /etc/grub.d/00_header
+ [ x = x ]
+ id -u
+ EUID=0
+ [ 0 != 0 ]
+ set /usr/sbin/grub-probe dummy
+ test -f /usr/sbin/grub-probe
+ :
+ /usr/sbin/grub-probe --target=device /
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/oldvgname-lvroot'.
+ GRUB_DEVICE=

Which is to say:

% sudo strace grub-probe --target=device / 2>&1 | grep -E '(mapper|vg|lv|dev|mount)'
execve("/usr/sbin/grub-probe", ["grub-probe", "--target=device", "/"], [/* 17 vars */]) = 0
open("/lib/x86_64-linux-gnu/libdevmapper.so.1.02.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libudev.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tr"..., 1024) = 311
open("/boot/grub/device.map", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/proc/self/mountinfo", O_RDONLY)  = 3
read(3, "kio rw,nosuid,nodev,noexec,relat"..., 1024) = 717
lstat("/dev", {st_mode=S_IFDIR|0755, st_size=3440, ...}) = 0
lstat("/dev/mapper", {st_mode=S_IFDIR|0755, st_size=120, ...}) = 0
lstat("/dev/mapper/oldvgname-lvroot", 0x7ffc7a97ad80) = -1 ENOENT (No such file or directory)
write(2, "failed to get canonical path of "..., 63failed to get canonical path of `/dev/mapper/oldvgname-lvroot') = 63

So the problem is the info exposed by the running kernel:

% grep oldvgname "/proc/self/mountinfo"
21 0 253:0 / / rw,relatime shared:1 - ext4 /dev/mapper/oldvgname-lvroot rw,errors=remount-ro,data=ordered

Once upon a time, one could mess with /etc/mtab in these cases, but that
file is no longer used, it's a symlink into /proc/mounts.

Not sure if this should be reassigned elsewhere then... maybe lvm2 should
try harder to communicate volume group changes to the running kernel?
The device mapper seems to have done its job in updating /dev/mapper,
but it didn't seem to percolate into mountinfo.

btw xref https://askubuntu.com/questions/765058/how-do-you-rename-the-volume-group-that-contains-the-root-volume-in-lvm

-- 
     2. That which causes joy or happiness.



More information about the Pkg-grub-devel mailing list