2013/7/4 matthew patton <span dir="ltr"><<a href="mailto:pattonme@yahoo.com" target="_blank">pattonme@yahoo.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
><br>
><a href="http://serverfault.com/questions/500533/lvm-mirror-with-data-and-logs-mirrored-on-same-2-devices" target="_blank">http://serverfault.com/questions/500533/lvm-mirror-with-data-and-logs-mirrored-on-same-2-devices</a><br>

<br>
wow, that smells like a logic bug to me. If not, then the documentation needs a VERY obvious warning about how to properly do mirrored devices with mirrored logs (nee 4+ distinct PV devices). If the internals can't be fixed, then it needs to error out on creation when there aren't 4 devices to work with. Any particular reason why you wanted pseudo-external logs in the first place?<br>

<br>
Does 'lvcreate -nv' show you the work plan?<br><br></blockquote><div><br></div><div>Yet lvconvert looks the right tool for me if I could overcome this limitation. I guess you meant 'lvconvert' instead of 'lvcreate' because lvcreate works fine and I don't think it needs to be debugged. The only drawback is that I need a much more complicated migration.</div>
<div><br></div><div>In case you needed the "lvconvert" here it is (pretty long) the output of </div><div><br></div><div> lvconvert -vvv -m1 --mirrorlog mirrored /dev/lvgrptstnlvm/root /dev/sdb1</div></div><div><br>
</div><div><br></div><div>root@debian:/home/user# lvconvert -vvv -m1 --mirrorlog mirrored /dev/lvgrptstnlvm/root /dev/sdb1</div><div>        Processing: lvconvert -vvv -m1 --mirrorlog mirrored /dev/lvgrptstnlvm/root /dev/sdb1</div>
<div>        O_DIRECT will be used</div><div>      Setting global/locking_type to 1</div><div>      Setting global/wait_for_locks to 1</div><div>      File-based locking selected.</div><div>      Setting global/locking_dir to /run/lock/lvm</div>
<div>      Setting activation/mirror_region_size to 512</div><div>      Getting target version for mirror</div><div>        dm versions   OF   [16384] (*1)</div><div>      Getting target version for mirror</div><div>        dm versions   OF   [16384] (*1)</div>
<div>      Locking /run/lock/lvm/V_lvgrptstnlvm WB</div><div>        _do_flock /run/lock/lvm/V_lvgrptstnlvm:aux WB</div><div>        _do_flock /run/lock/lvm/V_lvgrptstnlvm WB</div><div>        _undo_flock /run/lock/lvm/V_lvgrptstnlvm:aux</div>
<div>        /dev/sr0: Added to device cache</div><div>        /dev/cdrom: Aliased to /dev/sr0 in device cache (preferred name)</div><div>        /dev/cdrw: Aliased to /dev/cdrom in device cache</div><div>        /dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001: Aliased to /dev/cdrom in device cache</div>
<div>        /dev/disk/by-label/Debian\x20wheezy\x2020130505-08:21: Aliased to /dev/cdrom in device cache</div><div>        /dev/disk/by-path/pci-0000:00:07.1-scsi-1:0:0:0: Aliased to /dev/cdrom in device cache</div><div>
        /dev/dvd: Aliased to /dev/cdrom in device cache</div><div>        /dev/dvdrw: Aliased to /dev/cdrom in device cache</div><div>        /dev/sda: Added to device cache</div><div>        /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0: Aliased to /dev/sda in device cache</div>
