grub2-probe: error: failed to get canonical path of `tmpfs'

Hello.
My problem arise while i try to repair a non bootable leap 15.3 vm
Although this is a virtualbox virtual machine, I think my problem is a pure linux problem.
Feel free to switch this thread to virtualization.

I suspect the problem being has a bad uuid.

For comprehension, I call ‘VM_REPAIR’ the vm use to do the repair the defective vm
And I call ‘DEFECTIVE_VM’ the VM to be repaired.
I use a script on a usb stick to do the repair.
The script copy a good (from my point of view) /boot/grub2rub.cfg in the root partition
and /EFI/opensuse/grub.cfg in the efi partition.
And I expect the script to finish by running

grub2-mkconfig -o /boot/grub2/grub.cfg

1°) Creation of ‘VM_REPAIR’ vm using leap 15.3 iso as cdrom.add the vdi file of the defective vm ‘DEFECTIVE_VM’

2°) Start ‘VM_REPAIR’ and do not choose install but jump to more/rescue
3°) log in as root
4°) run blkid to find all stuff in the ‘DEFECTIVE_VM’
5°) mount my usb stick
6°) start the script on my usb stick which

mount the efi partition of the 'DEFECTIVE_VM' (/dev/sdb1)    in  /mnt/lnx_efi_vm
mount the root partition of the 'DEFECTIVE_VM' (/dev/sdb3)  in  /mnt/lnx_slash_vm
copy file to /mnt/lnx_slash_vm/boot/grub2/grub.cfg
copy file to /mnt/lnx_efi_vm/EFI/opensuse/grub.cfg
umount root partition
umount efi partition
mkdir -p  /mnt/my_chroot
mount root partition (/dev/sdb3)  to  /mnt/my_chroot
mount --bind /boot    to  /mnt/my_chroot/boot
mount --bind /dev     to  /mnt/my_chroot/dev
mount --bind /sys     to  /mnt/my_chroot/sys
mount --bind /proc    to  /mnt/my_chroot/proc
chroot /mnt/my_chroot


Following a rermark from arvidjaar in 493663-Upgrading-12-3-gt-13-1 here is the output of

cat /proc/self/mountinfo
171 23 8:19 / / rw,relatime shared:96 - ext4 /dev/sdb3 rw
174 171 0:23 /boot /boot rw,relatime shared:1 - tmpfs tmpfs rw,size=4007572k,nr_inodes=0
177 171 0:6 / /dev rw,relatime shared:3 - devtmpfs devtmpfs rw,size=1938676k,nr_inodes=484669,mode=755
180 171 0:22 / /sys rw,relatime shared:9 - sysfs sysfs rw
183 171 0:5 / /proc rw,relatime shared:17 - proc proc rw
186 171 8:33 / /tmp/usb2 rw,relatime shared:102 - ext4 /dev/sdc1 rw

then the output of the final command is :


grub2-mkconfig -o /boot/grub2/grub.cfg

/usr/sbin/grub2-probe: error: failed to get canonical path of `tmpfs'.
ERROR in CMD :   grub2-mkconfig -o /boot/grub2/grub.cfg
ERROR : RET_CODE = 1

Any help is welcome

Why is “/boot” using tmpfs? That seems like a mistake.

Yes
I must clarify the situation :
I run a vm on a linux host.
The ‘VM_REPAIR’ is configured like if a new leap vm will be createda bootable leap install cd is defined in virtualbox Manager config for ‘VM_REPAIR’
a vdi file for the new leap vm is defined in virtualbox Manager ‘VM_REPAIR’ ( but will never be filled with an operating system )
a vdi file of the defective vm ‘DEFECTIVE_VM’ is defined as a secondary hard disk in virtualbox Manager ‘VM_REPAIR’

During the start, the rescue system option is selected.
When the start is finished, there is a minimal system installed with " /, /boot, … , /dev, /mnt, … /proc, /sys … "

BLKID show that the ‘DEFECTIVE_VM’ is in/dev/sdb1,/dev/sdb2,/dev/sdb3,

My script create a specific folder to chroot in :

mkdir -p /mnt/my_chroot

then mount the root file system of ‘DEFECTIVE_VM’ in /mnt/my_chroot

mount /dev/sdb3  /mnt/my_chroot

The mistake seems to be now.

The script ‘mount --bind’ ‘/boot’ of the current running system in my chroot folder.

mount --bind /boot  /mnt/my_chroot/boot

This is stupid because the ‘/boot’ I need is the one of the defective vm, and it is already in my chroot folder ( /dev/sda3 ).
So this step must be removed from my script.

Now I think that ‘/dev’, ‘/sys’, ‘/proc’ are those of the running system and must be kept as is.

So I am making a new test with the correction above, and give news.

Thank you for your comment.

Hello.

After correction its works.

Thank you for helping