Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1698246

Summary: a tracked split raid image can not be permanently split using the --name arg like implied in man page and docs
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: low    
Priority: high CC: agk, heinzm, jbrassow, msnitzer, prajnoha, rbednar, rhandlin, slevine, zkabelac
Version: 8.0Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-18 17:48:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2019-04-09 22:05:55 UTC
Description of problem:
I tried this on rhel7 and rhel8, so maybe this worked in like rhel6 or rhel5?

From lvconvert(8):

--trackchanges
              Can be used with --splitmirrors on a raid1 LV. This causes changes to the original raid1 LV to be tracked while the split images remain detached. This is a
              temporary state that allows the read-only detached image to be merged efficiently back into the raid1 LV later.  Only the regions with changed data are resynâ€
              chronized during merge.  While a raid1 LV is tracking changes, operations on it are limited to merging the split image (see --mergemirrors) or permanently
              splitting the image (see --splitmirrors with --name.

# First, there's a typo with the missing right ")".

# Second, I don't know if this has ever been true. We even test to make sure a tracked change split can't be split again regardless of --name arg.


# RHEL7.6

[root@mckinley-01 ~]# lvcreate --type raid1 -m 2 -n my_lv -L 100M my_vg
  Logical volume "my_lv" created.
[root@mckinley-01 ~]# lvs -a -o +devices
  LV               VG               Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  my_lv            my_vg            rwi-a-r---  100.00m                                    100.00           my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0] my_vg            iwi-aor---  100.00m                                                     /dev/mapper/mpathb1(1)                               
  [my_lv_rimage_1] my_vg            iwi-aor---  100.00m                                                     /dev/mapper/mpathc1(1)                               
  [my_lv_rimage_2] my_vg            iwi-aor---  100.00m                                                     /dev/mapper/mpathd1(1)                               
  [my_lv_rmeta_0]  my_vg            ewi-aor---    4.00m                                                     /dev/mapper/mpathb1(0)                               
  [my_lv_rmeta_1]  my_vg            ewi-aor---    4.00m                                                     /dev/mapper/mpathc1(0)                               
  [my_lv_rmeta_2]  my_vg            ewi-aor---    4.00m                                                     /dev/mapper/mpathd1(0)                               

[root@mckinley-01 ~]# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_vg/my_lv_rimage_2 split from my_vg/my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_2' to merge back into my_vg/my_lv.

[root@mckinley-01 ~]# lvs -a -o +devices
  LV               VG               Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  my_lv            my_vg            rwi-a-r---  100.00m                                    100.00           my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0] my_vg            iwi-aor---  100.00m                                                     /dev/mapper/mpathb1(1)                               
  [my_lv_rimage_1] my_vg            iwi-aor---  100.00m                                                     /dev/mapper/mpathc1(1)                               
  my_lv_rimage_2   my_vg            Iri-a-r---  100.00m                                                     /dev/mapper/mpathd1(1)                               
  [my_lv_rmeta_0]  my_vg            ewi-aor---    4.00m                                                     /dev/mapper/mpathb1(0)                               
  [my_lv_rmeta_1]  my_vg            ewi-aor---    4.00m                                                     /dev/mapper/mpathc1(0)                               
  [my_lv_rmeta_2]  my_vg            ewi-a-r---    4.00m                                                     /dev/mapper/mpathd1(0)                               

[root@mckinley-01 ~]# lvconvert --splitmirrors 1 -n new my_vg/my_lv
  Conversion of tracking raid1 LV my_vg/my_lv is not supported.
[root@mckinley-01 ~]# lvconvert --splitmirrors 1 -n new my_vg/my_lv_rimage_2
  Command on LV my_vg/my_lv_rimage_2 does not accept LV type linear.
  Command not permitted on LV my_vg/my_lv_rimage_2.


# RHEL8.0

[root@host-083 ~]# lvcreate --type raid1 -m 2 -n my_lv -L 100M my_vg
  Logical volume "my_lv" created.
[root@host-083 ~]# lvs -a -o +devices
  LV               VG            Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  my_lv            my_vg         rwi-a-r--- 100.00m                                      100.00           my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0] my_vg         iwi-aor--- 100.00m                                                       /dev/sda1(1)                                         
  [my_lv_rimage_1] my_vg         iwi-aor--- 100.00m                                                       /dev/sdb1(1)                                         
  [my_lv_rimage_2] my_vg         iwi-aor--- 100.00m                                                       /dev/sdc1(1)                                         
  [my_lv_rmeta_0]  my_vg         ewi-aor---   4.00m                                                       /dev/sda1(0)                                         
  [my_lv_rmeta_1]  my_vg         ewi-aor---   4.00m                                                       /dev/sdb1(0)                                         
  [my_lv_rmeta_2]  my_vg         ewi-aor---   4.00m                                                       /dev/sdc1(0)                                         

