Skip to contentSkip to conversation

lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'

linux-lvm Matt McHenry 3 participants 13 messages Oct 28, 2006 – Nov 15, 2006

lore
Share & tools
lore
#0 lore raw

[2nd try sending; apologies if duplicate]

I'm running lvm2 under gentoo, and I'm getting this error when I
try to create a new logical volume:

# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.

The new vg shows up in only one of two places under /dev:

# ls /dev/maingroup/
c-p  capture  gen-website  home  music  opt  swap1  swap2  tmp  usr  var
# ls /dev/mapper/
control            maingroup-gen--website  maingroup-swap1  maingroup-var
maingroup-c--p     maingroup-home          maingroup-swap2
maingroup-capture  maingroup-music         maingroup-tmp
maingroup-dvd      maingroup-opt           maingroup-usr

And I can't create a file system on it:

# mke2fs -j /dev/mapper/maingroup-dvd
mke2fs 1.39 (29-May-2006)
mke2fs: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to reboot
        to re-read your partition table.

I found this mailing list post
[http://www.redhat.com/archives/linux-lvm/2006-April/msg00047.html] and thought that maybe one of my pvs was bad, so I tried to add a new pv (sda12) and migrate off of the most-recently-added one (sda11), but the 'pvmove' command gave a similar error and said to run 'pvmove --abort'. But that just hung. I tried to shut down in order to abort it, but that hung 'unmounting local filesystems'. When I forced a reboot, another of my volumes (named gen-website) seemed to have been lost.

My first try sending this message included a level 7 log file as
an attachment. I think the mailing list may have rejected the message because it was too big (262k), so I'm excluding it for now. Below are some more details on my setup. Forgive me if there's extraneous stuff here, but I want to try to provide as much detail as necessary; if there's any more info that would be useful, please let me know.

# uname -a
Linux localhost 2.6.14-gentoo-r5 #4 SMP PREEMPT Wed Sep 13 22:40:49 EDT
2006 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
# lvm version
  LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.07 (2006-05-11)
  Driver version:  4.4.0
# fdisk -l /dev/sda

Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          17      136521   83  Linux
/dev/sda2              18          34      136552+  da  Non-FS data
/dev/sda3              35          66      257040   da  Non-FS data
/dev/sda4              67       38913   312038527+   5  Extended
/dev/sda5              67        1312    10008463+  83  Linux
/dev/sda6            1313        3803    20008926   8e  Linux LVM
/dev/sda7            3804        8784    40009851   8e  Linux LVM
/dev/sda8            8785       18745    80011701   8e  Linux LVM
/dev/sda9           18746       28706    80011701   8e  Linux LVM
/dev/sda10          28707       33687    40009851   8e  Linux LVM
/dev/sda11          33688       36178    20008926   8e  Linux LVM
/dev/sda12          36179       38668    20000893+  8e  Linux LVM
/dev/sda13          38669       38913     1967931   83  Linux
# pvs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  PV         VG        Fmt  Attr PSize  PFree
  /dev/sda10 maingroup lvm2 a-   38.15G 516.00M
  /dev/sda11 maingroup lvm2 a-   38.15G  23.15G
  /dev/sda12 maingroup lvm2 a-   19.07G   4.07G
  /dev/sda6  maingroup lvm2 a-   19.08G      0
  /dev/sda7  maingroup lvm2 a-   38.15G      0
  /dev/sda8  maingroup lvm2 a-   76.30G      0
  /dev/sda9  maingroup lvm2 a-   76.30G      0
# vgs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  VG        #PV #LV #SN Attr   VSize   VFree
  maingroup   7  12   0 wz--n- 305.21G 27.73G
# lvs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  LV          VG        Attr   LSize   Origin Snap%  Move Log Copy%
  c-p         maingroup -wi-a-   4.00G
  capture     maingroup -wi-ao  68.00G
  gen-website maingroup -wI-d-  15.00G
  home        maingroup -wi-ao 110.00G
  music       maingroup -wi-ao  30.00G
  opt         maingroup -wi-ao   4.00G
  swap1       maingroup -wi-ao   1.00G
  swap2       maingroup -wi-ao   1.00G
  tmp         maingroup -wi-ao   2.00G
  usr         maingroup -wi-ao  20.00G
  var         maingroup -wi-ao   7.49G
# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website:
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-dvd:
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-pvmove0:
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

#1 lore raw

It appears to me that somehow the device-mapper device was created, but the table has not yet been loaded.

While this is the case, you will not be able to create an LV of the same name. (It will always give you the "device-mapper: reload ioctl failed:..." error.)

If you reboot the machine does the "maingroup-dvd:" still show up from 'dmsetup table'?

Also, after a reboot, be sure to run 'pvmove --abort'.

Once you've canceled the pvmove successfully, I would do a 'dmsetup remove maingroup-dvd; and try the 'lvcreate -L 15G -n dvd maingroup' again.

brassow

Quoted 143 lines · Matt McHenry

[2nd try sending; apologies if duplicate]

I'm running lvm2 under gentoo, and I'm getting this error when I
try to create a new logical volume:

# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.

The new vg shows up in only one of two places under /dev:

# ls /dev/maingroup/
c-p  capture  gen-website  home  music  opt  swap1  swap2  tmp  usr  var
# ls /dev/mapper/
control            maingroup-gen--website  maingroup-swap1  maingroup-var
maingroup-c--p     maingroup-home          maingroup-swap2
maingroup-capture  maingroup-music         maingroup-tmp
maingroup-dvd      maingroup-opt           maingroup-usr

And I can't create a file system on it:

# mke2fs -j /dev/mapper/maingroup-dvd
mke2fs 1.39 (29-May-2006)
mke2fs: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to 
reboot
        to re-read your partition table.

I found this mailing list post
[http://www.redhat.com/archives/linux-lvm/2006-April/msg00047.html] and thought that maybe one of my pvs was bad, so I tried to add a new pv (sda12) and migrate off of the most-recently-added one (sda11), but the 'pvmove' command gave a similar error and said to run 'pvmove --abort'. But that just hung. I tried to shut down in order to abort
it, but that hung 'unmounting local filesystems'. When I forced a reboot, another of my volumes (named gen-website) seemed to have been lost.

My first try sending this message included a level 7 log file as an
attachment. I think the mailing list may have rejected the message because it was too big (262k), so I'm excluding it for now. Below are some more details on my setup. Forgive me if there's extraneous stuff here, but I want to try to provide as much detail as necessary; if there's any more info that would be useful, please let me know.

# uname -a
Linux localhost 2.6.14-gentoo-r5 #4 SMP PREEMPT Wed Sep 13 22:40:49 EDT
2006 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
# lvm version
  LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.07 (2006-05-11)
  Driver version:  4.4.0
# fdisk -l /dev/sda

Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          17      136521   83  Linux
/dev/sda2              18          34      136552+  da  Non-FS data
/dev/sda3              35          66      257040   da  Non-FS data
/dev/sda4              67       38913   312038527+   5  Extended
/dev/sda5              67        1312    10008463+  83  Linux
/dev/sda6            1313        3803    20008926   8e  Linux LVM
/dev/sda7            3804        8784    40009851   8e  Linux LVM
/dev/sda8            8785       18745    80011701   8e  Linux LVM
/dev/sda9           18746       28706    80011701   8e  Linux LVM
/dev/sda10          28707       33687    40009851   8e  Linux LVM
/dev/sda11          33688       36178    20008926   8e  Linux LVM
/dev/sda12          36179       38668    20000893+  8e  Linux LVM
/dev/sda13          38669       38913     1967931   83  Linux
# pvs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  PV         VG        Fmt  Attr PSize  PFree
  /dev/sda10 maingroup lvm2 a-   38.15G 516.00M
  /dev/sda11 maingroup lvm2 a-   38.15G  23.15G
  /dev/sda12 maingroup lvm2 a-   19.07G   4.07G
  /dev/sda6  maingroup lvm2 a-   19.08G      0
  /dev/sda7  maingroup lvm2 a-   38.15G      0
  /dev/sda8  maingroup lvm2 a-   76.30G      0
  /dev/sda9  maingroup lvm2 a-   76.30G      0
# vgs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  VG        #PV #LV #SN Attr   VSize   VFree
  maingroup   7  12   0 wz--n- 305.21G 27.73G
# lvs
  /dev/cdrom: read failed after 0 of 4096 at 0: Input/output error
  LV          VG        Attr   LSize   Origin Snap%  Move Log Copy%
  c-p         maingroup -wi-a-   4.00G
  capture     maingroup -wi-ao  68.00G
  gen-website maingroup -wI-d-  15.00G
  home        maingroup -wi-ao 110.00G
  music       maingroup -wi-ao  30.00G
  opt         maingroup -wi-ao   4.00G
  swap1       maingroup -wi-ao   1.00G
  swap2       maingroup -wi-ao   1.00G
  tmp         maingroup -wi-ao   2.00G
  usr         maingroup -wi-ao  20.00G
  var         maingroup -wi-ao   7.49G
# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website:
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-dvd:
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-pvmove0:
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw
Quoted 3 lines · Jonathan E Brassow

It appears to me that somehow the device-mapper device was created, but the table has not yet been loaded.

While this is the case, you will not be able to create an LV of the same name. (It will always give you the "device-mapper: reload ioctl failed:..." error.)

I know very little about LVM, but if the table hadn't been loaded,
shouldn't it be the case that none of my LVs would be usable? All but the 'dvd' and 'gen-website' LVs are working fine.

Quoted 3 lines

If you reboot the machine does the "maingroup-dvd:" still show up from 'dmsetup table'?

Also, after a reboot, be sure to run 'pvmove --abort'.

I tried to run 'pvmove --abort' and got the same error about
'reload ioctl ...'. But after reboot, the gen-website LV was back and appears intact. (And the pvmove temporary LV is gone.) So we're making progress ... :)

Quoted 2 lines

Once you've canceled the pvmove successfully, I would do a 'dmsetup remove maingroup-dvd; and try the 'lvcreate -L 15G -n dvd maingroup' again.

I rebooted, ran 'dmsetup remove maingroup-dvd', rebooted again ...
and now the maingroup-dvd is back in the table. Do I need to do the 'lvcreate' right after the 'dmsetup remove', without rebooting in between? Or maybe do an 'lvremove' in addition to the 'dmsetup remove'?

I am at least getting a different error from 'lvcreate' now. I
seem to be in a slightly better state than when this started, so I'm holding off on trying any of my suggestions above in case one of them might make things worse. :)

# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website: 0 31457280 linear 8:11 384
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-dvd:
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752
# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  Logical volume "dvd" already exists in volume group "maingroup"
# ls /dev/maingroup/
c-p  capture  gen-website  home  music  opt  swap1  swap2  tmp  usr  var
# ls /dev/mapper/
control            maingroup-gen--website  maingroup-swap1  maingroup-var
maingroup-c--p     maingroup-home          maingroup-swap2
maingroup-capture  maingroup-music         maingroup-tmp
maingroup-dvd      maingroup-opt           maingroup-usr

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

#3 lore raw

It looks like your 'pvmove --abort' succeeded in canceling the pvmove (even though you had to reboot). So that's good.

You can certainly try an 'lvremove maingroup/dvd'. It seems to me that the logical volume is in the metadata (you can look for it in /etc/lvm/backup/maingroup), but for some reason it is not able to complete the load of that device into device-mapper. Because it only partially succeeds, it is giving you a device with no table... After doing the 'lvremove' you may need to also do a 'dmsetup remove maingroup-dvd'. Once completely removed, you could try your 'lvcreate' again.

I talked to someone about this and they said that it could be a kernel device-mapper/user-space device-mapper mismatch issue. I'm not sure I understand that logic, given that you are able to load other devices of the same target type (i.e. linear). Perhaps that person would like to speak up here?

brassow

P.S. Are you always getting the 'cdrom' error? You may wish to change the filter option to exclude the cdrom device. To do that, change the "filter" line in /etc/lvm/lvm.conf to:
filter = [ "r|/dev/cdrom|" ]

Quoted 80 lines · Matt McHenry
Quoted 3 lines · Jonathan E Brassow

It appears to me that somehow the device-mapper device was created, but the table has not yet been loaded.

While this is the case, you will not be able to create an LV of the same name. (It will always give you the "device-mapper: reload ioctl failed:..." error.)

I know very little about LVM, but if the table hadn't been loaded,
shouldn't it be the case that none of my LVs would be usable? All but the 'dvd' and 'gen-website' LVs are working fine.

Quoted 3 lines

If you reboot the machine does the "maingroup-dvd:" still show up from 'dmsetup table'?

Also, after a reboot, be sure to run 'pvmove --abort'.

I tried to run 'pvmove --abort' and got the same error about 'reload
ioctl ...'. But after reboot, the gen-website LV was back and appears intact. (And the pvmove temporary LV is gone.) So we're making progress ... :)

Quoted 2 lines

Once you've canceled the pvmove successfully, I would do a 'dmsetup remove maingroup-dvd; and try the 'lvcreate -L 15G -n dvd maingroup' again.

I rebooted, ran 'dmsetup remove maingroup-dvd', rebooted again ...
and now the maingroup-dvd is back in the table. Do I need to do the 'lvcreate' right after the 'dmsetup remove', without rebooting in between? Or maybe do an 'lvremove' in addition to the 'dmsetup remove'?

I am at least getting a different error from 'lvcreate' now. I seem
to be in a slightly better state than when this started, so I'm holding off on trying any of my suggestions above in case one of them might make things worse. :)

# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website: 0 31457280 linear 8:11 384
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-dvd:
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752
# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  Logical volume "dvd" already exists in volume group "maingroup"
# ls /dev/maingroup/
c-p  capture  gen-website  home  music  opt  swap1  swap2  tmp  usr  var
# ls /dev/mapper/
control            maingroup-gen--website  maingroup-swap1  maingroup-var
maingroup-c--p     maingroup-home          maingroup-swap2
maingroup-capture  maingroup-music         maingroup-tmp
maingroup-dvd      maingroup-opt           maingroup-usr

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#4 lore raw
Quoted 8 lines · Jonathan E Brassow

You can certainly try an 'lvremove maingroup/dvd'. It seems to me that the logical volume is in the metadata (you can look for it in /etc/lvm/backup/maingroup), but for some reason it is not able to complete the load of that device into device-mapper. Because it only partially succeeds, it is giving you a device with no table... After doing the 'lvremove' you may need to also do a 'dmsetup remove maingroup-dvd'. Once completely removed, you could try your 'lvcreate' again.

I took a look in /etc/lvm/backup/maingroup. Again keeping in mind
that I don't know much about LVM, it looks to me like the 'gen-website' and 'dvd' LVs are overlapping somehow. Assuming that's correct, I'm still reluctant to try any 'remove' commands because I don't want to destroy the data on the gen-website LV. So once again I'll await further replies. :)

                gen-website {
                        id = "GhsR38-lmVZ-5gyN-fbt3-RWJv-f9rF-25aqpy"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 3840     # 15 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv5", 0
                                ]
                        }
                }

                dvd {
                        id = "E2VpR0-rfCr-PA4r-Mrtz-50au-2s5T-kGTP5E"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 3840     # 15 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv5", 3840
                                ]
                        }
                }
