linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Problems with LVM 0.6
@ 1999-03-04 17:25 Steve Brueggeman
  1999-03-05 10:40 ` Klaus Strebel
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Brueggeman @ 1999-03-04 17:25 UTC (permalink / raw)
  To: linux-lvm

First off, I had trouble compiling the tools.  I got a warning that
"LVM_BLK_MAJOR" was undeclared, when compiling
tools/lib/lvm_tab_get_free_blk_dev.c

Since I could not find any defination anywhere for LVM_BLK_MAJOR, I
assumed that some sort of name change was not properly propegated, and
renamed all occurances of "LVM_BLK_MAJOR" to "LVM_BLOCK_MAJOR" in
tools/lib/lvm_tab_get_free_blk_dev.c, and the compile completed
successfully.

However,
I am now having problems when creating a second Logica volume.  These
are the steps I took

Using fdisk, created  3 partitions, /dev/sdb2, /dev/sdb3, and /dev/sdb4,
and set the partition type to FE. (Note that /dev/sdb1 is a swap
partition).

pvcreate /dev/sdb[23]
vgcreate test_vg /dev/sdb[23]
lvcreate -L1500 -nlv1 test_vg
mke2fs /dev/test_vg/lv1
(this created a very small filesystem.  Apperently the -L is not
assuming a size modifier of Megabyte)

I deleted the test logical volume with
lvremove -f /dev/test_vg/lv1

and created two new logical volumes with

lvcreate -L1500M -nlv1 test_vg
lvcreate -L3G -nlv2 test_vg
mke2fs /dev/test_vg/lv1
mke2fs /dev/test_vg/lv2

mount /dev/test_vg/lv1 /mnt1 
suceeded, but
mount /dev/test_vg/lv2 /mnt2
said that either lv2 or mnt2 was already mounted

I did a ls -l of /dev/test_vg and have the following

total 0
crw-r-----   1 root     root     109,   0 Mar  4 10:54 group
brw-r-----   1 root     root      58,   0 Mar  4 10:55 lv1
brw-r-----   1 root     root      58,   0 Mar  4 10:56 lv2

Why do lv1 and lv2 have the exact same major and minor values???  
Is this related to my possibly incorrect assumption above that
LVM_BLK_MAJOR needed to be renamed to LVM_BLOCK_MAJOR????

Has anybody else seen problems like this? 
Or is it something that I've done wrong?  
Anybody out there who can help me?


Steve Brueggeman
steve_brueggeman@notes.seagate.com
stevebr@primenet.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Problems with LVM 0.6
  1999-03-04 17:25 [linux-lvm] Problems with LVM 0.6 Steve Brueggeman
@ 1999-03-05 10:40 ` Klaus Strebel
  0 siblings, 0 replies; 3+ messages in thread
From: Klaus Strebel @ 1999-03-05 10:40 UTC (permalink / raw)
  To: Steve Brueggeman; +Cc: linux-lvm

Hi Steve,

Steve Brueggeman wrote:
> 
> First off, I had trouble compiling the tools.  I got a warning that
> "LVM_BLK_MAJOR" was undeclared, when compiling
> tools/lib/lvm_tab_get_free_blk_dev.c
Seems to me, that your patch was not successfull. LVM_BLK_MAJOR is to be defined
in $LINUX_SRC/include/linux/major.h. Look for a .rej file in that directory
(btw. this should be done after every patch ;-)). The sequence in the INSTALL
file should be changed: first patch the kernel sources, then build the tools.
The other things is, that, if you apply the patch to a already patched source
(ex. to update LVM0-5alpha to 0.6_also_alpha), the new module source is inserted
to the beginning of the source file, both versions are in it and the compiler is
the talking to you, telling you funny things ;-). Perhaps there should be
upgrade-patches-from-xx-to-yy ?