<div>        /dev/sda1: Added to device cache</div><div>        /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0-part1: Aliased to /dev/sda1 in device cache</div><div>        /dev/sdb: Added to device cache</div><div>        /dev/disk/by-id/scsi-26362623865306265: Aliased to /dev/sdb in device cache</div>
<div>        /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0: Aliased to /dev/sdb in device cache</div><div>        /dev/sdb1: Added to device cache</div><div>        /dev/disk/by-id/scsi-26362623865306265-part1: Aliased to /dev/sdb1 in device cache</div>
<div>        /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1: Aliased to /dev/sdb1 in device cache</div><div>        /dev/sdb2: Added to device cache</div><div>        /dev/disk/by-id/scsi-26362623865306265-part2: Aliased to /dev/sdb2 in device cache</div>
<div>        /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part2: Aliased to /dev/sdb2 in device cache</div><div>        /dev/fd0: Added to device cache</div><div>        /dev/loop0: Added to device cache</div><div>        /dev/loop1: Added to device cache</div>
<div>        /dev/loop2: Added to device cache</div><div>        /dev/loop3: Added to device cache</div><div>        /dev/loop4: Added to device cache</div><div>        /dev/loop5: Added to device cache</div><div>        /dev/loop6: Added to device cache</div>
<div>        /dev/loop7: Added to device cache</div><div>        /dev/dm-0: Added to device cache</div><div>        /dev/disk/by-id/dm-name-lvgrptstnlvm-root: Aliased to /dev/dm-0 in device cache (preferred name)</div><div>
        /dev/disk/by-id/dm-uuid-LVM-DxeZ119H0aLSu7DzkC21nfqolp4rPTBpNTJpPI2EvQWsK2Xd5eoSvk4x8slmPVYC: Aliased to /dev/disk/by-id/dm-name-lvgrptstnlvm-root in device cache</div><div>        /dev/disk/by-uuid/2e715f19-ad02-44d8-9e06-e1ac5e302dfd: Aliased to /dev/disk/by-id/dm-name-lvgrptstnlvm-root in device cache</div>
