Skip to contentSkip to conversation

LVM with devfs questions and patches

linux-lvm Benoit Gaussen 6 participants 11 messages Feb 14, 2001 – Feb 20, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

Thanks for those, I've reworked them a little but the effect should be the same.

Hi,

I saw the changes in the CVS tree except for one thing that I forgot to tell about in my previous mail.

There is a mistake in the devfs registration of /dev/lvm, the major and minor numbers are swapped :

Just an extract of the patch :

lvm_devfs_handle = devfs_register(
- 0 , "lvm", 0, 0, LVM_CHAR_MAJOR,
+ 0 , "lvm", 0, LVM_CHAR_MAJOR, 0,
S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, &lvm_chr_fops, NULL);

Ben.

Signature · 2 lines
Unix IS user friendly, it is just selective about who his friends are.
                                                             Anonymous
#1 lore raw

Review

Quoted 13 lines · Benoit Gaussen

I saw the changes in the CVS tree except for one thing that I forgot to tell about in my previous mail.

There is a mistake in the devfs registration of /dev/lvm, the major and minor numbers are swapped :

Just an extract of the patch :

lvm_devfs_handle = devfs_register(

(quoted diff) +1 -1
-		0 , "lvm", 0, 0, LVM_CHAR_MAJOR,
+		0 , "lvm", 0, LVM_CHAR_MAJOR, 0,
 		S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
 		&lvm_chr_fops, NULL);

I noticed your change, and it is also in the devfs patch that I submitted.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#2 lore raw

[linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

In reply to Benoit Gaussen

I was unable to create RAID1 PVs under 0.9.1_beta2 (RH 7.0.90 - Fisher), so I used some raw partitions. I upgraded to 0.9.1_beta4 (which fixed the OOPS or boot - great!) and have managed to create and add the RAID PV.

I'd like to remove the old PVs, and the empty one was `vgreduce's OK, but I can't pvmove the data from the old one.

# pvmove /dev/hda9 
pvmove -- moving physical extents in inactive volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- ERROR "pv_move_pe(): PE lock" pv_move_pe

pvmove -- ERROR "pv_move_pe(): PE lock" moving physical extents

#

Any ideas ?

I was hoping to HACK it pro tem, and create new LVs by specifying the PVs to use, but this too failed:

# lvcreate -L 50M -n repl vg01 /dev/md8
lvcreate -- rounding up size to physical extent boundary "52 MB"
lvcreate -- couldn't read physical volume "/dev/md8"

#

Should this work ? (the man page doesn't describe `[PhysicalVolumePath...]'

Not directly LVM, but if I run out of inodes, is there some way to extend an ext2 FS so that the ratio of inodes/block is higher than the original FS ?

% cat /proc/lvm/global
LVM driver version 0.9.1_beta4 (09/02/2001)

Total:  1 VG  2 PVs  2 LVs (0 LVs open)
Global: 12656 bytes malloced   IOP version: 10   11:29:30 active

VG: vg01 [2 PV, 2 LV/0 open] PE Size: 4096 KB
Usage [KB/PE]: 2097152 /512 total 122880 /30 used 1974272 /482 free
PVs: [AA] hda9 1048576 /256 106496 /26 942080/230
[AA] md8 1048576 /256 0 /0 1048576/256
LVs: [AWDL ] lv01 106496 /26 close
[ARDL ] snap-lv01 106496 /26 close
%

#3 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

Quoted 7 lines · Piete Brooks

I was unable to create RAID1 PVs under 0.9.1_beta2 (RH 7.0.90 - Fisher), so I used some raw partitions. I upgraded to 0.9.1_beta4 (which fixed the OOPS or boot - great!) and have managed to create and add the RAID PV.

I'd like to remove the old PVs, and the empty one was `vgreduce's OK, but I can't pvmove the data from the old one.

Quoted 7 lines
# pvmove /dev/hda9 
pvmove -- moving physical extents in inactive volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- ERROR "pv_move_pe(): PE lock" pv_move_pe

pvmove -- ERROR "pv_move_pe(): PE lock" moving physical extents

i believe the vg should be active....

Quoted 6 lines

I was hoping to HACK it pro tem, and create new LVs by specifying the PVs to use, but this too failed:

# lvcreate -L 50M -n repl vg01 /dev/md8
lvcreate -- rounding up size to physical extent boundary "52 MB"
lvcreate -- couldn't read physical volume "/dev/md8"

it should can you send a debug output...

L.

Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
#4 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

Quoted 8 lines
Quoted 7 lines
# pvmove /dev/hda9 
pvmove -- moving physical extents in inactive volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- ERROR "pv_move_pe(): PE lock" pv_move_pe

pvmove -- ERROR "pv_move_pe(): PE lock" moving physical extents

i believe the vg should be active....

Sigh -- it warns that data loss can occur if they are active, so I assumed that they should be inactive. If it has to be active, why does it quietly say `extents in inactive volume' and not warn that they should be active ?

I got the data onto the RAID device, and when that's active, I get a different message:

# pvmove /dev/md7
pvmove -- ERROR "pv_read(): multiple device" reading source physical volume 
"/dev/md7"
# cat /proc/lvm/global    
LVM driver version 0.9.1_beta4 (09/02/2001)

Total: 1 VG 3 PVs 2 LVs (2 LVs open 2 times)

Global: 10276 bytes malloced IOP version: 10 0:19:55 active

VG: vg01 [3 PV, 2 LV/2 open] PE Size: 4096 KB
Usage [KB/PE]: 3145728 /768 total 1257472 /307 used 1888256 /461 free

  PVs: [AA] md8                    1048576 /256      1048576 /256         0/0
       [AA] md7                    1048576 /256       208896 /51     839680/205
       [AA] md6                    1048576 /256            0 /0     1048576/256
    LVs: [AWDL  ] repl                        348160 /85       1x open
         [AWDL  ] scratch                     909312 /222      1x open

#

#5 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

Quoted 6 lines · Piete Brooks
Quoted 6 lines
Quoted 6 lines
# pvmove /dev/hda9 
pvmove -- moving physical extents in inactive volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- ERROR "pv_move_pe(): PE lock" pv_move_pe
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

pvmove -- ERROR "pv_move_pe(): PE lock" moving physical extents

i believe the vg should be active....

Sigh -- it warns that data loss can occur if they are active, so I assumed that they should be inactive. If it has to be active, why does it quietly say `extents in inactive volume' and not warn that they should be active ?

I think the warning is just telling you that if you loose power whilst the move is in progress bad things could happen. Heinz can you clarify please.

- Joe

#6 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

Quoted 10 lines · Joe Thornber
Quoted 9 lines · Piete Brooks
Quoted 8 lines
Quoted 7 lines
# pvmove /dev/hda9 
pvmove -- moving physical extents in inactive volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- ERROR "pv_move_pe(): PE lock" pv_move_pe

pvmove -- ERROR "pv_move_pe(): PE lock" moving physical extents

i believe the vg should be active....

Quoted 7 lines
Quoted 3 lines

Sigh -- it warns that data loss can occur if they are active, so I assumed that they should be inactive. If it has to be active, why does it quietly say `extents in inactive volume' and not warn that they should be active ?

I think the warning is just telling you that if you loose power whilst the move is in progress bad things could happen. Heinz can you clarify please.

Yes, that warning exactly means that.
There's an aproach to work around that already but it's not yet implemented :-(

OTOH the ERROR displayed shouldn't happen.
Is probably related to the MD assumption further down in this thread.

As Andreas Dilger pointed out: we need to fix pv_read() and friends in order to stop dealing with MDs through error codes.

Quoted 6 lines

- Joe
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#7 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock" pv_move_pe

In reply to Piete Brooks
Quoted 6 lines · Piete Brooks

I got the data onto the RAID device, and when that's active, I get a different message:

# pvmove /dev/md7
pvmove -- ERROR "pv_read(): multiple device" reading source physical volume 
"/dev/md7"

This is because (I don't know why) LVM user tools return an "error code" when accessing an MD device. It is up to the caller to single out the MD error code, and pretend like it is OK. Probably pvmove (or pv_read) doesn't do this correctly. IMO we should treat MD devices just like regular devices, since pv_read_all_pv_of_vg() already cleans this up for us.

Maybe the MD cleanup should be moved down to pv_read_all_pv() and be done with it? This may cause some problems if people are doing changes to LVM when the MD devices are not active, but this problem is there no matter where we do filtering of MD devices.

In any case, try the below patch, and it should fix this problem.

Cheers, Andreas
=============================================================================

pvmove.c +2 -1
diff -u -u -r1.3.2.5 pvmove.c
@@ -234,7 +234,8 @@
 
    if ( opt_v > 0) printf ( "%s -- reading data of source physical volume "
                             "from \"%s\"\n", cmd, src_pv_name);
-   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0) {
+   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0 &&
+	ret != -LVM_EPV_READ_MD_DEVICE) {
       if ( ret == -LVM_EPV_READ_OPEN) {
          fprintf ( stderr, "%s -- source physical volume \"%s\" "
                            "doesn't exist\n\n",
Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#8 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock"

Quoted 1 line

In any case, try the below patch, and it should fix this problem.

# pvmove /dev/md7
pvmove -- moving physical extents in active volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- doing automatic backup of volume group "vg01"
pvmove -- 76 extents of physical volume "/dev/md7" successfully moved

#

Many thanks -- seems to work a treat !

#9 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock"

It looks like the fix for this problem is not yet in CVS. I'm pretty sure Heinz has taken a look at the patch already as well (at least he commented on this thread). This fixes a BUG where it is not possible to do pvmove on an MD device.

Quoted 10 lines
Quoted 1 line

In any case, try the below patch, and it should fix this problem.

# pvmove /dev/md7
pvmove -- moving physical extents in active volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- doing automatic backup of volume group "vg01"
pvmove -- 76 extents of physical volume "/dev/md7" successfully moved

Many thanks -- seems to work a treat !

Here is the patch again.

Cheers, Andreas
============================================================================

pvmove.c +2 -1
diff -u -u -r1.3.2.5 pvmove.c
@@ -234,7 +234,8 @@
 
    if ( opt_v > 0) printf ( "%s -- reading data of source physical volume "
                             "from \"%s\"\n", cmd, src_pv_name);
-   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0) {
+   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0 &&
+	ret != -LVM_EPV_READ_MD_DEVICE) {
       if ( ret == -LVM_EPV_READ_OPEN) {
          fprintf ( stderr, "%s -- source physical volume \"%s\" "
                            "doesn't exist\n\n",
Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#10 lore raw

Re: [linux-lvm] Newbie question: ERROR "pv_move_pe(): PE lock"

It will show up in the next release.
Added the check Andreas recommended for destination PVs as well.

Quoted 42 lines · Andreas Dilger

It looks like the fix for this problem is not yet in CVS. I'm pretty sure Heinz has taken a look at the patch already as well (at least he commented on this thread). This fixes a BUG where it is not possible to do pvmove on an MD device.

Quoted 10 lines
Quoted 1 line

In any case, try the below patch, and it should fix this problem.

# pvmove /dev/md7
pvmove -- moving physical extents in active volume group "vg01"
pvmove -- WARNING: moving of active logical volumes may cause data loss!
pvmove -- do you want to continue? [y/n] y
pvmove -- doing automatic backup of volume group "vg01"
pvmove -- 76 extents of physical volume "/dev/md7" successfully moved

Many thanks -- seems to work a treat !

Here is the patch again.

Cheers, Andreas
============================================================================
diff -u -u -r1.3.2.5 pvmove.c

pvmove.c +2 -1
@@ -234,7 +234,8 @@
 
    if ( opt_v > 0) printf ( "%s -- reading data of source physical volume "
                             "from \"%s\"\n", cmd, src_pv_name);
-   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0) {
+   if ( ( ret = pv_read ( src_pv_name, &pv, NULL)) < 0 &&
+	ret != -LVM_EPV_READ_MD_DEVICE) {
       if ( ret == -LVM_EPV_READ_OPEN) {
          fprintf ( stderr, "%s -- source physical volume \"%s\" "
                            "doesn't exist\n\n",
Signature · 8 lines
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-