Quoted 5 lines

I talked to someone about this and they said that it could be a kernel device-mapper/user-space device-mapper mismatch issue. I'm not sure I understand that logic, given that you are able to load other devices of the same target type (i.e. linear). Perhaps that person would like to speak up here?

Here's a repeat of the version info I posted earlier. I'm not
sure if this is reporting kernel or user-space info (or both), and I don't see any more version info under /proc/ ...

# lvm version
  LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.07 (2006-05-11)
  Driver version:  4.4.0
Quoted 4 lines

P.S. Are you always getting the 'cdrom' error? You may wish to change the filter option to exclude the cdrom device. To do that, change the "filter" line in /etc/lvm/lvm.conf to:
filter = [ "r|/dev/cdrom|" ]

Yes, thanks for that (I recently added a new dvd burner and hadn't
had a chance to make that change yet). Speaking of, any chance that such a hardware change might have anything to do with this problem? (It may have changed device names for some of the pvs; I don't remember for sure.)

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

#5 lore raw

If linux reorders your devices, it won't affect LVM.

The two logical volumes you mentioned do not overlap. The important thing to look at there is the "stripes" section. You can see that 'gen-website' lives on 'pv5' (i.e. the 5th physical volume in the volume group) and that it starts at extent '0'. 'dvd' also lives on 'pv5', but it starts at extent 3840 - directly after 'gen-website'.

So, you are ok to do the lvremove maingroup/dvd.

brassow

P.S. If you accidentally did a 'lvremove -ff <vg>' and wiped out all your volumes, there is no need to panic. You can simply use 'vgcfgrestore' to bring them back. Most mistakes in LVM2 are reversible, which is nice. :)

