Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM2, udev, and multipath [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
chardros
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 136
Location: Andromeda

PostPosted: Fri Apr 22, 2005 5:46 pm    Post subject: LVM2, udev, and multipath [SOLVED] Reply with quote

I've been plugging away at this for about two days... any help would be immensly appreciated. I've got two servers to configure, and haven't gotten the first one to work ideally yet.

I decided to go with LVM2 and am using udev. Everything worked great when building from the live cd. I set up my lvm volumes and groups, and upon doing a vgchange -ay, the groups and voilumes were populated properly in /dev.

I set up one volume group (vg0) and several volumes within it (usr, home, var, etc). After configuring my kernel and booting however, I ran into the issue of volumes appearing as dm-0, dm-1, etc in /dev. I did some research on the forums and found the multipath-tools ebuild. I installed that, vommented the proper lines out in rules and am now using the rule (from 40-multipath.rules):
Code:

KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK="%c"


Now, when I boot I have dm-0, dm-1, etc in /dev... but I ALSO have vg0-usr, vg0-home in /dev. They are NOT being populated to /dev/mapper as they were on the live cd. And I am NOT getting /dev/vg0/usr, /dev/vg0/home, etc as I was on the livecd. All I have is /dev/mapper/control, /dev/dm-[1,2,3,4], and /dev/vg0-[usr, home, var, etc].

This is workable, but I don't believe it's correct. For one, when I do an "lvscan", lvscan is still reporting the /dev/vg0/usr format. When I shut the box down, I get several lvm errors... reports that it cannot open the /dev/vg0 directory, etc.

I mounted the squashfs from the livecd to poke around, see if it was doing anything different, but I haven't come up with anything. Like I said, on the livecd, when the volumes were activated, they all just appeard, as they should.

I'm running the following versions of relevant packages:
sys-fs/lvm2-2.00.33-r1
sys-fs/multipath-tools-0.4.2
sys-fs/device-mapper-1.00.19-r2
sys-fs/sysfsutils-0.4.0
sys-fs/udev-054

One other note and question -
I'm building the kernel with genkernel (menuconfig turned on - heavily customized). I have device-mapper, raid1, etc etc all enabled/compiled in (lvm running on top of raid1). I ran genkernel with:

Code:

genkernel --udev --lvm2 --kernel-config=/etc/kernels/kernel-config-x86-2.6.11-gentoo-r6 all


I wasn't sure if I needed --lvm2 with device mapper compiled into the kernel.

Anyone have any thoughts on this matter? Any thoughts at all?

Thanks in advance.


Last edited by chardros on Fri Apr 22, 2005 9:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
chardros
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 136
Location: Andromeda

PostPosted: Fri Apr 22, 2005 9:28 pm    Post subject: Solved, I think. Reply with quote

OK, I think I solved this...

First, I modified /etc/init.d/checkfs and put --mknodes after vgscan in the LVM2 section. That fixed it. But I wasn't happy cause it felt like a hack.

So, I re-compiled the kernel without --lvm2 in the initrd (as I expected, this is only needed if you're booting to an lvm volume, which I'm not). After test-booting to make sure everything worked (it did), I removed --mknodes from checkfs, restoring checkfs to it's original state. I test-booted again, and again, everything worked fine.

My best guess is, that during boot, with lvm2 in initrd, the lvm2 stuff starts up, populates dev. Then when udev starts, it clobbers what lvm2 had placed there? Does this sound feasible? Doing the --mknodes in checkfs restored it, but it's not needed when you omit lvm2 from initrd... it seems that the first time vgchange -a y is run (which is also ran from checkfs) the device nodes are auto-poulated. When the lvm2 stuff was in initrd, this wasn't happening in checkfs because it wasn't the first time it had ran.

I have NO IDEA if all that speculation is valid... but I'll go with it ;).

I had also read this (Gentoo Wiki): http://gentoo-wiki.com/HOWTO_Install_Gentoo_on_an_LVM2_root_partition

In there, he mentions adding --mknodes to checkroot. So I guess if you ARE booting to an lvm2 device, and need the lvm-enabled initrd, the --mknodes alteration is required. But in this case, I don't need all that. root and boot partitions are outside lvm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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