Whenever I upgrade Ubuntu 16.04 and there is a kernel upgrade, the update process takes a very long time when running (os-prober) and also generates the grub configuration multiple times.
And for some inexplicable reason to me it runs more than once...
Setting up openssh-client (1:7.2p2-4ubuntu1) ...
Setting up linux-image-4.4.0-22-generic (4.4.0-22.39) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-22-generic
Found initrd image: /boot/initrd.img-4.4.0-22-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
grub-probe: error: cannot find a GRUB drive for /dev/sdf1. Check your device.map.
Found Windows 10 (loader) on /dev/sda1
Found Arch on /dev/sdb2
Found Ubuntu 14.04.4 LTS (14.04) on /dev/sdd2
done
Setting up linux-image-extra-4.4.0-22-generic (4.4.0-22.39) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-22-generic
Found initrd image: /boot/initrd.img-4.4.0-22-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Note: /dev/sdf is a USB thumb drive
Is there anyway to stop this behavior or by-pass running grub2 altogether as it is not really used or needed?
os-prober
is used to find other operating systems you might have installed on your drives and add them to your grub menu during boot.If you want to disable os-prober you can edit
/etc/default/grub
(with root privileges) and add this line:I use an application called Grub-Customizer which allows you to disable the search for other operating systems and such. There are both 64 bit and 32 bit versions in the software center.
In the List Configuration tab, you can remove alternate kernel versions* from appearing, and in the General Settings tab, you can uncheck the box labelled "look for other operating systems." You can also change the amount of time the screen waits before automatically continuing the boot process on this same tab. Set it low enough that you still have time to select a memory test option if needed.
The app also allows you to select other background screens and fonts for the boot menu; make sure you read the warnings before doing that though.
I would not remove the grub screen, since you might some day wish you had quick access to memory tests and such things.
I hope this helps.
Frank