Quoted 92 lines · Matt McHenry
Quoted 8 lines · Jonathan E Brassow

You can certainly try an 'lvremove maingroup/dvd'. It seems to me that the logical volume is in the metadata (you can look for it in /etc/lvm/backup/maingroup), but for some reason it is not able to complete the load of that device into device-mapper. Because it only partially succeeds, it is giving you a device with no table... After doing the 'lvremove' you may need to also do a 'dmsetup remove maingroup-dvd'. Once completely removed, you could try your 'lvcreate' again.

I took a look in /etc/lvm/backup/maingroup. Again keeping in mind
that I don't know much about LVM, it looks to me like the 'gen-website' and 'dvd' LVs are overlapping somehow. Assuming that's correct, I'm still reluctant to try any 'remove' commands because I don't want to destroy the data on the gen-website LV. So once again I'll await further replies.
:)

                gen-website {
                        id = "GhsR38-lmVZ-5gyN-fbt3-RWJv-f9rF-25aqpy"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 3840     # 15 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv5", 0
                                ]
                        }
                }

                dvd {
                        id = "E2VpR0-rfCr-PA4r-Mrtz-50au-2s5T-kGTP5E"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 3840     # 15 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv5", 3840
                                ]
                        }
                }
Quoted 5 lines

I talked to someone about this and they said that it could be a kernel device-mapper/user-space device-mapper mismatch issue. I'm not sure I understand that logic, given that you are able to load other devices of the same target type (i.e. linear). Perhaps that person would like to speak up here?

