A technician is investigating a Linux server that fails to boot, displaying a `kernel panic` message related to a missing root filesystem. The server recently had its root filesystem moved from `/dev/sda1` to `/dev/sdb1`. Which file is most likely misconfigured, preventing the system from finding the new root filesystem?
- A/boot/grub/grub.cfg
- B/etc/default/grub
- C/etc/fstab
- D/etc/sysconfig/network-scripts/ifcfg-eth0
Show answer & explanationAnswer & explanation
Correct answer: A. /boot/grub/grub.cfg
The `kernel panic` related to a missing root filesystem, especially after a root partition move, points directly to the GRUB configuration. The `/boot/grub/grub.cfg` file contains entries for the kernel and initial ramdisk, including the `root=` parameter that tells the kernel where to find the root filesystem. If this parameter still points to `/dev/sda1` instead of `/dev/sdb1`, the kernel won't be able to mount the root filesystem and will panic.
Why the other options are wrong
- B. `/etc/default/grub` is a configuration file used to generate `grub.cfg`, but the actual boot configuration is in `grub.cfg`.
- C. `fstab` mounts filesystems *after* the root filesystem is found and mounted, so it wouldn't cause a kernel panic for a *missing* root filesystem.
- D. Network configuration (`ifcfg-eth0`) has no bearing on finding and mounting the root filesystem during boot.
GRUB root parameter
The `root=` parameter in the GRUB configuration (`/boot/grub/grub.cfg`) specifies the device (e.g., `/dev/sdb1` or UUID) where the kernel should find and mount the root filesystem. An incorrect value leads to boot failures.
- Crucial for the kernel to locate the root filesystem.
- Typically found in the `linux` or `linuxefi` line of a boot entry.
- Can use device names (e.g., `/dev/sdb1`) or UUIDs.
Memory trick: GRUB's config roots the kernel.