eternaltyro / cryptsetup

Since Google code is shuttering...
http://code.google.com/p/cryptsetup
GNU General Public License v2.0
0 stars 0 forks source link

cryptsetup-reencrypt failed #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cryptsetup luksFormat /dev/mapper/360a98000324669436c2b424f41665755p1
2. cryptsetup luksOpen /dev/mapper/360a98000324669436c2b424f41665755p1 test

3. mkfs.ext4 /dev/mapper/test 
4. mount /dev/mapper/test /mnt/
5. umount  /mnt/
6. cryptsetup luksClose /dev/mapper/test 
7. cryptsetup-reencrypt --debug /dev/mapper/360a98000324669436c2b424f41665755p1

What is the expected output? What do you see instead?

The expected result is success when run the command.
But it failed and the out put of command 7 is as follows:

the out put of command 7 is as follows:
the output of command cryptsetup-reencrypt are as follows:
WARNING: this is experimental code, it can completely break your data.
# cryptsetup 1.6.2 processing "cryptsetup-reencrypt --debug 
/dev/mapper/360a98000324669436c2b424f41665755p1"
# Initialising reencryption context.
# Initialising UUID.
# Allocating crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Trying to open and read device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device 
/dev/mapper/360a98000324669436c2b424f41665755p1
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Releasing crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Releasing device-mapper backend.
# Removing headers.
# Allocating crypt device (null) context.
# Initialising device-mapper backend library.
# Deactivating volume LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org.
# Detected kernel Linux 3.10.0-41.el7.x86_64 x86_64.
# dm version   OF   [16384] (*1)
# dm versions   OF   [16384] (*1)
# Detected dm-crypt version 1.12.1, dm-ioctl version 4.26.0.
# Device-mapper backend running with UDEV support enabled.
# dm status LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org  OF   [16384] (*1)
Device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org is not active.
# Deactivating volume LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new.
# dm status LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new  OF   [16384] (*1)
Device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new is not active.
# Releasing crypt device (null) context.
# Releasing device-mapper backend.
# Created LUKS reencryption log file 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.log.
# Log: direction = 0
# Log: offset = 0
# Log: shift = 0
# Running reencryption.
# Passhrases initialization.
# Allocating crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Trying to open and read device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device 
/dev/mapper/360a98000324669436c2b424f41665755p1
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Setting ciphertext data device to 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Trying to open and read device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Interactive passphrase entry requested.
Enter passphrase for key slot 0: 
# Blocking interruption on signal.
# Checking volume  [keyslot 0] using passphrase.
# Trying to open key slot 0 [ACTIVE_LAST].
# Reading key slot 0 area.
# Calculated device size is 250 sectors (RW), offset 8.
# DM-UUID is CRYPT-TEMP-temporary-cryptsetup-16162
# Udev cookie 0xd4d3ae0 (semid 524288) created
# Udev cookie 0xd4d3ae0 (semid 524288) incremented to 1
# Udev cookie 0xd4d3ae0 (semid 524288) incremented to 2
# Udev cookie 0xd4d3ae0 (semid 524288) assigned to CREATE task(0) with flags 
DISABLE_SUBSYSTEM_RULES DISABLE_DISK_RULES DISABLE_OTHER_RULES (0xe)
# dm create temporary-cryptsetup-16162 CRYPT-TEMP-temporary-cryptsetup-16162 OF 
  [16384] (*1)