[root@host-083 ~]# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_vg/my_lv_rimage_2 split from my_vg/my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_2' to merge back into my_vg/my_lv.

[root@host-083 ~]# lvs -a -o +devices
  LV               VG            Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  my_lv            my_vg         rwi-a-r--- 100.00m                                      100.00           my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0] my_vg         iwi-aor--- 100.00m                                                       /dev/sda1(1)                                         
  [my_lv_rimage_1] my_vg         iwi-aor--- 100.00m                                                       /dev/sdb1(1)                                         
  my_lv_rimage_2   my_vg         Iri-a-r--- 100.00m                                                       /dev/sdc1(1)                                         
  [my_lv_rmeta_0]  my_vg         ewi-aor---   4.00m                                                       /dev/sda1(0)                                         
  [my_lv_rmeta_1]  my_vg         ewi-aor---   4.00m                                                       /dev/sdb1(0)                                         
  [my_lv_rmeta_2]  my_vg         ewi-a-r---   4.00m                                                       /dev/sdc1(0)                                         

[root@host-083 ~]# lvconvert --splitmirrors 1 -n new my_vg/my_lv
  Conversion of tracking raid1 LV my_vg/my_lv is not supported.
[root@host-083 ~]# lvconvert --splitmirrors 1 -n new my_vg/my_lv_rimage_2
  Command on LV my_vg/my_lv_rimage_2 does not accept LV type linear.
  Command not permitted on LV my_vg/my_lv_rimage_2.



Version-Release number of selected component (if applicable):
kernel-4.18.0-74.el8    BUILT: Wed Feb 27 12:52:17 CST 2019
lvm2-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
lvm2-libs-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
lvm2-dbusd-2.03.02-6.el8    BUILT: Fri Feb 22 04:50:28 CST 2019
lvm2-lockd-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-libs-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-event-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-event-libs-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-persistent-data-0.7.6-1.el8    BUILT: Sun Aug 12 04:21:55 CDT 2018

Comment 3 Heinz Mauelshagen 2020-02-18 17:48:04 UTC
Corey, WFM on RHEL8 and RHEL7, closing. Please reopen if you can reproduce, thanks.

[root@vm165 ~]# lvm version
  LVM version:     2.03.02(2)-RHEL8 (2019-01-04)
  Library version: 1.02.155-RHEL8 (2019-01-04)
  Driver version:  4.39.0
  Configuration:   ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bi
ndir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstate
dir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-default-locking-di
r=/run/lock/lvm --with-usrlibdir=/usr/lib64 --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enab
le-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping --with-cluster=internal --enable-cmirrord --with-udevdir=/usr/lib/udev/rules.d --enable-udev_sync --with-thin=
internal --with-cache=internal --enable-lvmpolld --enable-lvmlockd-dlm --enable-lvmlockd-sanlock --enable-dbus-service --enable-notify-dbus --enable-dmfilemapd --with-vdo=internal
 --with-vdo-format=/usr/bin/vdoformat --disable-silent-rules
[root@vm165 ~]# uname -r
4.18.0-80.el8.x86_64
[root@vm165 ~]# lvcreate -y -m2 -L128 -nr1 t
  Logical volume "r1" created.
[root@vm165 ~]# lvs
  LV   VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rhel_vm165 -wi-ao---- <45.02g                                                    
  swap rhel_vm165 -wi-ao----  <3.98g                                                    
  r1   t          rwi-a-r--- 128.00m                                    100.00          
[root@vm165 ~]# lvconvert --splitmirror 1 --trackchanges t/r1
  t/r1_rimage_2 split from t/r1 for read-only purposes.
  Use 'lvconvert --merge t/r1_rimage_2' to merge back into t/r1.
[root@vm165 ~]# lvs
  LV          VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root        rhel_vm165 -wi-ao---- <45.02g                                                    
  swap        rhel_vm165 -wi-ao----  <3.98g                                                    
  r1          t          rwi-a-r--- 128.00m                                    100.00          
  r1_rimage_2 t          Iri-a-r--- 128.00m                                                    