<div>        /dev/lvgrptstnlvm/root: Aliased to /dev/disk/by-id/dm-name-lvgrptstnlvm-root in device cache (preferred name)</div><div>        /dev/mapper/lvgrptstnlvm-root: Aliased to /dev/lvgrptstnlvm/root in device cache</div>
<div>        /dev/fd0: Skipping: Unrecognised LVM device type 2</div><div>        Opened /dev/loop0 RO O_DIRECT</div><div>      /dev/loop0: size is 1094288 sectors</div><div>        Closed /dev/loop0</div><div>      /dev/loop0: size is 1094288 sectors</div>
<div>        Opened /dev/loop0 RO O_DIRECT</div><div>        /dev/loop0: block size is 1024 bytes</div><div>        Closed /dev/loop0</div><div>        Using /dev/loop0</div><div>        Opened /dev/loop0 RO O_DIRECT</div>
<div>        /dev/loop0: block size is 1024 bytes</div><div>      /dev/loop0: No label detected</div><div>        Closed /dev/loop0</div><div>        Opened /dev/sda RO O_DIRECT</div><div>      /dev/sda: size is 18874368 sectors</div>
<div>        /dev/sda: block size is 4096 bytes</div><div>        /dev/sda: Skipping: Partition table signature found</div><div>        Closed /dev/sda</div><div>        /dev/cdrom: Skipping: Unrecognised LVM device type 11</div>
<div>        dm status   (254:0) OF   [16384] (*1)</div><div>        Opened /dev/lvgrptstnlvm/root RO O_DIRECT</div><div>      /dev/lvgrptstnlvm/root: size is 12582912 sectors</div><div>        Closed /dev/lvgrptstnlvm/root</div>
<div>      /dev/lvgrptstnlvm/root: size is 12582912 sectors</div><div>        Opened /dev/lvgrptstnlvm/root RO O_DIRECT</div><div>        /dev/lvgrptstnlvm/root: block size is 4096 bytes</div><div>        Closed /dev/lvgrptstnlvm/root</div>
<div>        Using /dev/lvgrptstnlvm/root</div><div>        Opened /dev/lvgrptstnlvm/root RO O_DIRECT</div><div>        /dev/lvgrptstnlvm/root: block size is 4096 bytes</div><div>      /dev/lvgrptstnlvm/root: No label detected</div>
<div>        Closed /dev/lvgrptstnlvm/root</div><div>        Opened /dev/loop1 RO O_DIRECT</div><div>      /dev/loop1: size is 0 sectors</div><div>        /dev/loop1: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop1</div>
<div>        Opened /dev/sda1 RO O_DIRECT</div><div>      /dev/sda1: size is 18872320 sectors</div><div>        Closed /dev/sda1</div><div>      /dev/sda1: size is 18872320 sectors</div><div>        Opened /dev/sda1 RO O_DIRECT</div>
<div>        /dev/sda1: block size is 4096 bytes</div><div>        Closed /dev/sda1</div><div>        Using /dev/sda1</div><div>        Opened /dev/sda1 RO O_DIRECT</div><div>        /dev/sda1: block size is 4096 bytes</div>
<div>      /dev/sda1: lvm2 label detected at sector 1</div><div>        lvmcache: /dev/sda1: now in VG #orphans_lvm2 (#orphans_lvm2) with 0 mdas</div><div>        /dev/sda1: Found metadata at 42496 size 1283 (in area at 4096 size 192512) for lvgrptstnlvm (DxeZ11-9H0a-LSu7-DzkC-21nf-qolp-4rPTBp)</div>
<div>        lvmcache: /dev/sda1: now in VG lvgrptstnlvm with 1 mdas</div><div>        lvmcache: /dev/sda1: setting lvgrptstnlvm VGID to DxeZ119H0aLSu7DzkC21nfqolp4rPTBp</div><div>        lvmcache: /dev/sda1: VG lvgrptstnlvm: Set creation host to debian.</div>
<div>        Opened /dev/loop2 RO O_DIRECT</div><div>      /dev/loop2: size is 0 sectors</div><div>        /dev/loop2: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop2</div><div>        Opened /dev/loop3 RO O_DIRECT</div>
<div>      /dev/loop3: size is 0 sectors</div><div>        /dev/loop3: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop3</div><div>        Opened /dev/loop4 RO O_DIRECT</div><div>      /dev/loop4: size is 0 sectors</div>
<div>        /dev/loop4: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop4</div><div>        Opened /dev/loop5 RO O_DIRECT</div><div>      /dev/loop5: size is 0 sectors</div><div>        /dev/loop5: Skipping: Too small to hold a PV</div>
<div>        Closed /dev/loop5</div><div>        Opened /dev/loop6 RO O_DIRECT</div><div>      /dev/loop6: size is 0 sectors</div><div>        /dev/loop6: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop6</div>
<div>        Opened /dev/loop7 RO O_DIRECT</div><div>      /dev/loop7: size is 0 sectors</div><div>        /dev/loop7: Skipping: Too small to hold a PV</div><div>        Closed /dev/loop7</div><div>        Opened /dev/sdb RO O_DIRECT</div>
<div>      /dev/sdb: size is 18874368 sectors</div><div>        /dev/sdb: block size is 4096 bytes</div><div>        /dev/sdb: Skipping: Partition table signature found</div><div>        Closed /dev/sdb</div><div>        Opened /dev/sdb1 RO O_DIRECT</div>
<div>      /dev/sdb1: size is 18610176 sectors</div><div>        Closed /dev/sdb1</div><div>      /dev/sdb1: size is 18610176 sectors</div><div>        Opened /dev/sdb1 RO O_DIRECT</div><div>        /dev/sdb1: block size is 4096 bytes</div>
<div>        Closed /dev/sdb1</div><div>        Using /dev/sdb1</div><div>        Opened /dev/sdb1 RO O_DIRECT</div><div>        /dev/sdb1: block size is 4096 bytes</div><div>      /dev/sdb1: lvm2 label detected at sector 1</div>
<div>        lvmcache: /dev/sdb1: now in VG #orphans_lvm2 (#orphans_lvm2) with 0 mdas</div><div>        /dev/sdb1: Found metadata at 6144 size 1283 (in area at 4096 size 520192) for lvgrptstnlvm (DxeZ11-9H0a-LSu7-DzkC-21nf-qolp-4rPTBp)</div>
<div>        lvmcache: /dev/sdb1: now in VG lvgrptstnlvm (DxeZ119H0aLSu7DzkC21nfqolp4rPTBp) with 1 mdas</div><div>        Opened /dev/sdb2 RO O_DIRECT</div><div>      /dev/sdb2: size is 262144 sectors</div><div>        Closed /dev/sdb2</div>
<div>      /dev/sdb2: size is 262144 sectors</div><div>        Opened /dev/sdb2 RO O_DIRECT</div><div>        /dev/sdb2: block size is 4096 bytes</div><div>        Closed /dev/sdb2</div><div>        Using /dev/sdb2</div><div>
        Opened /dev/sdb2 RO O_DIRECT</div><div>        /dev/sdb2: block size is 4096 bytes</div><div>      /dev/sdb2: lvm2 label detected at sector 1</div><div>        lvmcache: /dev/sdb2: now in VG #orphans_lvm2 (#orphans_lvm2) with 0 mdas</div>