# dm reload temporary-cryptsetup-16162  OFRW    [16384] (*1)
# dm resume temporary-cryptsetup-16162  OFRW    [16384] (*1)
# temporary-cryptsetup-16162: Stacking NODE_ADD (253,14) 0:6 0660 [verify_udev]
# temporary-cryptsetup-16162: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4d3ae0 (semid 524288) decremented to 1
# Udev cookie 0xd4d3ae0 (semid 524288) waiting for zero
# Udev cookie 0xd4d3ae0 (semid 524288) destroyed
# temporary-cryptsetup-16162: Processing NODE_ADD (253,14) 0:6 0660 
[verify_udev]
# temporary-cryptsetup-16162: Processing NODE_READ_AHEAD 256 (flags=1)
# temporary-cryptsetup-16162 (253:14): read ahead is 256
# temporary-cryptsetup-16162: retaining kernel read ahead of 256 (requested 256)
# Udev cookie 0xd4d0c2b (semid 557056) created
# Udev cookie 0xd4d0c2b (semid 557056) incremented to 1
# Udev cookie 0xd4d0c2b (semid 557056) incremented to 2
# Udev cookie 0xd4d0c2b (semid 557056) assigned to REMOVE task(2) with flags 
(0x0)
# dm remove temporary-cryptsetup-16162  OFT    [16384] (*1)
# temporary-cryptsetup-16162: Stacking NODE_DEL [verify_udev]
# Udev cookie 0xd4d0c2b (semid 557056) decremented to 1
# Udev cookie 0xd4d0c2b (semid 557056) waiting for zero
# Udev cookie 0xd4d0c2b (semid 557056) destroyed
# temporary-cryptsetup-16162: Processing NODE_DEL [verify_udev]
Key slot 0 unlocked.
# Releasing crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Releasing device-mapper backend.
# Creating LUKS header backup for device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Allocating crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Trying to open and read device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device 
/dev/mapper/360a98000324669436c2b424f41665755p1
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Crypto backend (gcrypt 1.5.3) initialized.
# Requested header backup of device 
/dev/mapper/360a98000324669436c2b424f41665755p1 (LUKS1) to file 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org.
# Reading LUKS header of size 1024 from device 
/dev/mapper/360a98000324669436c2b424f41665755p1
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Storing backup of header (1024 bytes) and keyslot area (1045504 bytes).
LUKS header backup of device /dev/mapper/360a98000324669436c2b424f41665755p1 
created.
# Creating empty file LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new of size 
1049600.
# Allocating crypt device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new context.
# Trying to open and read device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new.
# Iteration time set to 1000 miliseconds.
# Formatting device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new as type LUKS1.
# Crypto backend (gcrypt 1.5.3) initialized.
# Trying to open and read device 
/dev/mapper/360a98000324669436c2b424f41665755p1.
# Generating LUKS header version 1 using hash sha1, aes, xts-plain64, MK 32 
bytes
# Crypto backend (gcrypt 1.5.3) initialized.
# KDF pbkdf2, hash sha1: 277989 iterations per second.
# Data offset 4096, UUID 5fb88832-dd0e-43c2-8983-8bab3f396cea, digest 
iterations 33875
# Updating LUKS header of size 1024 on device 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
# Reading LUKS header of size 1024 from device 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
New LUKS header for device /dev/mapper/360a98000324669436c2b424f41665755p1 
created.
# Adding new keyslot 0 using volume key.
# Calculating data for key slot 0
# Crypto backend (gcrypt 1.5.3) initialized.
# KDF pbkdf2, hash sha1: 279471 iterations per second.
# Key slot 0 use 136459 password iterations.
# Using hash sha1 for AF in key slot 0, 4000 stripes
# Updating key slot 0 [0x1000] area.
# Allocating a free loop device.
# Trying to open and read device /dev/loop0.
# Calculated device size is 256 sectors (RW), offset 8.
# DM-UUID is CRYPT-TEMP-temporary-cryptsetup-16162
# Udev cookie 0xd4de028 (semid 589824) created
# Udev cookie 0xd4de028 (semid 589824) incremented to 1
# Udev cookie 0xd4de028 (semid 589824) incremented to 2
# Udev cookie 0xd4de028 (semid 589824) assigned to CREATE task(0) with flags 
DISABLE_SUBSYSTEM_RULES DISABLE_DISK_RULES DISABLE_OTHER_RULES (0xe)
# dm create temporary-cryptsetup-16162 CRYPT-TEMP-temporary-cryptsetup-16162 OF 
  [16384] (*1)
