Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VFS: Unable to mount root fs when LVM and GRUB is used
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
mass85pl
n00b
n00b


Joined: 03 Mar 2015
Posts: 3

PostPosted: Tue Mar 03, 2015 5:11 pm    Post subject: VFS: Unable to mount root fs when LVM and GRUB is used Reply with quote

Hi

I've been trying to install Gentoo on LVM without RAID and boot it with GRUB. I followed the Gentoo Handbook and used other resources to get support with LVM configuration (i.e. https://igshaan.wordpress.com/2008/09/14/gentoo_installation_ubuntu/, http://www.gentoo.org/doc/pl/gentoo-x86+raid+lvm2-quickinstall.xml).

Unfortunately boot up process ends with kernel panic: "VFS: unable to mount root fs on unknown-block(0,0)".

I intended to use sda1 as boot partition, sda2 as swap, whereas sda3 as LVM.

Code:
fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5a50af85

Device    Boot     Start       End    Blocks  Id System
/dev/sda1 *         2048     67583     32768  83 Linux
/dev/sda2          67584   4261887   2097152  82 Linux swap / Solaris
/dev/sda3        4261888 976773167 486255640  83 Linux


This is how I distributed space among logical volumes:
Code:
lvscan
  ACTIVE            '/dev/volgrp/root' [10.00 GiB] inherit
  ACTIVE            '/dev/volgrp/usr' [50.00 GiB] inherit
  ACTIVE            '/dev/volgrp/tmp' [5.00 GiB] inherit
  ACTIVE            '/dev/volgrp/var' [25.00 GiB] inherit
  ACTIVE            '/dev/volgrp/home' [300.00 GiB] inherit


And here is my Seagate hard drive:
Code:
lsscsi
[0:0:0:0]    disk    ATA      ST9500420AS      SDM1  /dev/sda
[1:0:0:0]    cd/dvd  HL-DT-ST DVD+-RW GSA-T21N A100  /dev/sr0
[2:0:0:0]    disk    USB      Flash Disk       PMAP  /dev/sdb
[4:0:0:0]    disk    Chipsbnk UDisk            5.00  /dev/sdc


I've googled a lot, read many articles but still cannot make it working. I've noticed that most common problem is disabled driver for hard drive or SATA controlled. I tried to enable some of the drivers but I am not sure which is required for my hardware. I've pasted output of lspci -n to http://kmuto.jp/debian/hcl/index.rhtmlx and it told me I have 82801GBM/GHM (ICH7-M Family) SATA Controller which requires ata_piix driver. This driver is enavled in my kernel config, but still it does not work. So this is my latest kernel config: https://drive.google.com/file/d/0B7d5BaYNdoNcWjVELU9QT2dHUHc/view?usp=sharing

I've noticed that I must have made some mistake while followin ongline manuals, because when I mount /dev/sda1 from livecd to list files, I can see there is only lost_found directory, while I inteded to have /boot on this partition. So by accident GRUB and kernels got installed on LVM root partition. However GRUB works fine, I can select kernels, list files on LVM etc.

I experimented also with initrd in GRUB:
Code:
linux   /boot/kernel-3.18.7-second_gentoo_compilation root=/dev/ram0 lvm2root=/dev/mapper/volgrp-root ro
initrd     initrd-lvm2-3.16.5-gentoo.gz

but it also ends with kernel panic related to different device: "VFS: Unable to mount root fs on unknown-block(1,0)"

Do you have any idea what is the reason for my problems?
Back to top
View user's profile Send private message
leonchik1976
Guru
Guru


Joined: 24 Jan 2010
Posts: 325

PostPosted: Tue Mar 03, 2015 8:53 pm    Post subject: Reply with quote

i use lvm - first of all check that you enabled LVM in kernel config (not as module), and you must build an initramfs with lvm support. i use genkernel for it
genkernel --lvm --udev --install initramfs

http://wiki.gentoo.org/wiki/LVM#Genkernel.2FGenkernel-next
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Tue Mar 03, 2015 9:16 pm    Post subject: Reply with quote

mass85pl,

Code:
"VFS: unable to mount root fs on unknown-block(0,0)"
At face valuse often means that the kernel could not see the hard drives at all.
Its a little more complex when LVM is in use.

Was there also a message "Unable te find root device in ." Thats from memory, it may not be quite like that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mass85pl
n00b
n00b


Joined: 03 Mar 2015
Posts: 3

PostPosted: Tue Mar 03, 2015 9:47 pm    Post subject: Reply with quote

NeddySeagoon wrote:


Was there also a message "Unable te find root device in ." Thats from memory, it may not be quite like that.

I cannot recal such message. I don't know how to make logs history longer, usually call trace occupies so much space that it is hard to see what was happening before. Anyway I started my laptop again and I was lucky this time, there was message: "VFS: Cannot open root device "mapper/volgrp-root" or unknown-block(0,0): error -2. Please append a correct "root=" boot option; here are the available partitions: (...)".

So I guess I should use initrd to activate LVM. This is wierd, because GRUB can use all LVM partitions.

leonchik1976 wrote:
i use lvm - first of all check that you enabled LVM in kernel config (not as module), and you must build an initramfs with lvm support. i use genkernel for it
genkernel --lvm --udev --install initramfs

http://wiki.gentoo.org/wiki/LVM#Genkernel.2FGenkernel-next

I've used this script https://git.fedorahosted.org/cgit/lvm2.git/tree/scripts/lvm2create_initrd/lvm2create_initrd?id=v2_02_116 to generate initrd and I guess from kernel version that it used the kernel from live cd, which has support for LVM. Anyway I will try the genkernel way.

The way I've used initrd so far resulted in a message "VFS: Cannot open root device "null" or unknown-block(1,0): error -6".
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Tue Mar 03, 2015 10:44 pm    Post subject: Reply with quote

mass85pl,

You need an initrd to start LVM so that the kernel can use it for root. The tool that does this is a userspace tool. Without an initrd you cannot read the userspace tool from root as you can't mount it until the userspace tool is loaded. Yep, its a circular argument and you ned te break the circle.

grub has to make its own arrangements for reading things. It cannot use the kernel as its purpose is to load the kernel, the kernel is not running until after grub exits.
The kernel cannot read logical volumes until the logical volume manager has been started.

Code:
here are the available partitions: (...)".
is good, as long as the list is not empty. That shows that thu kernel can read your hard drive.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mass85pl
n00b
n00b


Joined: 03 Mar 2015
Posts: 3

PostPosted: Wed Mar 04, 2015 8:42 pm    Post subject: Reply with quote

Thanks guys for your help, I've made it working. I don't know what the problem with my previous attempt was: bad initramfs created by the script or wrong parameters to kernel in grub.cfg. Anyway for the reference I am providing steps I took to make it working.

1. Generate initramfs with
Code:
genkernel --lvm --install initramfs

2. Rename the initramfs to match search pattern of grub2-mkconfig
3. Add line in /etc/default/grub
Code:
GRUB_CMDLINE_LINUX="dolvm"

4. Regenerate grub.cfg
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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