linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
@ 2006-10-28 21:26 Matt McHenry
  2006-10-30 16:40 ` Jonathan E Brassow
  2006-11-14 18:31 ` Alasdair G Kergon
  0 siblings, 2 replies; 17+ messages in thread
From: Matt McHenry @ 2006-10-28 21:26 UTC (permalink / raw)
  To: linux-lvm


 	[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/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-10-28 21:26 Matt McHenry
@ 2006-10-30 16:40 ` Jonathan E Brassow
  2006-10-31  4:20   ` Matt McHenry
  2006-11-14 18:31 ` Alasdair G Kergon
  1 sibling, 1 reply; 17+ messages in thread
From: Jonathan E Brassow @ 2006-10-30 16:40 UTC (permalink / raw)
  To: LVM general discussion and development

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

On Oct 28, 2006, at 4:26 PM, Matt McHenry wrote:

>
> 	[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/
> jerith@speakeasy.org
> be052@scn.org
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-10-30 16:40 ` Jonathan E Brassow
@ 2006-10-31  4:20   ` Matt McHenry
  2006-11-01 17:26     ` Jonathan E Brassow
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-10-31  4:20 UTC (permalink / raw)
  To: LVM general discussion and development

On Mon, 30 Oct 2006, Jonathan E Brassow wrote:

> 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.

> 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 ... :)

> 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/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-10-31  4:20   ` Matt McHenry
@ 2006-11-01 17:26     ` Jonathan E Brassow
  2006-11-02  1:07       ` Matt McHenry
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan E Brassow @ 2006-11-01 17:26 UTC (permalink / raw)
  To: LVM general discussion and development

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|" ]

On Oct 30, 2006, at 10:20 PM, Matt McHenry wrote:

> On Mon, 30 Oct 2006, Jonathan E Brassow wrote:
>
>> 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.
>
>> 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 ... :)
>
>> 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/
> jerith@speakeasy.org
> be052@scn.org
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-01 17:26     ` Jonathan E Brassow
@ 2006-11-02  1:07       ` Matt McHenry
  2006-11-02 16:15         ` Jonathan E Brassow
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-11-02  1:07 UTC (permalink / raw)
  To: LVM general discussion and development

On Wed, 1 Nov 2006, Jonathan E Brassow wrote:

> 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
                                ]
                        }
                }

> 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


> 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/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-02  1:07       ` Matt McHenry
@ 2006-11-02 16:15         ` Jonathan E Brassow
  2006-11-04  2:27           ` Matt McHenry
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan E Brassow @ 2006-11-02 16:15 UTC (permalink / raw)
  To: LVM general discussion and development

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.  :)

On Nov 1, 2006, at 7:07 PM, Matt McHenry wrote:

> On Wed, 1 Nov 2006, Jonathan E Brassow wrote:
>
>> 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
>                                 ]
>                         }
>                 }
>
>> 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
>
>
>> 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/
> jerith@speakeasy.org
> be052@scn.org
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-02 16:15         ` Jonathan E Brassow
@ 2006-11-04  2:27           ` Matt McHenry
  2006-11-06 15:52             ` Jonathan E Brassow
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-11-04  2:27 UTC (permalink / raw)
  To: LVM general discussion and development


 	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)

On Thu, 2 Nov 2006, Jonathan E Brassow wrote:

> 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.  :)
>
> On Nov 1, 2006, at 7:07 PM, Matt McHenry wrote:
>
>>  On Wed, 1 Nov 2006, Jonathan E Brassow wrote:
>> 
>> >  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
>> ]
>>                          }
>>                  }
>> 
>> >  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
>> 
>> 
>> >  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/
>>  jerith@speakeasy.org
>>  be052@scn.org
>>
>>  _______________________________________________
>>  linux-lvm mailing list
>>  linux-lvm@redhat.com
>>  https://www.redhat.com/mailman/listinfo/linux-lvm
>>  read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>> 
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> 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/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-04  2:27           ` Matt McHenry
@ 2006-11-06 15:52             ` Jonathan E Brassow
  2006-11-06 16:15               ` Jonathan E Brassow
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan E Brassow @ 2006-11-06 15:52 UTC (permalink / raw)
  To: LVM general discussion and development

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


On Nov 3, 2006, at 8:27 PM, Matt McHenry wrote:

> 	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)

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-06 15:52             ` Jonathan E Brassow
@ 2006-11-06 16:15               ` Jonathan E Brassow
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan E Brassow @ 2006-11-06 16:15 UTC (permalink / raw)
  To: LVM general discussion and development

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

On Nov 6, 2006, at 9:52 AM, Jonathan E Brassow wrote:

> 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
>
>
> On Nov 3, 2006, at 8:27 PM, Matt McHenry wrote:
>
>> 	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)
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
@ 2006-11-14  5:11 Matt McHenry
  2006-11-14 18:01 ` Alasdair G Kergon
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-11-14  5:11 UTC (permalink / raw)
  To: LVM general discussion and development


 	As suggested in your other post, I upgraded my kernel and lvm tools. 
