Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-53866

when converting LV to thin-pool with VDO for thin-data backing, lvconvert should first check for filesystem in use

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-9.5
    • None
    • No
    • None
    • sst_logical_storage
    • ssg_filesystems_storage_and_HA
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • x86_64
    • None

      The pooldatavdo lvconvert command is creating dummy volumes that need to be manually cleaned up instead of first checking for an in use filesystem and then existing right away.

      # The lvconvert cmd should look more like an open volume deactivate attempt. Just a warning and then an error code.
      [root@virt-485 ~]# lvremove VG/lvol0
        Logical volume VG/lvol0 contains a filesystem in use.
      [root@virt-485 ~]# echo $?
      5
      
      
       
      kernel-5.14.0-490.el9    BUILT: Fri Aug  2 10:42:23 PM CEST 2024
      lvm2-2.03.24-2.el9    BUILT: Wed Aug  7 09:41:45 PM CEST 2024
      lvm2-libs-2.03.24-2.el9    BUILT: Wed Aug  7 09:41:45 PM CEST 2024
        
      [root@virt-485 ~]# lvcreate --type striped -i 2 -L 25G VG
      [root@virt-485 ~]# mkfs.xfs /dev/VG/lvol0
      [root@virt-485 ~]# mount /dev/VG/lvol0 /mnt/lvol0
       
      [root@virt-485 ~]# lvconvert --type thin-pool --pooldatavdo y VG/lvol0
        Thin pool volume with chunk size 64.00 KiB can address at most <15.88 TiB of data.
        WARNING: Converting VG/lvol0 to thin pool's data volume with metadata wiping.
        THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
      Do you really want to convert VG/lvol0? [y/n]: y
        Logical volume VG/lvol0 contains a filesystem in use.
        Aborting. Failed to deactivate logical volume VG/lvol0.
      [root@virt-485 ~]# echo $?
      5
       
      [root@virt-485 ~]# lvs -a -o +devices
        LV             VG            Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                
        lvol0          VG            -wi-ao---- 25.00g                                                     /dev/sda(0),/dev/sdb(0)
        lvol1          VG            -wi------- 28.00m                                                     /dev/sda(3207)         
        pool_metadata0 VG            -wi-a----- 28.00m                                                     /dev/sda(3200)         
      

            zkabelac@redhat.com Zdenek Kabelac
            cmarthal@redhat.com Corey Marthaler
            lvm-team lvm-team
            Cluster QE Cluster QE
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: