關於裁剪系統後啓動mount: could not find filesystem '/dev/root'問題

裁剪重啓後:


啓動經過grub後就停在如下:

mount: could not find filesystem '/dev/root'

setuproot: moving /dev failed: No such file or directory

setuproot: error mounting /proc: No such file or directory

setuproot: error mounting /sys: No such file or directory

setuproot: mount failed: No such file or directory

Kernel panic - not syncing: Attempted to kill init!


此問題爲找不到根分區,無法掛載根

有兩處容易出錯:

(1)檢查init文件配置:

zcat /boot/initrd-verison.img    | cpio -id  後

出現init文件

更改mkrootdev -t ext3 -o defaults,ro /dev/sda2

/dev/sda2 :不要以宿主機硬盤名稱來寫,在新的虛擬機上只存在一個硬盤,所以此處STAT硬盤爲sda。

修改後重新歸檔。

(2)grub.config 配置文件

default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title Wxp CentOS (2.6.18-406.el5)
        root (hd0,0)
        kernel /vmlinuz ro root=/dev/sda2

        initrd /initrd.gz

root後的設備也是第一塊硬盤的意思。

網上看了好多,源於對配置文件理解問題,照搬教程,無法啓動。

修改這兩處後,可以正常啓動。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章