Symptoms: after an update or reboot, the server shows (initramfs) instead of starting, or a message such as "Gave up waiting for root file system".
Likely causes
- A broken or incomplete kernel update.
- The disk was full when the update ran, so the new boot image was never written.
- A damaged file system.
You need console access (the screen of the server, a virtual-machine console, or your host's rescue mode) because SSH is not available yet.
1. Try the previous kernel
Restart. When the GRUB menu shows (hold Shift on a BIOS machine or press Esc on UEFI), choose Advanced options for Ubuntu and pick the older kernel. If it boots, continue with the steps below to fix the new one.
2. Check the disk
df -h
df -i
If / or /boot is 100% full, free space first: remove old kernels and caches (see step 3). A full disk is the most common cause.
If the file system is damaged, from the (initramfs) prompt run fsck -y /dev/sda2 (use your root device from blkid or lsblk) and then type exit.
3. Remove old kernels
Keep the running kernel and one older one.
uname -r # the kernel you are running now
dpkg --list | grep linux-image
sudo apt autoremove --purge # removes kernels no longer needed
To remove one by name: sudo apt remove --purge linux-image-5.15.0-XXX-generic (use a version from the list, never the one uname -r shows).
4. Rebuild the boot image and the boot menu
sudo update-initramfs -c -k all
sudo update-grub
-c creates the boot image for every installed kernel. If it complains about a missing file, run sudo apt --fix-broken install first.
5. Restart and test
sudo reboot
Confirm the server boots with the new kernel: uname -r.
Prevent it
Keep at least 20% free space on /, use apt autoremove after kernel updates, and keep a console or rescue option ready for servers.
If it will not recover, open a ticket and tell us the exact message on the screen.