1828368 Members
2710 Online
109976 Solutions
New Discussion

about lvm!

 
leyearn
Regular Advisor

about lvm!

kernel : 2.4.7-10

I installed the package :lvm-1.0.3-4.i386.rpm

but

[root@localhost root]# fdisk -l /dev/hdb

Disk /dev/hdb: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 51 102784+ 8e Linux LVM
/dev/hdb2 52 153 205632 8e Linux LVM
/dev/hdb3 154 306 308448 8e Linux LVM
[root@localhost root]# pvcreate /hdb1
pvcreate -- ERROR: "/etc/lvmtab" doesn't exist; please run vgscan

[root@localhost root]# pvcreate /dev/hdb1
pvcreate -- ERROR: "/etc/lvmtab" doesn't exist; please run vgscan

[root@localhost root]# vgscan
vgscan -- LVM driver/module not loaded?

[root@localhost root]#

what can i do next ?
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: about lvm!

vgscan -a doesn't work?

rpm -q lvm

use rpm to remove and reinstall it. It would seem based on my guess that the kernel is new enough to understand lvm.

What about installint the lvm from the original distribution disks? Thats designed to work right.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: about lvm!

Here's a few bits and pieces which might help you.

Below is an extract from the '/etc/rc.d/rc.sysinit' on all recent RH distributions (well, a version of this atleast):

# LVM initialization
if [ -f /etc/lvmtab ]; then
[ -e /proc/lvm ] || modprobe lvm-mod > /dev/null 2>&1
if [ -e /proc/lvm -a -x /sbin/vgchange ]; then
action $"Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y
fi
fi


It goes out of it's way to only do stuff if it's supposed to, but from this you can tell that you need to do the following on a modular linux system to get LVM working:

modprobe lvm-mod
/sbin/vgscan
/sbin/vgchange -a y

Once this is done, you should be able to pvcreate/vgcreate/lvcreate etc..

Please note however that under LV 1.0.3 on Linux, exporting volume groups causes issues (vgexport). You need atleast 1.0.8 of the tool set to get that bit working properly!

Found that out right after exporting my volume groups, booting up in single after swapping HDD's and tried re-importing the exporting file-systems :P

Do you know how hard it is to browse the 'net on a text-based system *without* a working DNS server in an 80x25 console ? :P Much fun.

Got it up and working after a short time, by downloading an src.rpm of 1.0.8 and re-compiling it.. Go machine at home! *kicks bekar.id.au*..

I wonder however, why are you using 3 different partitions, instead of just one big partition for your phiscal volumes? Or are you planning some sort of striping across multiple disks (I wasn't aware that the Linux LVM supported striping properly) ?
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: about lvm!

Oh, side note SEP.. Have you ever been able to configure pv/vg/lv's in the RH installation ?

I've never been able to find how to do anything other than assign LVM partitions. :-/

The only way I convinced the install to do it was to use a KS (http/php ks routine):
if ( isset( $diskspace ) ) {
printf( "part pv.0 --size 1 --grow\n" );
printf( "volgroup vgLocal00 pv.0\n" );
printf( "logvol / --vgname=vgLocal00 --name=root_lv --size %d --fstype reiserfs\n",
( $diskspace - 1048576 - 102400 - ( $memsize * 2 ) ) / 1024 );
} else {
printf( "part / --fstype ext3 --size 1 --grow\n" );
}

Automatic partition creation based on phiscal configuration of system as discerned during KS install.. I love my work sometimes :) So much fun :)
One long-haired git at your service...
leyearn
Regular Advisor

Re: about lvm!

there is no -a option with vgscan
[root@localhost root]# vgscan -d
<1> lvm_get_iop_version -- CALLED
<22> lvm_check_special -- CALLED
<22> lvm_check_special -- LEAVING
<1> lvm_get_iop_version -- AFTER ioctl ret: -102
<1> lvm_get_iop_version -- LEAVING with ret: -102
vgscan -- LVM driver/module not loaded?

[root@localhost root]# rpm -q lvm
lvm-1.0.3-4
[root@localhost root]#
Stuart Browne
Honored Contributor

Re: about lvm!

leyearn, try a 'modprobe mod-lvm' first, then 'vgscan' followed by 'vgchange -a'.
One long-haired git at your service...
leyearn
Regular Advisor

Re: about lvm!

what's the module-name of lvm?
no lvm
no LVM
no mod-lvm
no lvm-mod
Stuart Browne
Honored Contributor

Re: about lvm!

My apologies, I wrote it back-to-front in that last post. Should be 'modprobe lvm-mod'.

That being said, you're using a 2.4.7-10 kernel, which might not have LVN enabled or compiled with it.

From a quick bit of research, you're using a stock RH7.2 machine. No default LVM support.

This means you'll need to get either a newer kernel package (unsure if any of the RH7.2 eratta included LVM support), kernel-source package for a more recent distribution (2.4.21-xxx for RH9 for instance), or a stock-kernel (from ftp.kernel.org) and compile yourself a new kernel.

If you're lucky, the RH7.2 kernel-source might have an up-to-date-enough lvm moduels applied to it to just be able to re-compile the kernel version you've already got.

This just stopped being a 'simple process', and turned into a pretty hard one for a beginner.

You feel up to compiling your own kernel etc. ?
One long-haired git at your service...
leyearn
Regular Advisor

Re: about lvm!

Hi
I am a beginner of Linux
I havn't experienced the recompiling Kernel
can you advice me a doc about recompiling Kernel?
thanks
Vitaly Karasik_1
Honored Contributor

Re: about lvm!

leyearn,

Instead of adding LVM support into RHL7.2 old and unsupported kernel, I suggest you to install on your linux box RHEL3.0, so yuo will receive LVM support out-of-the-box.

Rgds,
Vitaly
Alzhy
Honored Contributor

Re: about lvm!

Interesting.

So is the LVM Linux implementation similar to HP-UX? Like my LVM skills will apply on Linux environments?

Hmmm gotta try this on my Ubunto/MEPIS rigs...
Hakuna Matata.
Ivan Ferreira
Honored Contributor

Re: about lvm!

LVM in Linux is more similar to LVM in AIX rather than HP-UX. HP-UX LVM is hard to configure (mknod?), you will be happy with LVM in Linux.

I agree that you should upgrade your Linux version, you can use also Fedora wich supports LVM.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?