Rescuing a Linux System via the GRUB Command Line: Step‑by‑Step Guide
This article explains how to recover a Linux system that cannot boot because the GRUB menu file is missing, by using the GRUB command line to identify partitions, set the root, specify kernel and initrd, and finally boot the system.
When the /boot/grub/menu.lst file is accidentally deleted, a Linux system cannot boot via the GRUB menu and must be rescued from the GRUB command line.
Step 1: Enter GRUB command line
If the screen shows grub> you are already in command mode; otherwise press Esc , then e , then c to reach it.
Step 2: Get help
Type help to list all GRUB commands; for specific command help use help kernel , etc.
Step 3: Identify partitions
Use the cat (hd0,6)/etc/fstab command (with tab completion) to view /etc/fstab and determine which partition holds / and /boot .
Step 4: Set root partition
Enter root (hd0,6) (replace with the correct partition) to tell GRUB where the root filesystem resides.
Step 5: Specify the kernel
Use the kernel /boot/vmlinuz-... root=/dev/sda1 command (adjust the path and root device) to load the Linux kernel.
Step 6: Specify the initrd
If /boot is on the same partition, use initrd /boot/initrd.img-... ; otherwise use the appropriate path for a separate boot partition.
Step 7: Boot the system
Finally execute boot to start the operating system.
Remember to use the Tab key for command completion and refer to help whenever a command is unknown.
Architects' Tech Alliance
Sharing project experiences, insights into cutting-edge architectures, focusing on cloud computing, microservices, big data, hyper-convergence, storage, data protection, artificial intelligence, industry practices and solutions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.