[root@vm165 ~]# lvconvert --merge t/r1_rimage_2
  t/r1_rimage_2 successfully merged back into t/r1.
[root@vm165 ~]# lvs -a
  LV            VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root          rhel_vm165 -wi-ao---- <45.02g                                                    
  swap          rhel_vm165 -wi-ao----  <3.98g                                                    
  r1            t          rwi-a-r--- 128.00m                                    100.00          
  [r1_rimage_0] t          iwi-aor--- 128.00m                                                    
  [r1_rimage_1] t          iwi-aor--- 128.00m                                                    
  [r1_rimage_2] t          iwi-aor--- 128.00m                                                    
  [r1_rmeta_0]  t          ewi-aor---   4.00m                                                    
  [r1_rmeta_1]  t          ewi-aor---   4.00m                                                    
  [r1_rmeta_2]  t          ewi-aor---   4.00m


[root@vm235 ~]# uname -r
3.10.0-1062.el7.x86_64
[root@vm235 ~]# lvm version
  LVM version:     2.02.185(2)-RHEL7 (2019-05-13)
  Library version: 1.02.158-RHEL7 (2019-05-13)
  Driver version:  4.37.1
  Configuration:   ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-default-locking-dir=/run/lock/lvm --with-usrlibdir=/usr/lib64 --enable-lvm1_fallback --enable-fsadm --with-pool=internal --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd --enable-blkid_wiping --enable-python2-bindings --with-cluster=internal --with-clvmd=corosync --enable-cmirrord --with-udevdir=/usr/lib/udev/rules.d --enable-udev_sync --with-thin=internal --enable-lvmetad --with-cache=internal --enable-lvmpolld --enable-lvmlockd-dlm --enable-lvmlockd-sanlock --enable-dmfilemapd
[root@vm235 ~]# lsblk
NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                   8:0    0    1G  0 disk 
sdb                   8:16   0    1G  0 disk 
sdc                   8:32   0    1G  0 disk 
sdd                   8:48   0    1G  0 disk 
vda                 252:0    0   50G  0 disk 
├─vda1              252:1    0    1G  0 part /boot
└─vda2              252:2    0   49G  0 part 
  ├─rhel_vm143-root 253:0    0 45.1G  0 lvm  /
  └─rhel_vm143-swap 253:1    0  3.9G  0 lvm  [SWAP]
[root@vm235 ~]# vgcreate t /dev/sd*
  Physical volume "/dev/sda" successfully created.
  Physical volume "/dev/sdb" successfully created.
  Physical volume "/dev/sdc" successfully created.
  Physical volume "/dev/sdd" successfully created.
  Volume group "t" successfully created
[root@vm235 ~]# lvcreate -y -m2 -L128 -nr1 t
  Logical volume "r1" created.
[root@vm235 ~]# lvs -ao+segtype,devices
  LV            VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Type   Devices                                     
  root          rhel_vm143 -wi-ao---- <45.12g                                                     linear /dev/vda2(992)                              
  swap          rhel_vm143 -wi-ao----  <3.88g                                                     linear /dev/vda2(0)                                
  r1            t          rwi-a-r--- 128.00m                                    100.00           raid1  r1_rimage_0(0),r1_rimage_1(0),r1_rimage_2(0)
  [r1_rimage_0] t          iwi-aor--- 128.00m                                                     linear /dev/sda(1)                                 
  [r1_rimage_1] t          iwi-aor--- 128.00m                                                     linear /dev/sdb(1)                                 
  [r1_rimage_2] t          iwi-aor--- 128.00m                                                     linear /dev/sdc(1)                                 
  [r1_rmeta_0]  t          ewi-aor---   4.00m                                                     linear /dev/sda(0)                                 
  [r1_rmeta_1]  t          ewi-aor---   4.00m                                                     linear /dev/sdb(0)                                 
  [r1_rmeta_2]  t          ewi-aor---   4.00m                                                     linear /dev/sdc(0)                                 
[root@vm235 ~]# lvconvert --splitmirror 1 --trackchanges t/r1
  t/r1_rimage_2 split from t/r1 for read-only purposes.
  Use 'lvconvert --merge t/r1_rimage_2' to merge back into t/r1.
[root@vm235 ~]# lvconvert --merge t/r1_rimage_2
  t/r1_rimage_2 successfully merged back into t/r1.