Still no luck.  :(

# uname -a
Linux localhost 2.6.18-gentoo-r2 #1 SMP PREEMPT Sun Nov 12 18:00:54 EST 2006 
i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux

# dmsetup version
Library version:   1.02.10 (2006-09-19)
Driver version:    4.7.0

>  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 -vvvv create maingroup-dvd
device-mapper: reload ioctl failed: Invalid argument
Command failed
dm version   O   [16384]
dm create maingroup-dvd  O   [16384]
dm reload maingroup-dvd  O   [16384]
dm remove maingroup-dvd  O   [16384]

>  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.

 	I think my first message got rejected because of the size of the 
output, so instead it's at http://66.93.60.83/~matt/lvcreate.log.  To my 
untrained eye, things look fine until this point:

# libdm-deptree.c:1370         Adding target: 0 31457280 linear 8:11 31457664
# ioctl/libdm-iface.c:1557         dm table   (254:11) O   [16384]
# ioctl/libdm-iface.c:1557         dm reload   (254:11) N   [16384]
# ioctl/libdm-iface.c:1574   device-mapper: reload ioctl failed: Invalid 
# argument

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14  5:11 [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument' Matt McHenry
@ 2006-11-14 18:01 ` Alasdair G Kergon
  2006-11-14 18:20   ` Matt McHenry
  0 siblings, 1 reply; 17+ messages in thread
From: Alasdair G Kergon @ 2006-11-14 18:01 UTC (permalink / raw)
  To: Matt McHenry; +Cc: LVM general discussion and development

On Tue, Nov 14, 2006 at 12:11:02AM -0500, Matt McHenry wrote:
> # echo "0 31457280 linear 8:11 31457664" | dmsetup -vvvv create 
> maingroup-dvd
> device-mapper: reload ioctl failed: Invalid argument
> Command failed

Now look in your kernel message log for a slightly more detailed error message.

And provide the output of 'pvs -o +dev_size'

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14 18:01 ` Alasdair G Kergon
@ 2006-11-14 18:20   ` Matt McHenry
  2006-11-14 18:26     ` Alasdair G Kergon
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-11-14 18:20 UTC (permalink / raw)
  To: Alasdair G Kergon; +Cc: LVM general discussion and development


> Now look in your kernel message log for a slightly more detailed error
> message.

Nov 13 20:03:03 [kernel] device-mapper: table: device 8:11 too small for target
Nov 13 20:03:03 [kernel] device-mapper: table: 254:11: linear: dm-linear: Device lookup failed
Nov 13 20:03:03 [kernel] device-mapper: ioctl: error adding target to table

# pvs -o +dev_size
  PV         VG        Fmt  Attr PSize  PFree   DevSize
  /dev/sda10 maingroup lvm2 a-   38.15G 516.00M  38.16G
  /dev/sda11 maingroup lvm2 a-   38.15G  23.15G  19.08G
  /dev/sda12 maingroup lvm2 a-   19.07G  19.07G  19.07G
  /dev/sda6  maingroup lvm2 a-   19.08G      0   19.08G
  /dev/sda7  maingroup lvm2 a-   38.15G      0   38.16G
  /dev/sda8  maingroup lvm2 a-   76.30G      0   76.31G
  /dev/sda9  maingroup lvm2 a-   76.30G      0   76.31G

----------------------
Matt McHenry
http://www.speakeasy.org/~jerith/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14 18:20   ` Matt McHenry
@ 2006-11-14 18:26     ` Alasdair G Kergon
  0 siblings, 0 replies; 17+ messages in thread
From: Alasdair G Kergon @ 2006-11-14 18:26 UTC (permalink / raw)
  To: Matt McHenry; +Cc: LVM general discussion and development

On Tue, Nov 14, 2006 at 01:20:57PM -0500, Matt McHenry wrote:
> Nov 13 20:03:03 [kernel] device-mapper: table: device 8:11 too small for target

>   PV         VG        Fmt  Attr PSize  PFree   DevSize
>   /dev/sda11 maingroup lvm2 a-   38.15G  23.15G  19.08G
>   /dev/sda12 maingroup lvm2 a-   19.07G  19.07G  19.07G

So your partition /dev/sda11 now has a size of 19GB but lvm2 thinks it
can use 38GB of it.

Have you edited the partition table?

Alasdair
-- 
agk@redhat.com

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-10-28 21:26 Matt McHenry
  2006-10-30 16:40 ` Jonathan E Brassow
@ 2006-11-14 18:31 ` Alasdair G Kergon
  2006-11-14 18:43   ` Matt McHenry
  1 sibling, 1 reply; 17+ messages in thread
From: Alasdair G Kergon @ 2006-11-14 18:31 UTC (permalink / raw)
  To: Matt McHenry; +Cc: linux-lvm

On Sat, Oct 28, 2006 at 05:26:55PM -0400, Matt McHenry wrote:
> 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
-- 
agk@redhat.com

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14 18:31 ` Alasdair G Kergon
@ 2006-11-14 18:43   ` Matt McHenry
  2006-11-14 18:47     ` Alasdair G Kergon
  0 siblings, 1 reply; 17+ messages in thread
From: Matt McHenry @ 2006-11-14 18:43 UTC (permalink / raw)
  To: linux-lvm

On Tue, 14 Nov 2006, Alasdair G Kergon wrote:

> On Sat, Oct 28, 2006 at 05:26:55PM -0400, Matt McHenry wrote:
> > 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/
jerith@speakeasy.org
be052@scn.org

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14 18:43   ` Matt McHenry
@ 2006-11-14 18:47     ` Alasdair G Kergon
  2006-11-15  4:26       ` Matt McHenry
  0 siblings, 1 reply; 17+ messages in thread
From: Alasdair G Kergon @ 2006-11-14 18:47 UTC (permalink / raw)
  To: Matt McHenry; +Cc: linux-lvm

On Tue, Nov 14, 2006 at 01:43:07PM -0500, Matt McHenry wrote:
> 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
-- 
agk@redhat.com

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

* Re: [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument'
  2006-11-14 18:47     ` Alasdair G Kergon
@ 2006-11-15  4:26       ` Matt McHenry
  0 siblings, 0 replies; 17+ messages in thread
From: Matt McHenry @ 2006-11-15  4:26 UTC (permalink / raw)
  To: linux-lvm


> 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/
jerith@speakeasy.org
be052@scn.org

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

end of thread, other threads:[~2006-11-15  4:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14  5:11 [linux-lvm] lvcreate gives 'device-mapper: reload ioctl failed: Invalid argument' Matt McHenry
2006-11-14 18:01 ` Alasdair G Kergon
2006-11-14 18:20   ` Matt McHenry
2006-11-14 18:26     ` Alasdair G Kergon
  -- strict thread matches above, loose matches on Subject: below --
2006-10-28 21:26 Matt McHenry
2006-10-30 16:40 ` Jonathan E Brassow
2006-10-31  4:20   ` Matt McHenry
2006-11-01 17:26     ` Jonathan E Brassow
2006-11-02  1:07       ` Matt McHenry
2006-11-02 16:15         ` Jonathan E Brassow
2006-11-04  2:27           ` Matt McHenry
2006-11-06 15:52             ` Jonathan E Brassow
2006-11-06 16:15               ` Jonathan E Brassow
2006-11-14 18:31 ` Alasdair G Kergon
2006-11-14 18:43   ` Matt McHenry
2006-11-14 18:47     ` Alasdair G Kergon
2006-11-15  4:26       ` Matt McHenry

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).