I have an Ubuntu 18.04 server that is not able to perform "sudo apt upgrade" at the moment. It is receiving this message whenever we try to update any packages:
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/rootvg-rootlv'.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
The server is still fully functional, and in fact hosts a PostgreSQL environment that is being used regularly. Because of that, I cannot simply shut it down without knowing if it will come back up. For now, we've just been making sure that we have all our data backed up regularly while we plan out how to fix this.
Today, I believe I discovered why the error message is being displayed. The volume group name seems to be missing a letter (rootv instead of rootvg) for some of the mounted filesystems.
$ vgs
VG #PV #LV #SN Attr VSize VFree
datavg 1 69 0 wz--n- 4.36t <2.32t
rootvg 1 6 0 wz--n- <891.25g <717.25g
$ cd /dev/mapper; ls -l rootv*
lrwxrwxrwx 1 root root 7 Jan 24 2022 rootv-homelv -> ../dm-2
lrwxrwxrwx 1 root root 7 Jan 24 2022 rootv-rootlv -> ../dm-0
lrwxrwxrwx 1 root root 7 Jan 24 2022 rootv-swaplv -> ../dm-1
lrwxrwxrwx 1 root root 7 Jan 24 2022 rootv-tmplv -> ../dm-3
lrwxrwxrwx 1 root root 8 Jun 27 13:43 rootvg-chrootlv -> ../dm-46
lrwxrwxrwx 1 root root 8 Aug 13 10:54 rootvg-inbacklv -> ../dm-74
I am not sure what happened and how this managed to get this way, as I am sure we initially created them with the full name, but regardless it is what it is now. So how to fix it is the next question.
Here's my thought:
Can I create a second link to the same device ?
Example:
If I issued the command: ln -f -s /dev/dm-0 /dev/mapper/rootvg-rootlv
I would then have two links to the same dm device file
lrwxrwxrwx 1 root root 7 Jan 24 2022 rootv-rootlv -> ../dm-0
lrwxrwxrwx 1 root root 7 Nov 08 16:43 rootvg-rootlv -> ../dm-0
Would it be possible to do this, then remove the incorrect link, and then reboot?
Or (in your opinion or knowledge), would the system crash or have more serious issues doing this?
Has anyone ever had a similar issue?
I'd love to know how the VG name in the /dev/mapper may have gotten changed from its original value, but I'd be happy just to come up with a solution that does not involve re-installing from scratch.
Thx.
Steve N.