Skip to contentSkip to conversation

RAID+LVM

linux-lvm David Corbin 2 participants 3 messages Nov 24, 2002

lore
Share & tools
lore
#0 lore raw

I have a debian system with LVM on top of a RAID. Once up and running, it seems to work OK. It's the getting it up and running that's a problem. At boot, the raid drive is started, and then

               /sbin/vgscan --verbose >/root/vg.start
               /sbin/vgchange -a y --verbose >>/root/vg.start

This yields :
----vg.start----
vgscan -- removing "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- creating empty "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- reading all physical volumes (this may take a while...) vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group

vgchange -- locking logical volume manager
vgchange -- finding all volume group(s)
vgchange -- no volume groups found
----end----

Now, after the system finishes booting, if login as root and run those two commands again, I get.

----vg.start----
vgscan -- removing "/etc/lvmtab" and "/etc/lvmtab.d" vgscan -- creating empty "/etc/lvmtab" and "/etc/lvmtab.d" vgscan -- reading all physical volumes (this may take a while...) vgscan -- scanning for all active volume group(s) first vgscan -- reading data of volume group "vg0" from physical volume(s) vgscan -- found inactive volume group "vg0"
vgscan -- getting block device numbers for logical volumes

vgscan -- checking block device numbers of logical volumes

vgscan -- inserting "vg0" into lvmtab
vgscan -- backing up volume group "vg0"
vgscan -- checking volume group name "vg0"
vgscan -- checking volume group consistency of "vg0"
vgscan -- checking existence of "/etc/lvmtab.d"
vgscan -- storing volume group data of "vg0" in "/etc/lvmtab.d/vg0.tmp" vgscan -- storing physical volume data of "vg0" in "/etc/lvmtab.d/vg0.tmp" vgscan -- storing logical volume data of volume group "vg0" in "/etc/lvmtab.d/vg0.tmp" vgscan -- renaming "/etc/lvmtab.d/vg0.tmp" to "/etc/lvmtab.d/vg0"
vgscan -- removing special files and directory for volume group "vg0" vgscan -- creating directory and group character special file for "vg0" vgscan -- creating block device special files for vg0
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume group

vgchange -- locking logical volume manager
vgchange -- finding all volume group(s)
vgchange -- checking volume group name "vg0"
vgchange -- checking existence of volume group "vg0"
vgchange -- reading volume group data for "vg0" from lvmtab vgchange -- checking volume group consistency of "vg0"
vgchange -- checking if all physical volumes of volume group "vg0" are available vgchange -- creating VGDA for "vg0" in kernel
vgchange -- volume group "vg0" successfully activated

vgchange -- unlocking logical volume manager
----end----

and everything works.

Now, maybe this is a question better asked on the RAID list, but what's changing between the boot-time process and later that suddenly makes the LVM stuff work?

David Corbin.

#1 lore raw
Quoted 10 lines · David Corbin

I have a debian system with LVM on top of a RAID. Once up and running, it seems to work OK. It's the getting it up and running that's a problem. At boot, the raid drive is started, and then

               /sbin/vgscan --verbose >/root/vg.start
               /sbin/vgchange -a y --verbose >>/root/vg.start

Now, after the system finishes booting, if login as root and run those two commands again, I get.

I suppose your problem is the boot scritps trying to initialize LVM and software RAID in the wrong order (at least for your setup). To make a LVM on top of software RAID work, you first need to activate software RAID and then LVM.

Maybe in the boot sequence LVM is initialized first, and it fails. Then it activates software RAID, which succeedes. After system startup you just need to "vgchange -ay", and everything works ok.

Check /etc/rc2.d (runlevel 2 is typical for Debian), and see if rearranging boot scripts helps.

Regards,

Signature · 2 lines
Jose Luis Domingo Lopez
Linux Registered User #189436     Debian Linux Woody (Linux 2.4.19-pre6aa1)
#2 lore raw
Quoted 19 lines · Jose Luis Domingo Lopez
Quoted 9 lines · David Corbin

I have a debian system with LVM on top of a RAID. Once up and running, it seems to work OK. It's the getting it up and running that's a problem. At boot, the raid drive is started, and then

              /sbin/vgscan --verbose >/root/vg.start
              /sbin/vgchange -a y --verbose >>/root/vg.start

Now, after the system finishes booting, if login as root and run those two commands again, I get.

I suppose your problem is the boot scritps trying to initialize LVM and software RAID in the wrong order (at least for your setup). To make a LVM on top of software RAID work, you first need to activate software RAID and then LVM.

Quoted 8 lines

Maybe in the boot sequence LVM is initialized first, and it fails. Then it activates software RAID, which succeedes. After system startup you just need to "vgchange -ay", and everything works ok.

Check /etc/rc2.d (runlevel 2 is typical for Debian), and see if rearranging boot scripts helps.

I found the problem. I had re-arrange the scripts in rc0.d to be correct, but not rcS.d. Once they were in the correct order it works fine.

Quoted 4 lines

Regards,