Here's a repeat of the version info I posted earlier. I'm not
sure if this is reporting kernel or user-space info (or both), and I don't see any more version info under /proc/ ...

# lvm version
  LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.07 (2006-05-11)
  Driver version:  4.4.0
Quoted 4 lines

P.S. Are you always getting the 'cdrom' error? You may wish to change the filter option to exclude the cdrom device. To do that, change the "filter" line in /etc/lvm/lvm.conf to:
filter = [ "r|/dev/cdrom|" ]

Yes, thanks for that (I recently added a new dvd burner and hadn't
had a chance to make that change yet). Speaking of, any chance that such a hardware change might have anything to do with this problem? (It may have changed device names for some of the pvs; I don't remember for sure.)

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#6 lore raw

Thanks for your continued help. It's still not working, though.
I ran 'dmsetup remove maingroup-dvd' and 'lvremove maingroup/dvd' and rebooted. It looks like it worked:

# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website: 0 31457280 linear 8:11 384
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752

But lvcreate still fails:

# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.

(note that I have made the suggested change to /etc/lvm/lvm.conf
and am still getting those /dev/cdrom errors)

Quoted 105 lines · Jonathan E Brassow

If linux reorders your devices, it won't affect LVM.

The two logical volumes you mentioned do not overlap. The important thing to look at there is the "stripes" section. You can see that 'gen-website' lives on 'pv5' (i.e. the 5th physical volume in the volume group) and that it starts at extent '0'. 'dvd' also lives on 'pv5', but it starts at extent 3840 - directly after 'gen-website'.

So, you are ok to do the lvremove maingroup/dvd.

brassow

P.S. If you accidentally did a 'lvremove -ff <vg>' and wiped out all your volumes, there is no need to panic. You can simply use 'vgcfgrestore' to bring them back. Most mistakes in LVM2 are reversible, which is nice. :)

