lvcreate fails with mirror raid1

Bug #120792 reported by xomix
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lvm2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: lvm2

This happens with Feisty. I think it's an lvm2 problem, but it may be related to the dm-mirror.ko module...
Versions:
linux-image-2.6.20-16-386
lvm-common 1.5.20ubuntu12
lvm2 2.02.06-2ubuntu9
libdevmapper1.02 1.02.08-1ubuntu10
Problem:
Having enough space to do so, lvcreate fails to create a mirrored (raid 1) lv, stating that there's not enogh space. Module dm-mirror is loaded.

# pvdisplay
  --- Physical volume ---
  PV Name /dev/mapper/sdc2
  VG Name VMWare
  PV Size 116,44 GB / not usable 0
  Allocatable yes
  PE Size (KByte) 4096
  Total PE 29809
  Free PE 27249
  Allocated PE 2560
  PV UUID XA7vtE-1cXo-xS0C-CjMS-hMYj-HgOF-JQRNO4

  --- Physical volume ---
  PV Name /dev/mapper/sdb4
  VG Name TEST
  PV Size 445,57 GB / not usable 0
  Allocatable yes
  PE Size (KByte) 4096
  Total PE 114066
  Free PE 114066
  Allocated PE 0
  PV UUID dNbjqI-SoDU-oFhv-oCbo-DteE-mD16-p2bH2O

  --- Physical volume ---
  PV Name /dev/mapper/sda4
  VG Name TEST
  PV Size 445,62 GB / not usable 0
  Allocatable yes
  PE Size (KByte) 4096
  Total PE 114078
  Free PE 114078
  Allocated PE 0
  PV UUID vEd5dP-s1Zz-k1E7-rRH1-BYdN-xA75-l0wIKg

# lvcreate -m1 -L1G -n my_mirror TEST /dev/mapper/sda4 /dev/mapper/sdb4
  Not enough PVs with free space available for parallel allocation.
  Consider --alloc anywhere if desperate.

Revision history for this message
Áron Sisak (asisak) wrote :

LVM needs 3 devices for a mirror device: two for the mirror devices and one for the disk log.
The error message is not very straightforward, however, this should be fixed upstream if it really needs a fix.

For further information please read the lvcreate(8) manual page.

Changed in lvm2:
status: Unconfirmed → Rejected
Revision history for this message
xomix (txomix) wrote :

And then, bug 120364...
Anyway, why does it need a log device? It is the first time I hear about a raid 1 needing the number of devices equal to the number of copies + 1. In fact, I thought than with lvm I could even have two copies of data in the same physical volume, as in AIX's lvm, for instance.
Is the corelog safe? Does it make the boot process slower?
Thanks Áron.

Revision history for this message
Áron Sisak (asisak) wrote :

Sorry I cannot answer any of your questions. The fact is I only know that LVM works this way (without any details regarding boot process, or internal mechanizms).

On the other hand I think this thread should be continued somewhere else (Ubuntu Forums, #ubuntu support channel at irc.freenode.net or maybe at answers.launchpad.com).

Revision history for this message
Ketil Malde (ketil-ii) wrote :

This documentation:
      http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Cluster_Logical_Volume_Manager/LV_create.html
explains that you can keep the log in memory only, which requires a re-scan of the mirror on bootup.

However, it still doesn't work:

       % sudo lvcreate -L 1G --corelog -m1 -n testmirror Ubuntu
        LV testmirror_mlog: segment 1 has inconsistent PV area 0
        Internal error: LV segments corrupted in testmirror_mlog.
        Failed to create mirror log.

..which is anyway reported in #121024, which is tagged as duplicate of #121527, which I'll tag as duplicate of this.

Revision history for this message
Ketil Malde (ketil-ii) wrote :

I've reopened this, since lvcreate still fails.

Changed in lvm2:
status: Invalid → New
Revision history for this message
Hinnerk (haardt) wrote :

On Gutsy mirroring with two devices works fine:

    $ sudo lvconvert -m 1 --corelog vg00/testdisk
    Logical volume testdisk converted.

    $ sudo lvs -a -o +devices
      LV VG Attr LSize Origin Snap% Move Log Copy% Devices
      testdisk vg00 mwi-a- 4.00G 100.00 testdisk_mimage_0(0),testdisk_mimage_1(0)
      [testdisk_mimage_0] vg00 iwi-ao 4.00G /dev/sdb1(4015)
      [testdisk_mimage_1] vg00 iwi-ao 4.00G /dev/sda2(6400)

Revision history for this message
Greg Copeland (gtcopeland) wrote :

Use of "lvconvert -m 1 --corelog vg00/testdisk" on data that you care about is a bad idea. This tells LVM to create the log in memory. When a write occurs, it is written to disk and the log. Should one disk complete before the other (which is very likely to happen, especially with non-disk PVs), the only thing ensuring write completion on the second disk is the log. In this window, should a crash/reboot/power outage occur, which is likely on a heavy I/O bound server, loss of mirror synchronization is likely. On the next boot, when the data mirror would otherwise be restarted and completed on the second (or more) disk, it is no longer available (was in memory). Since the log is no longer available, the pending write can not complete. You now have a mirror which is no longer properly synchronized. This can result in data loss. Don't do this. Frankly it's not clear to me what value --corelog has other than testing and debugging.

Revision history for this message
xteejx (xteejx-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Changed in lvm2 (Ubuntu):
status: New → Incomplete
Revision history for this message
xteejx (xteejx-deactivatedaccount) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in lvm2 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.