Centos 7/8/9 and openeuler build fail with /usr partition while works for other distro

Bug #1955557 reported by Peter Garlic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

Using /usr on partition schema image build fails with error "Logical volume vg/lv_root contains a filesystem in use"

After the error program loops on " umount: /tmp/dib_image.nnnnnnn: target is busy."

Error tested and found with: centos 7, 8 , 9, openeuler-minimal
The same configuration works with: ubuntu 20 (focal), debian 11 (bullseye), opensuse 15.1

Test environment:
build server: Fedora release 31 (Thirty One)
disk-image-create: 3.16.1
Python: 3.7.9

Below the exception snippet, full log for centos7 (same error for version 8, 9 and openeuler) on attachment:

2021-12-22 08:12:57.253 | DEBUG diskimage_builder.block_device.utils [-] exec_sudo: Logical volume vg/lv_root contains a filesystem in use. exec_sudo /var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/utils.py:135
2021-12-22 08:12:57.277 | Traceback (most recent call last):
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/lib/dib-block-device.py", line 7, in <module>
2021-12-22 08:12:57.277 | sys.exit(main())
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/cmd.py", line 120, in main
2021-12-22 08:12:57.277 | return bdc.main()
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/cmd.py", line 115, in main
2021-12-22 08:12:57.277 | self.args.func()
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/cmd.py", line 39, in cmd_umount
2021-12-22 08:12:57.277 | self.bd.cmd_umount()
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/blockdevice.py", line 442, in cmd_umount
2021-12-22 08:12:57.277 | node.umount()
2021-12-22 08:12:57.277 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/level1/lvm.py", line 284, in umount
2021-12-22 08:12:57.278 | lvs._umount()
2021-12-22 08:12:57.278 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/level1/lvm.py", line 218, in _umount
2021-12-22 08:12:57.278 | '/dev/%s/%s' % (self.base, self.name)])
2021-12-22 08:12:57.278 | File "/var/dib/dib-venv/lib64/python3.7/site-packages/diskimage_builder/block_device/utils.py", line 143, in exec_sudo
2021-12-22 08:12:57.278 | raise e
2021-12-22 08:12:57.278 | diskimage_builder.block_device.exception.BlockDeviceSetupException: exec_sudo failed

Image creation command bash script:

export DIB_BLOCK_DEVICE_CONFIG='
- local_loop:
    name: image0

- partitioning:
    base: image0
    name: mbr
    label: mbr
    partitions:
      - name: root
        base: image0
        flags: [ boot,primary ]
        size: 100%

- lvm:
    base: mbr
    pvs:
      - name: pv
        options: ["--force"]
        base: root

    vgs:
      - name: vg
        base: ["pv"]
        options: ["--force"]

    lvs:
      - name: lv_root
        base: vg
        size: 4G

      - name: lv_home
        base: vg
        size: 1G

      - name: lv_usr
        base: vg
        size: 2G

- mkfs:
    name: fs_root
    base: lv_root
    label: "img-rootfs"
    type: "ext4"
    mount:
      mount_point: /
      fstab:
          options: "rw,relatime"
          fsck-passno: 1

- mkfs:
    name: fs_home
    base: lv_home
    type: "ext4"
    mount:
      mount_point: /home
      fstab:
          options: "rw,nodev,relatime"

- mkfs:
    name: fs_usr
    base: lv_usr
    type: "ext4"
    mount:
      mount_point: /usr
      fstab:
          options: "default"

'

export DIB_RELEASE=7
export DIB_DEV_USER=devuser
export DIB_IMAGE_CACHE=/var/dib/.cache
export DIB_DEV_USER_PASSWORD=DevUser
export DIBWORKPATH=/var/dib/
export DIB_DEV_USER_PWDLESS_SUDO=true
export DIB_AVOID_PACKAGES_UPDATE=1
export DIB_DEBUG_TRACE=1
disk-image-create --image-size 20 -o test002-centos7.qcow2 vm centos dracut-regenerate devuser openssh-server 2>&1 | tee test002-centos7.log

Revision history for this message
Peter Garlic (petergarlic) wrote :
Revision history for this message
Peter Garlic (petergarlic) wrote :

similar issue reported by Joshua Slater on 2020-10-05

https://bugs.launchpad.net/diskimage-builder/+bug/1898612

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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