redhat6.1通过虚拟磁盘启动,GRUB改怎么写?

netscrt 发布于 2014/03/20 16:55
阅读 278
收藏 0

grub2 支持加载磁盘镜像,于是我打算将红帽根分区的镜像打包然后用grub2 去启动。但是不知道启动参数改怎么写

我模仿wubi的做法这样写

menuentry "--------redhat_disk-------" {
insmod ext2
insmod ext3
set root='(hd0,msdos1)'
loopback loop0 /redhat.img
set root=(loop0)
linux (loop0)/boot/vmlinuz-2.6.32-131.0.15.el6.x86_64 root=/dev/sda1 loop=/redhat.img ro

initrd (loop0)/boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
boot
}
但是红帽会将/dev/sda1 当做根分区,导致启动失败

后来改成

menuentry "--------redhat_disk-------" {
insmod ext2
insmod ext3
set root='(hd0,msdos1)'
loopback loop0 /redhat.img
set root=(loop0)
linux (loop0)/boot/vmlinuz-2.6.32-131.0.15.el6.x86_64 root=/dev/loop0 ro

initrd (loop0)/boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
boot
}

还是无法启动。请问要怎么写,内核才能失败磁盘镜像呢?

求各位指点!

加载中
返回顶部
顶部