Linux Redhat/CentOS “could not find filesystem /dev/root”


Could not find filesystem ‘/dev/root’ at boot?

Today I ran into a problem where after renaming the root (/) logical Volume and rebooted I got the following message on boot:

could not find filesystem '/dev/root'

I had renamed the LV from LogVol00 to root. So I had made sure I updated the /etc/fstab to reflect the renamed LV.

/dev/VolGroup00/root    /                       ext3    defaults        1 1

It turns out that you also got to make changes to the grub boot menu (/boot/grub/menu.lst) whenever you make changes to the name or location to the root mount.

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-308.4.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-308.4.1.el5 ro root=/dev/VolGroup00/root
        initrd /initrd-2.6.18-308.4.1.el5.img
title CentOS (2.6.18-274.3.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/VolGroup00/root
        initrd /initrd-2.6.18-274.3.1.el5.img
title CentOS (2.6.18-238.9.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=/dev/VolGroup00/root
        initrd /initrd-2.6.18-238.9.1.el5.img
title CentOS (2.6.18-194.32.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.32.1.el5 ro root=/dev/VolGroup00/root
        initrd /initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-194.17.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.17.1.el5 ro root=/dev/VolGroup00/root
        initrd /initrd-2.6.18-194.17.1.el5.img

How to fix?

Since this error occurs at boot, you will need to boot yourself in RESCUE mode to fix this problem.

1. Download yourself a Centos/Redhat Full installation CD for the version of Linux you have.
2. Boot the CD into the first installation screen
3. Enter ‘Linux Rescue’
Linux Rescue Mode 1
4. Go through the text UI boot process and you will be prompted with “Do you want to start the network interfaces on this system?” Select No
Linux Rescue Mode 2
5. Then the system will automatically try to search for your Linux installations. Select Continue.
Linux Rescue Mode 3
6. Once it’s found your Linux installation, it will automatically mount it under /mnt/sysimage. Select OK to continue.
Linux Rescue Mode 4
7. Once that’s done you will exit into the shell.
8. Follow the previous instruction and change your root the found partition.

chroot /mnt/sysimage/

9. Then go ahead and modify your /boot/grub/menu.lst and modify your kernel line with the updated location of your root partition with your favorite editor.
10. Exit > Exit to reboot.

I hope you found this useful!

Related Posts with Thumbnails

About the Author

Alfred Tong
Author and owner of this blog. A Networking enthusiast, full time networking and systems Engineer. Generally curious about all things IT.Certifications: GIAC GSEC, CCNP-S, CCNP, CCSP, CCDP, CCNA, RHCE, JNCIA - FWV
  • itsmegogo

    Thanks ! You literally saved my day !

  • Mike Baroukh

    You could also just use “edit” feature of grub to change boot options the first time than modifiy menu.lst when booted. At grub startup hit keyborad, choose a kernet and press “e” to edit.