Quoted 86 lines · Matt McHenry
Quoted 8 lines · Jonathan E Brassow

You can certainly try an 'lvremove maingroup/dvd'. It seems to me that the logical volume is in the metadata (you can look for it in /etc/lvm/backup/maingroup), but for some reason it is not able to complete the load of that device into device-mapper. Because it only partially succeeds, it is giving you a device with no table... After doing the 'lvremove' you may need to also do a 'dmsetup remove maingroup-dvd'. Once completely removed, you could try your 'lvcreate' again.

I took a look in /etc/lvm/backup/maingroup. Again keeping in mind
that I don't know much about LVM, it looks to me like the 'gen-website' and 'dvd' LVs are overlapping somehow. Assuming that's correct, I'm still reluctant to try any 'remove' commands because I don't want to destroy the data on the gen-website LV. So once again I'll await further replies.
:)

gen-website {
id = "GhsR38-lmVZ-5gyN-fbt3-RWJv-f9rF-25aqpy" status = ["READ", "WRITE", "VISIBLE"] segment_count = 1

segment1 {
start_extent = 0
extent_count = 3840 # 15 Gigabytes

type = "striped"
stripe_count = 1 # linear

stripes = [
"pv5", 0
]

                         }
                 }

                 dvd {
                         id = "E2VpR0-rfCr-PA4r-Mrtz-50au-2s5T-kGTP5E"
                         status = ["READ", "WRITE", "VISIBLE"]
                         segment_count = 1

                         segment1 {
                                 start_extent = 0
                                 extent_count = 3840     # 15 Gigabytes

                                 type = "striped"
                                 stripe_count = 1        # linear

                                 stripes = [
                                         "pv5", 3840
]
                         }
                 }