One very very heavy problem i ran in yesterday was, that the dynamic creation of
the /dev/lvm device-file with devfs does not work in lvm-0.6 anymore (sorry, i
didn't search why). So i have to create the /dev/lvm after loading the
lvm-module before i can vgscan. 

Btw. what are the files vgscan creates in /etc are used for. Is it possible to
suppress creation (or even rw-access) to these files if they already exist?
Background is, that i have to fsck and remount,rw my root-fs before i can use
lvm. Is that really neccessary?

But, after all that criticism, cheers for this software! It is what i waited
for! Let`s get it stable quickly!

Ciao
Klaus
-- 
Klaus Strebel
stb@ep-ag.com
EIGNER + PARTNER AG   - The Engineering Warehouse Company -
<http://www.ep-ag.com>
-----------------------------------------------------------------------
In Heaven there will be no DOS, no Intel, and above all, no Bill Gates.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Problems with LVM 0.6
@ 1999-03-05 20:59 Steve_J_Brueggeman
  0 siblings, 0 replies; 3+ messages in thread
From: Steve_J_Brueggeman @ 1999-03-05 20:59 UTC (permalink / raw)
  To: marka; +Cc: stevebr, linux-lvm


I've found the problem. It lies in tools/lib/lvm_tab_get_free_blk_dev.c
I've changed from
--------------------------top------------------------
#define   GET_LV_DEV \
   { \
      int i, l; \
      for ( i = 0; i < lv_dev_count - 1; i++) { \
         for ( l = 0; l < lv_dev_count; l++) { \
            if ( lv_dev == lv_dev_this[l]) lv_dev++; \
         } \
      } \
   }

--------------------------bot------------------------

to
--------------------------top------------------------
#define GET_LV_DEV \
   { \
      int i, l, foundfree=0; \
      for ( i = 0; (i < lv_dev_count) && !foundfree; i++) { \
         foundfree = 1; \
         for ( l = 0; l < lv_dev_count; l++) { \
            if ( lv_dev == lv_dev_this[l]) { \
              lv_dev++; \
              foundfree = 0; \
            } \
         } \
      } \
   }
--------------------------bot------------------------
This changes the outer loop to test the whole list again.  The problem was
when the number of existing Logical Devices was 1, the outer loops test
would fail, and no matches would be found, so minor #0 would get reused
again.

I also added a test to drop out early, if the inner loop has made a whole
round without finding any matches.  I'm sure there's a better way, but I
was in a hurry.


#define VG_BLK(a)       ( vg_lv_map[minor].vg_number)
#define LV_BLK(a)       ( vg_lv_map[minor].lv_number)

Also, while I was perusing the source, I noticed the following oddity, in
include/linux/lvm.h, the following are defined...
--------------------------top------------------------
/* block minor indexes into a volume group/logical volume indirection table
 */
#define VG_BLK(a)       ( vg_lv_map[minor].vg_number)
#define LV_BLK(a)       ( vg_lv_map[minor].lv_number)
--------------------------bot------------------------

Note that the macro parameter (a) is not used in the macro defination.  I
believe in the above that [minor] should be changed to [(a)], as follows
#define VG_BLK(a)       ( vg_lv_map[(a)].vg_number)
#define LV_BLK(a)       ( vg_lv_map[(a)].lv_number)


The above changes have resolved the problem I was having, but I have not
tested them out thoroughly, and I may have made some bad assumptions.  Let
me know.

Steve Brueggeman






marka@a-wicked.demon.co.uk on 03/05/99 11:59:46 AM

To:   Steve J Brueggeman, stevebr@primenet.com
cc:
Subject:  [linux-lvm] Problems with LVM 0.6




Hello Steve,

My mistake, thinking about it the minor number should increment
what I did also was roll back to 0.5 version of lvm
then created two logical volumes

here is the output

crw-r-----   1 root     root     109,   0 Mar  4 19:11 group
brw-r-----   1 root     root      58,   1 Mar  4 19:12 lvol1
brw-r-----   1 root     root      58,   2 Mar  4 19:12 lvol2

as you can see from yours the minor number for the lvols is the same as
the minor number for the group file

Regards

Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-03-05 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-04 17:25 [linux-lvm] Problems with LVM 0.6 Steve Brueggeman
1999-03-05 10:40 ` Klaus Strebel
1999-03-05 20:59 Steve_J_Brueggeman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).