关于裁剪系统后启动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后的设备也是第一块硬盘的意思。

网上看了好多,源于对配置文件理解问题,照搬教程,无法启动。

修改这两处后,可以正常启动。



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