Quoted 5 lines

I talked to someone about this and they said that it could be a kernel device-mapper/user-space device-mapper mismatch issue. I'm not sure I understand that logic, given that you are able to load other devices of the same target type (i.e. linear). Perhaps that person would like to speak up here?

Here's a repeat of the version info I posted earlier. I'm not
sure if this is reporting kernel or user-space info (or both), and I don't see any more version info under /proc/ ...

 # lvm version
   LVM version:     2.02.06 (2006-05-12)
   Library version: 1.02.07 (2006-05-11)
   Driver version:  4.4.0
Quoted 4 lines

P.S. Are you always getting the 'cdrom' error? You may wish to change the filter option to exclude the cdrom device. To do that, change the "filter" line in /etc/lvm/lvm.conf to:
filter = [ "r|/dev/cdrom|" ]

Yes, thanks for that (I recently added a new dvd burner and hadn't
had a chance to make that change yet). Speaking of, any chance that such a hardware change might have anything to do with this problem? (It may have changed device names for some of the pvs; I don't remember for sure.)

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

Quoted 6 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Quoted 7 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

#7 lore raw

Ok, at least maingroup-dvd isn't showing up anymore... so we know we can get rid of it when things go wrong.

I don't have an idea why the lvcreate is failing... You could try to interface with device-mapper directly and see what happens. To do that type:

echo "0 31457280 linear 8:11 31457664" | dmsetup create maingroup-dvd

That should create the device /dev/mapper/maingroup-dvd; and it should be useable. (Make sure that 8:11 is the same device that maingroup-gen--website is on.) If that works, then the problem is in LVM, if it doesn't, we know it is in device-mapper.

Another simple thing to try is bumping up the verbosity; e.g. 'lvcreate -vvvv -L 15G -n dvd maingroup'. This will give alot of output, so you may wish to redirect it to a file. Having everything printed can often give great clues as to the problem.

brassow

Quoted 40 lines · Matt McHenry

Thanks for your continued help. It's still not working, though. I
ran 'dmsetup remove maingroup-dvd' and 'lvremove maingroup/dvd' and rebooted. It looks like it worked:

# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website: 0 31457280 linear 8:11 384
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752

But lvcreate still fails:

# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.

(note that I have made the suggested change to /etc/lvm/lvm.conf and
am still getting those /dev/cdrom errors)

#8 lore raw

I've also been told that this could very well be a known bug related to the kernel you are using... have you tried updating your kernel?

brassow

Quoted 62 lines · Jonathan E Brassow

Ok, at least maingroup-dvd isn't showing up anymore... so we know we can get rid of it when things go wrong.

I don't have an idea why the lvcreate is failing... You could try to interface with device-mapper directly and see what happens. To do that type:

echo "0 31457280 linear 8:11 31457664" | dmsetup create maingroup-dvd

That should create the device /dev/mapper/maingroup-dvd; and it should be useable. (Make sure that 8:11 is the same device that maingroup-gen--website is on.) If that works, then the problem is in LVM, if it doesn't, we know it is in device-mapper.

Another simple thing to try is bumping up the verbosity; e.g. 'lvcreate -vvvv -L 15G -n dvd maingroup'. This will give alot of output, so you may wish to redirect it to a file. Having everything printed can often give great clues as to the problem.

brassow

Quoted 32 lines · Matt McHenry

Thanks for your continued help. It's still not working, though. I
ran 'dmsetup remove maingroup-dvd' and 'lvremove maingroup/dvd' and rebooted. It looks like it worked:

# dmsetup table
maingroup-tmp: 0 4194304 linear 8:8 154018176
maingroup-c--p: 0 8388608 linear 8:7 47980928
maingroup-capture: 0 23642112 linear 8:7 56369536
maingroup-capture: 23642112 40009728 linear 8:6 384
maingroup-capture: 63651840 78954496 linear 8:10 384
maingroup-usr: 0 19996672 linear 8:9 73400704
maingroup-usr: 19996672 974848 linear 8:8 150946176
maingroup-usr: 20971520 3891200 linear 8:8 48619904
maingroup-usr: 24862720 7708672 linear 8:8 384
maingroup-usr: 32571392 9371648 linear 8:8 52511104
maingroup-var: 0 10485760 linear 8:9 62914944
maingroup-var: 10485760 5218304 linear 8:8 145727872
maingroup-gen--website: 0 31457280 linear 8:11 384
maingroup-music: 0 1810432 linear 8:8 158212480
maingroup-music: 1810432 17317888 linear 8:9 142705024
maingroup-music: 19128320 43786240 linear 8:7 384
maingroup-swap2: 0 2097152 linear 8:7 45883776
maingroup-opt: 0 2097152 linear 8:8 151921024
maingroup-opt: 2097152 6291456 linear 8:8 42328448
maingroup-swap1: 0 2097152 linear 8:7 43786624
maingroup-home: 0 62914560 linear 8:9 384
maingroup-home: 62914560 29310976 linear 8:9 113394048
maingroup-home: 92225536 19996672 linear 8:9 93397376
maingroup-home: 112222208 34619392 linear 8:8 7709056
maingroup-home: 146841600 83845120 linear 8:8 61882752

But lvcreate still fails:

Quoted 8 lines
# lvcreate -L 15G -n dvd maingroup
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  device-mapper: reload ioctl failed: Invalid argument
  Failed to activate new LV.

(note that I have made the suggested change to /etc/lvm/lvm.conf and
am still getting those /dev/cdrom errors)

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#9 lore raw
In reply to Matt McHenry
Quoted 2 lines · Matt McHenry

thought that maybe one of my pvs was bad, so I tried to add a new pv (sda12) and migrate off of the most-recently-added one (sda11), but the

Could you have created the new one by subtracting space from the old one? You need to undo that change to the partition table.

Alasdair

Signature · 1 line
[email protected]
#10 lore raw
Quoted 6 lines · Alasdair G Kergon
Quoted 2 lines · Matt McHenry

thought that maybe one of my pvs was bad, so I tried to add a new pv (sda12) and migrate off of the most-recently-added one (sda11), but the

Could you have created the new one by subtracting space from the old one? You need to undo that change to the partition table.

It's possible that I may have screwed up and thought that sda11
wasn't yet under LVM, deleted it, and then created a new sda11 and sda12 in its place (each taking half the space originally occupied by sda11). But it was a while ago so unfortunately I don't remember for sure.

So how can I repair this? I see two options:

1) remove the unused sda12 pv; remove the sda12 partition; delete and re-create the sda11 partition to take up the space formerly occupied by the sda12 partition

