0

Ubuntu updating hangs at update-grub after few hours, then I cancelled the updating windows. My current kernel is Linux family 5.15.0-71-generic #78~20.04.1-Ubuntu SMP

Then I run sudo dpkg --configure -a

Setting up linux-image-5.15.0-73-generic (5.15.0-73.80~20.04.1) ...
Processing triggers for linux-image-5.15.0-73-generic (5.15.0-73.80~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.15.0-73-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-73-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-73-generic
Found initrd image: /boot/initrd.img-5.15.0-73-generic
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.15.0-70-generic
Found initrd image: /boot/initrd.img-5.15.0-70-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found linux image: /boot/vmlinuz-5.11.0-46-generic
Found initrd image: /boot/initrd.img-5.11.0-46-generic
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.4.0-59-generic
Found initrd image: /boot/initrd.img-5.4.0-59-generic
rmdir: failed to remove '/var/lib/os-prober/mount': Device or resource busy
rmdir: failed to remove '/var/lib/os-prober/mount': Device or resource busy
rmdir: failed to remove '/var/lib/os-prober/mount': Device or resource busy
device-mapper: reload ioctl on osprober-linux-sda1  failed: Device or resource busy
Command failed.
rmdir: failed to remove '/var/lib/os-prober/mount': Device or resource busy
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done

Then I tried sudo umount /var/lib/os-prober/mount and sudo update-grub. It still stuck at

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-73-generic
Found initrd image: /boot/initrd.img-5.15.0-73-generic
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.15.0-70-generic
Found initrd image: /boot/initrd.img-5.15.0-70-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found linux image: /boot/vmlinuz-5.11.0-46-generic
Found initrd image: /boot/initrd.img-5.11.0-46-generic
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.4.0-59-generic
Found initrd image: /boot/initrd.img-5.4.0-59-generic

How can I fix it?

More infos: I have windows 10 installed in other SSD device.

Update1: it seems that os prober is the reason, how to fix it then?

maplgebra
  • 101
  • 2
  • 1
    Your os-prober will hang if any partition is damaged. It scans all partition for other installs. That is now why they want you to make sure os-prober is off for security reasons. You can add entries you want to 40_custom. And you need to houseclean old kernels. Is this an upgrade so old kernels not in dpkg, for normal delete? https://askubuntu.com/questions/659528/grub-menu-with-windows-10-and-ubuntu-14-04/659910#659910 & https://help.ubuntu.com/community/RemoveOldKernels#Safely_Removing_Old_Kernels – oldfred May 31 '23 at 17:00

0 Answers0