To create/recreate/update the initramfs file means to update the initrd.img-*
ramdisk files in /boot.
Here's a listing of my /boot. Note the size/date of the initrd.img-*
files. One or more of these need updating in your case.
~$ ls -al /boot
total 162745
drwxr-xr-x 4 root root 4096 Jul 5 05:19 .
drwxr-xr-x 23 root root 4096 Jun 19 12:40 ..
-rw-r--r-- 1 root root 252994 May 7 05:38 config-5.11.0-18-generic
-rw-r--r-- 1 root root 253022 Jun 16 15:38 config-5.11.0-22-generic
drwxr-xr-x 3 root root 1024 Dec 31 1969 efi
drwxr-xr-x 5 root root 4096 Jun 30 12:09 grub
lrwxrwxrwx 1 root root 28 Jun 25 12:42 initrd.img -> initrd.img-5.11.0-22-generic
-rw-r--r-- 1 root root 62066094 Jul 5 05:19 initrd.img-5.11.0-18-generic
-rw-r--r-- 1 root root 62067859 Jul 5 05:18 initrd.img-5.11.0-22-generic
lrwxrwxrwx 1 root root 28 Jun 25 12:42 initrd.img.old -> initrd.img-5.11.0-18-generic
-rw-r--r-- 1 root root 182704 Aug 18 2020 memtest86+.bin
-rw-r--r-- 1 root root 184380 Aug 18 2020 memtest86+.elf
-rw-r--r-- 1 root root 184884 Aug 18 2020 memtest86+_multiboot.bin
-rw------- 1 root root 5968565 May 7 05:38 System.map-5.11.0-18-generic
-rw------- 1 root root 5969489 Jun 16 15:38 System.map-5.11.0-22-generic
lrwxrwxrwx 1 root root 25 Jun 25 12:42 vmlinuz -> vmlinuz-5.11.0-22-generic
-rw------- 1 root root 14737344 May 7 06:26 vmlinuz-5.11.0-18-generic
-rw------- 1 root root 14741312 Jun 16 15:55 vmlinuz-5.11.0-22-generic
lrwxrwxrwx 1 root root 25 Jun 25 12:42 vmlinuz.old -> vmlinuz-5.11.0-18-generic
Note: I prefer to create a totally fresh version by using the -c
option, instead of just updating the existing file by using the -u
option.
The proper command would be:
sudo update-initramfs -c -k $(uname -r)
This will create a fresh initrd.img-* file for your currently booted version of Ubuntu.
However, if you can't boot to the current version of Ubuntu, you may have to modify this command, and by booting to an older version of Ubuntu, you can do it this way:
sudo update-initramfs -c -k 5.11.0-22-generic
where the 5.11.0-22-generic part should be replaced with the version of the desired boot kernel.
To regenerate all of the initrd.img-* files (not recommended), use:
sudo update-initramfs -c -k all
To get more detailed information, type:
man update-initramfs