2) use pvmove to move all data off of the sda11 pv; remove the sda11 pv; create a new pv on the sda11 partition, which should pick up the correct size

(2) seems better to me, except that I already tried the pvmove and
it and was getting the same 'reload ioctl' errors. For (1), it seems like there's more risk of data loss, and I'd need some way to figure out exactly how big to make the new sda11 partition. What do you think? Is there a third option I'm not seeing?

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]

#11 lore raw
Quoted 3 lines · Matt McHenry

1) remove the unused sda12 pv; remove the sda12 partition; delete and re-create the sda11 partition to take up the space formerly occupied by the sda12 partition

Use vgreduce to remove sda12 from the volume group.
Then edit the partition table to put things back i.e. delete 12 and extend 11, then reboot.
(You may have some data corruption from what got written to sda12.)

Alasdair

Signature · 1 line
[email protected]
#12 lore raw
Quoted 5 lines

Use vgreduce to remove sda12 from the volume group.
Then edit the partition table to put things back i.e. delete 12 and extend 11, then reboot.
(You may have some data corruption from what got written to sda12.)

I was still a bit nervous about this suggestion. As it happens,
the only LV that was using sda11 was 'gen-website', which (as the name suggests) can be regenerated from other data. So instead, I just deleted the 'gen-website' LV. That allowed me to delete and re-create both the sda11 and sda12 PVs. This seems to have fixed everything. I was able to recreate the 'gen-website' LV and create my long-awaited 'dvd' LV as well.

Thanks again to Alasdair and Jonathan for all the help and
patience!

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
[email protected]
[email protected]