Introduction

During boot, the initramfs (initial RAM filesystem) is responsible for loading necessary drivers and mounting the root filesystem. When it cannot locate the root device, it drops to a busybox shell with an error like ALERT! /dev/disk/by-uuid/xxx does not exist. Dropping to a shell! This leaves the system in a non-bootable state that requires manual intervention or boot media recovery.

Symptoms

  • Boot stops at (initramfs) busybox prompt
  • Error message: Gave up waiting for root file system device
  • ALERT! /dev/disk/by-uuid/xxxxx does not exist
  • Waiting for root device /dev/sda1... followed by timeout
  • System works with one kernel but drops to initramfs with another

Common Causes

  • Root device UUID changed after repartitioning or filesystem recreation
  • Storage controller driver not included in initramfs (common with new NVMe or RAID controllers)
  • USB boot drive not ready when root= parameter is evaluated (timing issue)
  • Device name changed from /dev/sda1 to /dev/vda1 after VM migration
  • LVM volume group not activated during initramfs phase

Step-by-Step Fix

  1. 1.From the initramfs busybox prompt, enumerate available devices:
  2. 2.```bash
  3. 3.# List all block devices
  4. 4.ls /dev/sd* /dev/vd* /dev/nvme* /dev/mapper/* 2>/dev/null

# Check UUIDs of available devices blkid

# List available partitions cat /proc/partitions ```

  1. 1.Try to manually mount the root filesystem:
  2. 2.```bash
  3. 3.# Try mounting each potential root device
  4. 4.mount /dev/sda2 /root 2>/dev/null
  5. 5.mount /dev/sda1 /root 2>/dev/null
  6. 6.mount /dev/vda2 /root 2>/dev/null
  7. 7.mount /dev/nvme0n1p2 /root 2>/dev/null

# If mounted successfully, exit to continue booting exit ```

  1. 1.If using LVM, activate volume groups manually:
  2. 2.```bash
  3. 3.lvm vgscan
  4. 4.lvm vgchange -ay
  5. 5.lvm lvs
  6. 6.# Then mount the logical volume
  7. 7.mount /dev/mapper/vg0-root /root
  8. 8.exit
  9. 9.`
  10. 10.After successful boot, fix the boot configuration:
  11. 11.```bash
  12. 12.# Find the correct UUID
  13. 13.sudo blkid
  14. 14.# Update GRUB with correct root= parameter
  15. 15.sudo nano /etc/default/grub
  16. 16.# Ensure GRUB_CMDLINE_LINUX contains the correct root=UUID=
  17. 17.sudo update-grub
  18. 18.`
  19. 19.Regenerate initramfs with all necessary drivers:
  20. 20.```bash
  21. 21.# Ensure the storage driver module is listed
  22. 22.echo "nvme" | sudo tee -a /etc/initramfs-tools/modules
  23. 23.echo "ahci" | sudo tee -a /etc/initramfs-tools/modules
  24. 24.sudo update-initramfs -u -k all
  25. 25.`
  26. 26.Add rootdelay for slow devices (USB, network storage):
  27. 27.```bash
  28. 28.sudo nano /etc/default/grub
  29. 29.# Add rootdelay=10 to GRUB_CMDLINE_LINUX
  30. 30.GRUB_CMDLINE_LINUX="root=UUID=xxx rootdelay=10 quiet"
  31. 31.sudo update-grub
  32. 32.`

Prevention

  • Always use UUID= or LABEL= in boot parameters, never /dev/sdX device names
  • Regenerate initramfs after any storage configuration changes
  • Test boot after kernel updates in a staging environment
  • Include rootdelay=10 for systems booting from USB or network storage
  • Maintain a bootable rescue USB with the same kernel version as production