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 1740342

Summary: Shouldn't new "cryptsetup reencrypt" at least recognize old luks1 formats in order to provide hint to "use cryptsetup-reencrypt for old luks1 devices"
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: cryptsetupAssignee: Ondrej Kozina <okozina>
Status: CLOSED ERRATA QA Contact: guazhang <guazhang>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.1CC: agk, guazhang, jbrassow, mbroz, okozina, prajnoha
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cryptsetup-2.2.0-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:17:22 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-08-12 17:53:12 UTC
Description of problem:
[root@hayes-03 ~]# lvcreate --activate y --type raid1 -m 2 -n split_luks -L 800M split_image /dev/sdj1 /dev/sdn1 /dev/sdo1
  Logical volume "split_luks" created.

[root@hayes-03 ~]#  echo Str0ngP455w0rd### | cryptsetup luksFormat --type luks1 /dev/split_image/split_luks
[root@hayes-03 ~]# echo Str0ngP455w0rd### | cryptsetup luksOpen /dev/split_image/split_luks split_luks
[root@hayes-03 ~]# dmsetup ls
split_image-split_luks_rmeta_1  (253:2)
split_image-split_luks_rmeta_0  (253:0)
split_luks      (253:7)
split_image-split_luks  (253:6)
split_image-split_luks_rimage_2 (253:5)
split_image-split_luks_rimage_1 (253:3)
split_image-split_luks_rimage_0 (253:1)
split_image-split_luks_rmeta_2  (253:4)

[root@hayes-03 ~]# cryptsetup luksClose split_luks

[root@hayes-03 ~]# echo Str0ngP455w0rd### |  cryptsetup reencrypt /dev/split_image/split_luks
Device /dev/split_image/split_luks is not a valid LUKS device.

# It is a valid luks device!
[root@hayes-03 ~]# echo Str0ngP455w0rd### |  cryptsetup-reencrypt /dev/split_image/split_luks
Finished, time 00:06.211,  798 MiB written, speed 128.5 MiB/s   


Version-Release number of selected component (if applicable):
cryptsetup-2.2.0-0.2.el8    BUILT: Mon Jun 17 04:08:11 CDT 2019
cryptsetup-libs-2.2.0-0.2.el8    BUILT: Mon Jun 17 04:08:11 CDT 2019
cryptsetup-reencrypt-2.2.0-0.2.el8    BUILT: Mon Jun 17 04:08:11 CDT 2019


How reproducible:
Everytime


Actual results:
[root@hayes-03 ~]# echo Str0ngP455w0rd### |  cryptsetup reencrypt /dev/split_image/split_luks
Device /dev/split_image/split_luks is not a valid LUKS device.

Expected results:
[root@hayes-03 ~]# echo Str0ngP455w0rd### |  cryptsetup reencrypt /dev/split_image/split_luks
  luks1 not supported by cryptsetup reencrypt use "cryptsetup-reencrypt" instead.

Comment 1 Ondrej Kozina 2019-08-15 19:06:21 UTC
Fixed upstream with commit https://gitlab.com/cryptsetup/cryptsetup/commit/7aa197be7d15e205d108b833a823428f6bd7af8c

Comment 3 Corey Marthaler 2019-08-19 20:31:50 UTC
Fixed verified in the latest rpms.

cryptsetup-2.2.0-1.el8    BUILT: Fri Aug 16 01:22:41 CDT 2019
cryptsetup-libs-2.2.0-1.el8    BUILT: Fri Aug 16 01:22:41 CDT 2019
cryptsetup-reencrypt-2.2.0-1.el8    BUILT: Fri Aug 16 01:22:41 CDT 2019

[root@hayes-01 ~]# lvcreate --activate y --type raid1 -m 2 -n split_luks -L 800M split_image /dev/sdi1 /dev/sdj1 /dev/sdk1
  Logical volume "split_luks" created.
[root@hayes-01 ~]# echo Str0ngP455w0rd### | cryptsetup luksFormat --type luks1 /dev/split_image/split_luks
[root@hayes-01 ~]# echo Str0ngP455w0rd### | cryptsetup luksOpen /dev/split_image/split_luks split_luks
[root@hayes-01 ~]# dmsetup ls
split_image-split_luks_rmeta_1  (253:2)
split_image-split_luks_rmeta_0  (253:0)
split_luks      (253:7)
split_image-split_luks  (253:6)
split_image-split_luks_rimage_2 (253:5)
split_image-split_luks_rimage_1 (253:3)
split_image-split_luks_rimage_0 (253:1)
split_image-split_luks_rmeta_2  (253:4)
[root@hayes-01 ~]# cryptsetup luksClose split_luks
[root@hayes-01 ~]# echo Str0ngP455w0rd### |  cryptsetup reencrypt /dev/split_image/split_luks
Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.

Comment 4 Ondrej Kozina 2019-09-02 09:35:04 UTC
The bug was introduced and fixed during 8.1 devel phase, no docs text needed.

Comment 6 errata-xmlrpc 2019-11-05 22:17:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3569