<div>        /dev/sdb2: Found metadata at 4608 size 1283 (in area at 4096 size 1044480) for lvgrptstnlvm (DxeZ11-9H0a-LSu7-DzkC-21nf-qolp-4rPTBp)</div><div>        lvmcache: /dev/sdb2: now in VG lvgrptstnlvm (DxeZ119H0aLSu7DzkC21nfqolp4rPTBp) with 1 mdas</div>
<div>        Using cached label for /dev/sda1</div><div>        Using cached label for /dev/sdb1</div><div>        Using cached label for /dev/sdb2</div><div>        Allocated VG lvgrptstnlvm at 0x2732230.</div><div>        Using cached label for /dev/sda1</div>
<div>        Using cached label for /dev/sdb1</div><div>        Using cached label for /dev/sdb2</div><div>        Read lvgrptstnlvm metadata (109) from /dev/sda1 at 42496 size 1283</div><div>        Allocated VG lvgrptstnlvm at 0x2736240.</div>
<div>        Using cached label for /dev/sda1</div><div>        Using cached label for /dev/sdb1</div><div>        Using cached label for /dev/sdb2</div><div>        Read lvgrptstnlvm metadata (109) from /dev/sdb1 at 6144 size 1283</div>
<div>        Freeing VG lvgrptstnlvm at 0x2736240.</div><div>        Allocated VG lvgrptstnlvm at 0x2736240.</div><div>        Using cached label for /dev/sda1</div><div>        Using cached label for /dev/sdb1</div><div>
        Using cached label for /dev/sdb2</div><div>        Read lvgrptstnlvm metadata (109) from /dev/sdb2 at 4608 size 1283</div><div>        Freeing VG lvgrptstnlvm at 0x2736240.</div><div>        /dev/sda1 0:      0   1536: root(0:0)</div>
<div>        /dev/sda1 1:   1536    767: NULL(0:0)</div><div>        /dev/sdb1 0:      0   2271: NULL(0:0)</div><div>        /dev/sdb2 0:      0     31: NULL(0:0)</div><div>        Adding PE range: start PE 0 length 2271 on /dev/sdb1</div>
<div>    Archiving volume group "lvgrptstnlvm" metadata (seqno 109).</div><div>    Adjusting mirror image count of root</div><div>    Setting logging type to mirrored</div><div>        Allowing allocation on /dev/sdb1 start PE 0 length 2271</div>
<div>        Parallel PVs at LE 0 length 1536: /dev/sda1</div><div>        Trying allocation using contiguous policy.</div><div>        Still need 1538 total extents:</div><div>          1 (1 data/0 parity) parallel areas of 1536 extents each</div>
<div>          2 mirror logs of 1 extents each</div><div>        Considering allocation area 0 as /dev/sdb1 start PE 0 length 1536 leaving 735.</div><div>        Trying allocation using cling policy.</div><div>        Still need 1538 total extents:</div>
<div>          1 (1 data/0 parity) parallel areas of 1536 extents each</div><div>          2 mirror logs of 1 extents each</div><div>        Considering allocation area 0 as /dev/sdb1 start PE 0 length 1536 leaving 735.</div>
<div>        Trying allocation using normal policy.</div><div>        Cling_to_allocated is set</div><div>        Still need 1538 total extents:</div><div>          1 (1 data/0 parity) parallel areas of 1536 extents each</div>
<div>          2 mirror logs of 1 extents each</div><div>        Cling_to_allocated is not set</div><div>        Still need 1538 total extents:</div><div>          1 (1 data/0 parity) parallel areas of 1536 extents each</div>
<div>          2 mirror logs of 1 extents each</div><div>        Considering allocation area 0 as /dev/sdb1 start PE 0 length 1536 leaving 735.</div><div>        Found 1 areas for 1 parallel areas and 2 log areas so far.</div>
<div>        Considering allocation area 1 as /dev/sdb1 start PE 0 length 735 leaving 0.</div><div>  Insufficient suitable allocatable extents for logical volume : 1536 more required</div><div>  Unable to allocate extents for mirror(s).</div>
<div>        Unlock: Memlock counters: locked:0 critical:0 daemon:0 suspended:0</div><div>        Syncing device names</div><div>      Unlocking /run/lock/lvm/V_lvgrptstnlvm</div><div>        _undo_flock /run/lock/lvm/V_lvgrptstnlvm</div>
<div>        Closed /dev/sda1</div><div>        Closed /dev/sdb1</div><div>        Closed /dev/sdb2</div><div>        Freeing VG lvgrptstnlvm at 0x2732230.</div><div><br></div><div><br></div>