Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo 硬盘全lvm+grub2无法启动,请求帮助。
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
pxk
n00b
n00b


Joined: 26 Nov 2013
Posts: 3

PostPosted: Tue Nov 26, 2013 7:41 am    Post subject: gentoo 硬盘全lvm+grub2无法启动,请求帮助。 Reply with quote

/dev/sda1 全lvm
内核已选:mulitiple devices drive support
device mapper support
都是[*]编译。
安装后已emerge lvm2
rcupdate add lvm sysinit
rcupdate add lvm boot
分区:
/dev/vg/root / ext4

/dev/vg/usr /usr ext4

/dev/vg/home /home ext4
/dev/vg/swap swap swap

/dev/vg/var /var ext4
/dev/vg/tmp /tmp ext4
/dev/vg/portage /usr/portage reiserfs

/dev/vg/distfiles /usr/portage/distfiles ext4
/dev/vg/opt /opt ext4




启动时提示:VFS:Cannot open root device "mapper/vg-root" or unknown-block(0,0);error -2
please append a correct "root=" boot option; here are the available parttitions;


然后键盘灯一直闪。死机在哪。


请教有同样配置过的能说明下可能的原因吗?另外,需要提供其他什么数据?
Back to top
View user's profile Send private message
Saigut
n00b
n00b


Joined: 15 Mar 2013
Posts: 17

PostPosted: Tue Nov 26, 2013 12:04 pm    Post subject: Reply with quote

不知道你的grub的配置文件grub.conf(grub1)或grub.cfg(grub2)有没有写正确。这一句“please append a correct "root=" boot option” 貌似你的root这一选项没写对,也有可能其它地方也有问题。另外我不知道lvm是否要求使用initramfs来启动
_________________
Gentoo/Funtoo Awesome
Back to top
View user's profile Send private message
pxk
n00b
n00b


Joined: 26 Nov 2013
Posts: 3

PostPosted: Wed Nov 27, 2013 7:16 am    Post subject: Reply with quote

grub.cfg我是采用grub2-mkconfig -o /boot/grub/grub.cfg 这样生成的,最里面添加了dolvm
至于您说的initramfs是真的不是很懂。官网的文档/boot分区是单独分出来看,并不相同。
有关initamfs方面的资料能否给些链接学习下,是否就是genkernel --lvm initramfs ?
这步的话,是已经做了的。
Back to top
View user's profile Send private message
Saigut
n00b
n00b


Joined: 15 Mar 2013
Posts: 17

PostPosted: Wed Nov 27, 2013 3:24 pm    Post subject: Reply with quote

Quote:
please append a correct "root=" boot option

从这里看的话,我觉得你有必要检查grub.cfg里的root选项是否写正确了。
关于其它要注意的,这里应该已提供了详细的说明: https://wiki.gentoo.org/wiki/LVM
_________________
Gentoo/Funtoo Awesome
Back to top
View user's profile Send private message
pxk
n00b
n00b


Joined: 26 Nov 2013
Posts: 3

PostPosted: Thu Nov 28, 2013 6:54 am    Post subject: Reply with quote

实际我的原因是genkernel生成initramfs时的问题。


结贴:已经搞定。完全按照正常的操作,安装完成后。其中注意几点

1、必须emerge lvm2 而且 rc-update add lvm boot后。grub2-install /dev/sda才能成功,否则会提示无法写入的提示。导致grub2安装失败。

2、必须采用genkernel形式才可引导。即按照原普通手册制作完成后,在制作内核后,emerge genkernel,然后genkernel --lvm --install initramfs。生成initramfs

3、用grub2-mkconfig -o /boot/grub/grub.cfg后,必须修改grub.cfg。在linux /boot/kernel-xxxx ro 这句话里的"ro"后面加上dolvm 注意要有空格。即我的是

"linux /boot/kernel-3.10.17-gentoo root=/dev/mapper/vg-root dolvm ro"

以上是此贴结贴,有类似的可以参考。如有其他和我一样,但出问题的,可以相互探讨。linux新手,大家共同学习。
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum