recettes/Homelab/fix grub if linux doesn't boot.md
gribse ecdfa2f7c4 Squashed 'temp-repo/' content from commit 6688605
git-subtree-dir: temp-repo
git-subtree-split: 6688605ad41f49d1eccead8d29421c658cad0100
2025-10-06 19:14:58 +02:00

80 lines
1.4 KiB
Markdown
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

sudo nano /etc/fstab
The error indicates that the system is trying to mount /dev/nvme0n1p3, but its not listed correctly in /etc/fstab or the UUIDs/labels dont match. Heres how to resolve this issue:
---
1. Boot into the System Temporarily
Use GRUB commands to boot into your system, as you did previously:
set root=(hd0,gpt6)
linux /boot/vmlinuz-5.15.0-130-generic root=/dev/nvme0n1p3 ro
initrd /boot/initrd.img-5.15.0-130-generic
boot
Replace /dev/nvme0n1p3 with the correct partition if needed.
---
2. Check /etc/fstab
Once the system boots, open /etc/fstab to verify the partition setup:
Look for the line referring to the root filesystem (/). It should match the correct UUID or device name.
---
3. Find the Correct UUID
Run the following command to list all partition UUIDs:
lsblk -f
Identify the UUID of /dev/nvme0n1p3 (or your root partition).
---
4. Update /etc/fstab
Replace the incorrect entry in /etc/fstab with the correct UUID for the root partition. For example:
UUID=correct-uuid / ext4 defaults 0 1
Save and exit.
---
5. Update GRUB
After fixing /etc/fstab, update GRUB to ensure the correct configuration is saved:
sudo update-grub
sudo grub-install /dev/nvme0n1
---
6. Reboot
Reboot the system and verify that it starts correctly:
sudo reboot
---
If you still encounter issues, share the output of lsblk -f and the contents of /etc/fstab for further troubleshooting.
source : chatgpt