# dm reload temporary-cryptsetup-16162  OFW    [16384] (*1)
# dm resume temporary-cryptsetup-16162  OFW    [16384] (*1)
# temporary-cryptsetup-16162: Stacking NODE_ADD (253,14) 0:6 0660 [verify_udev]
# temporary-cryptsetup-16162: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4de028 (semid 589824) decremented to 1
# Udev cookie 0xd4de028 (semid 589824) waiting for zero
# Udev cookie 0xd4de028 (semid 589824) destroyed
# temporary-cryptsetup-16162: Processing NODE_ADD (253,14) 0:6 0660 
[verify_udev]
# temporary-cryptsetup-16162: Processing NODE_READ_AHEAD 256 (flags=1)
# temporary-cryptsetup-16162 (253:14): read ahead is 256
# temporary-cryptsetup-16162: retaining kernel read ahead of 256 (requested 256)
# Udev cookie 0xd4dc200 (semid 622592) created
# Udev cookie 0xd4dc200 (semid 622592) incremented to 1
# Udev cookie 0xd4dc200 (semid 622592) incremented to 2
# Udev cookie 0xd4dc200 (semid 622592) assigned to REMOVE task(2) with flags 
(0x0)
# dm remove temporary-cryptsetup-16162  OFT    [16384] (*1)
# temporary-cryptsetup-16162: Stacking NODE_DEL [verify_udev]
# Udev cookie 0xd4dc200 (semid 622592) decremented to 1
# Udev cookie 0xd4dc200 (semid 622592) waiting for zero
# Udev cookie 0xd4dc200 (semid 622592) destroyed
# temporary-cryptsetup-16162: Processing NODE_DEL [verify_udev]
# Key slot 0 was enabled in LUKS header.
# Updating LUKS header of size 1024 on device 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
Error during update of LUKS header on device 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new.
# Releasing crypt device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new context.
# Closed loop /dev/loop0 (LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new).
# Releasing crypt device /dev/mapper/360a98000324669436c2b424f41665755p1 
context.
# Releasing device-mapper backend.
Creation of LUKS backup headers failed.
# Destroying reencryption context.
# Closing LUKS reencryption log file 
LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.log.
# Removing headers.
# Allocating crypt device (null) context.
# Initialising device-mapper backend library.
# Deactivating volume LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org.
# dm status LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org  OF   [16384] (*1)
Device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.org is not active.
# Deactivating volume LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new.
# dm status LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new  OF   [16384] (*1)
Device LUKS-5fb88832-dd0e-43c2-8983-8bab3f396cea.new is not active.
# Releasing crypt device (null) context.
# Releasing device-mapper backend

What version of the product are you using? On what operating system?
The filesystem of my working directory is xfs and the operating system is 
RHEL7. 

[root@storageqe-06 ~]# cryptsetup --version
cryptsetup 1.6.2
[root@storageqe-06 ~]# cryptsetup-reencrypt --version
crypt_reencrypt 1.6.2
[root@storageqe-06 ~]# uname -a
Linux storageqe-06.rhts.eng.bos.redhat.com 3.10.0-41.el7.x86_64 #1 SMP Fri Nov 
1 19:11:43 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

Please provide any additional information below.

The device mapper device is multipath device. 

Original issue reported on code.google.com by ava861...@gmail.com on 13 Nov 2013 at 8:46

GoogleCodeExporter commented 9 years ago
There is a problem with alignment (only last slot problem), will be fixed soon.

Thanks.

Original comment by gmazyl...@gmail.com on 18 Nov 2013 at 9:16

GoogleCodeExporter commented 9 years ago
Should be fixed in commit
http://code.google.com/p/cryptsetup/source/detail?r=f30bbbffe75b8d561c202839d26f
e40be06d09b6

Original comment by gmazyl...@gmail.com on 21 Nov 2013 at 7:16