[TriLUG] Problem with LVM

Brian McCullough bdmc at bdmcc-us.com
Sun Jun 4 23:58:12 EDT 2006


On Sun, Jun 04, 2006 at 03:55:49PM -0400, T. Bryan wrote:
> I tried rebuilding everything.  My only remaining problem is that things 
> don't quite work on boot.  Details are below, but after I boot and login, 
> the quickest way to get everything working is to 
> /etc/init.d/lvm stop
> mdadm -S /dev/md0
> mdadm -As /dev/md0
> /etc/init.d/lvm start

I'm sure that David is quite capable of contributing some words of
wisdom, here.  I'm sure that I'm missing something obvious.



This is starting to smell suspiciously like a faulty initrd file.  As
you say, you have MD active during the dmesg time, but no sign of LVM
activity.  Although you aren't using LVM as root, it might be a good
idea to make sure that you have LVM available "in the kernel" at 
boot time.

Incidentally, side note time -- do you have both MD component partitions
( hde1 and hdg1, if I remember correctly ) marked as type "fd",
Linux Automatic Raid?  ( not really an issue, since you show that the MD
part of things is working )

Also, we haven't discussed this -- we talked about filtering out the
components of the md array, but did we talk about filtering IN the md0
device itself?  Same part of the lvm.conf file, but using the "a" flag
instead of the "r'.

OK, I think that we have established the following, but bear with me.

Use fdisk to create two, identically-sized, type "fd" partitions, hde1 
and hdg1.
Use mdadm to create md0 from those two partitions, in RAID 1
configuration.
Use pvcreate on md0.
Use vgcreate, using md0.
Use lvcreate, using new VG.
Format the new LV.
Modify fstab appropriately.

At this point you should be able to mount and use the LV as a normal
part of your filesystem.



> I have the following symlinks in /etc/rc2.d/
> S25mdadm
> S25mdadm-raid
> S26lvm


Silly question, but S26lvm _does_ point at a reasonable location,
doesn't it? 


> Odd.  Still no volume group found.  Then, 
> 
> # mdadm -S /dev/md0
> # mdadm -As /dev/md0
> mdadm: /dev/md0 has been started with 2 drives.
> 
> Now, if I run lvmdiskscan, it sees the LVM physical volume
>   /dev/md0  [      111.79 GB] LVM physical volume


But you haven't run vgscan yet.  That is essential for any of the
funtionality that you are looking for.  vgscan followed by vgchange,
which is what your restart of /etc/init.d/lvm is doing.

For some reason, this looks as if MD is not actually starting properly
at boot time -- weird.



> # /etc/rc2.d/S26lvm start
> Setting up LVM Volume Groups...
>   Reading all physical volumes.  This may take a while...
>   Found volume group "localvg" using metadata type lvm2
>   /dev/localvg: opendir failed: No such file or directory
>   1 logical volume(s) in volume group "localvg" now active


I don't like that error message.  It seems to be out of order.



> Now, I can see the logical device in /dev/mapper/ and at /dev/localvg.  
> Strange.  I could script this workaround every time I boot, but it sounds 
> like something is broken.  I'd prefer fix it now while I'm messing with it.  

I agree that something is broken.  I just think that I'm missing
something vital in what you are saying, or not saying.


> ---Tom


Brian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2229 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20060604/a5a45f3c/attachment.bin>


More information about the TriLUG mailing list