* [dm-crypt] run cryptsetup-reencrypt failed
[not found] <245352634.13975129.1383904841583.JavaMail.root@redhat.com>
@ 2013-11-08 10:18 ` Xiao Ni
2013-11-08 11:07 ` Milan Broz
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Ni @ 2013-11-08 10:18 UTC (permalink / raw)
To: dm-crypt
Hi
I ran the command cryptsetup-reencrypt and it failed. I'll give the log as follows.
I added some debug codes, and find it failed when write device. Then I modify the code when open device and it works well.
I don't know whether it's right to modify by this way. Could you help me to check this?
139 /* Get path to device / file */
140 const char *device_path(const struct device *device)
141 {
142 if (!device)
143 return NULL;
144
145 //if (device->file_path)
146 // return device->file_path;
147
148 //return device->path;
149 if (device->path)
150 return device->path;
151
152 return device->file_path;
153
154 }
[root@storageqe-06 /]# ./cryptsetup-1.6.2/src/cryptsetup-reencrypt /dev/dm-10 --debug
WARNING: this is experimental code, it can completely break your data.
# cryptsetup 1.6.2 processing "/cryptsetup-1.6.2/src/.libs/lt-cryptsetup-reencrypt /dev/dm-10 --debug"
# Initialising reencryption context.
# Initialising UUID.
# Allocating crypt device /dev/dm-10 context.
# Trying to open and read device /dev/dm-10.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device /dev/dm-10.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device /dev/dm-10
open device /dev/dm-10
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Releasing crypt device /dev/dm-10 context.
# Releasing device-mapper backend.
# Removing headers.
# Allocating crypt device (null) context.
# Initialising device-mapper backend library.
# Deactivating volume LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.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-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org OF [16384] (*1)
Device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org is not active.
# Deactivating volume LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new.
# dm status LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new OF [16384] (*1)
Device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new is not active.
# Releasing crypt device (null) context.
# Releasing device-mapper backend.
# Created LUKS reencryption log file LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.log.
# Log: direction = 0
# Log: offset = 0
# Log: shift = 0
# Running reencryption.
# Passhrases initialization.
# Allocating crypt device /dev/dm-10 context.
# Trying to open and read device /dev/dm-10.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device /dev/dm-10.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device /dev/dm-10
open device /dev/dm-10
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Setting ciphertext data device to /dev/dm-10.
# Trying to open and read device /dev/dm-10.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Interactive passphrase entry requested.
Enter passphrase for key slot 1:
# Blocking interruption on signal.
# Checking volume [keyslot 1] using passphrase.
# Trying to open key slot 1 [ACTIVE_LAST].
# Reading key slot 1 area.
# Calculated device size is 250 sectors (RW), offset 264.
# DM-UUID is CRYPT-TEMP-temporary-cryptsetup-19880
# Udev cookie 0xd4d7ef6 (semid 7831552) created
# Udev cookie 0xd4d7ef6 (semid 7831552) incremented to 1
# Udev cookie 0xd4d7ef6 (semid 7831552) incremented to 2
# Udev cookie 0xd4d7ef6 (semid 7831552) assigned to CREATE task(0) with flags DISABLE_SUBSYSTEM_RULES DISABLE_DISK_RULES DISABLE_OTHER_RULES (0xe)
# dm create temporary-cryptsetup-19880 CRYPT-TEMP-temporary-cryptsetup-19880 OF [16384] (*1)
# dm reload temporary-cryptsetup-19880 OFRW [16384] (*1)
# dm resume temporary-cryptsetup-19880 OFRW [16384] (*1)
# temporary-cryptsetup-19880: Stacking NODE_ADD (253,13) 0:6 0660 [verify_udev]
# temporary-cryptsetup-19880: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4d7ef6 (semid 7831552) decremented to 1
# Udev cookie 0xd4d7ef6 (semid 7831552) waiting for zero
# Udev cookie 0xd4d7ef6 (semid 7831552) destroyed
# temporary-cryptsetup-19880: Processing NODE_ADD (253,13) 0:6 0660 [verify_udev]
# temporary-cryptsetup-19880: Processing NODE_READ_AHEAD 256 (flags=1)
# temporary-cryptsetup-19880 (253:13): read ahead is 256
# temporary-cryptsetup-19880: retaining kernel read ahead of 256 (requested 256)
# Udev cookie 0xd4dea15 (semid 7864320) created
# Udev cookie 0xd4dea15 (semid 7864320) incremented to 1
# Udev cookie 0xd4dea15 (semid 7864320) incremented to 2
# Udev cookie 0xd4dea15 (semid 7864320) assigned to REMOVE task(2) with flags (0x0)
# dm remove temporary-cryptsetup-19880 OFT [16384] (*1)
# temporary-cryptsetup-19880: Stacking NODE_DEL [verify_udev]
# Udev cookie 0xd4dea15 (semid 7864320) decremented to 1
# Udev cookie 0xd4dea15 (semid 7864320) waiting for zero
# Udev cookie 0xd4dea15 (semid 7864320) destroyed
# temporary-cryptsetup-19880: Processing NODE_DEL [verify_udev]
Key slot 1 unlocked.
# Releasing crypt device /dev/dm-10 context.
# Releasing device-mapper backend.
# Creating LUKS header backup for device /dev/dm-10.
# Allocating crypt device /dev/dm-10 context.
# Trying to open and read device /dev/dm-10.
# Initialising device-mapper backend library.
# Trying to load LUKS1 crypt type from device /dev/dm-10.
# Crypto backend (gcrypt 1.5.3) initialized.
# Reading LUKS header of size 1024 from device /dev/dm-10
open device /dev/dm-10
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Crypto backend (gcrypt 1.5.3) initialized.
# Requested header backup of device /dev/dm-10 (LUKS1) to file LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org.
# Reading LUKS header of size 1024 from device /dev/dm-10
open device /dev/dm-10
# Key length 32, device size 10483712 sectors, header size 2050 sectors.
# Storing backup of header (1024 bytes) and keyslot area (1045504 bytes).
open device /dev/dm-10
LUKS header backup of device /dev/dm-10 created.
# Creating empty file LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new of size 1049600.
# Allocating crypt device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new context.
# Trying to open and read device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new.
# Iteration time set to 1000 miliseconds.
# Formatting device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new as type LUKS1.
# Crypto backend (gcrypt 1.5.3) initialized.
# Trying to open and read device /dev/dm-10.
# 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: 285871 iterations per second.
# Data offset 4096, UUID bfeb35f1-90b9-4bc6-ba43-a4302db7957b, digest iterations 34875
open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
errno is 9
# Updating LUKS header of size 1024 on device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
path is LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
file path is (null)
errno is 9
# Reading LUKS header of size 1024 from device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
New LUKS header for device /dev/dm-10 created.
# Adding new keyslot 1 using volume key.
# Calculating data for key slot 1
# Crypto backend (gcrypt 1.5.3) initialized.
# KDF pbkdf2, hash sha1: 289023 iterations per second.
# Key slot 1 use 141124 password iterations.
# Using hash sha1 for AF in key slot 1, 4000 stripes
# Updating key slot 1 [0x21000] area.
# Allocating a free loop device.
# Trying to open and read device /dev/loop0.
# Calculated device size is 256 sectors (RW), offset 264.
# DM-UUID is CRYPT-TEMP-temporary-cryptsetup-19880
# Udev cookie 0xd4d578a (semid 7897088) created
# Udev cookie 0xd4d578a (semid 7897088) incremented to 1
# Udev cookie 0xd4d578a (semid 7897088) incremented to 2
# Udev cookie 0xd4d578a (semid 7897088) assigned to CREATE task(0) with flags DISABLE_SUBSYSTEM_RULES DISABLE_DISK_RULES DISABLE_OTHER_RULES (0xe)
# dm create temporary-cryptsetup-19880 CRYPT-TEMP-temporary-cryptsetup-19880 OF [16384] (*1)
# dm reload temporary-cryptsetup-19880 OFW [16384] (*1)
# dm resume temporary-cryptsetup-19880 OFW [16384] (*1)
# temporary-cryptsetup-19880: Stacking NODE_ADD (253,13) 0:6 0660 [verify_udev]
# temporary-cryptsetup-19880: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4d578a (semid 7897088) decremented to 1
# Udev cookie 0xd4d578a (semid 7897088) waiting for zero
# Udev cookie 0xd4d578a (semid 7897088) destroyed
# temporary-cryptsetup-19880: Processing NODE_ADD (253,13) 0:6 0660 [verify_udev]
# temporary-cryptsetup-19880: Processing NODE_READ_AHEAD 256 (flags=1)
# temporary-cryptsetup-19880 (253:13): read ahead is 256
# temporary-cryptsetup-19880: retaining kernel read ahead of 256 (requested 256)
errno is 9
# Udev cookie 0xd4d5652 (semid 7929856) created
# Udev cookie 0xd4d5652 (semid 7929856) incremented to 1
# Udev cookie 0xd4d5652 (semid 7929856) incremented to 2
# Udev cookie 0xd4d5652 (semid 7929856) assigned to REMOVE task(2) with flags (0x0)
# dm remove temporary-cryptsetup-19880 OFT [16384] (*1)
# temporary-cryptsetup-19880: Stacking NODE_DEL [verify_udev]
# Udev cookie 0xd4d5652 (semid 7929856) decremented to 1
# Udev cookie 0xd4d5652 (semid 7929856) waiting for zero
# Udev cookie 0xd4d5652 (semid 7929856) destroyed
# temporary-cryptsetup-19880: Processing NODE_DEL [verify_udev]
# Key slot 1 was enabled in LUKS header.
# Updating LUKS header of size 1024 on device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
# Key length 32, device size 2050 sectors, header size 2050 sectors.
open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new //I thinks it should open /dev/loop0
path is /dev/loop0
file path is LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
errno is 22
r = -1, solid = 1024
ccccccccc
Error during update of LUKS header on device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new.
# Releasing crypt device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new context.
# Closed loop /dev/loop0 (LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new).
# Releasing crypt device /dev/dm-10 context.
# Releasing device-mapper backend.
Creation of LUKS backup headers failed.
# Destroying reencryption context.
# Closing LUKS reencryption log file LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.log.
# Removing headers.
# Allocating crypt device (null) context.
# Initialising device-mapper backend library.
# Deactivating volume LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org.
# dm status LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org OF [16384] (*1)
Device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.org is not active.
# Deactivating volume LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new.
# dm status LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new OF [16384] (*1)
Device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new is not active.
# Releasing crypt device (null) context.
# Releasing device-mapper backend.
Best Regards
Xiao Ni
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dm-crypt] run cryptsetup-reencrypt failed
2013-11-08 10:18 ` [dm-crypt] run cryptsetup-reencrypt failed Xiao Ni
@ 2013-11-08 11:07 ` Milan Broz
2013-11-13 8:54 ` Xiao Ni
0 siblings, 1 reply; 3+ messages in thread
From: Milan Broz @ 2013-11-08 11:07 UTC (permalink / raw)
To: Xiao Ni, dm-crypt; +Cc: Ondrej Kozina
On 8.11.2013 11:18, Xiao Ni wrote:
> [root@storageqe-06 /]# ./cryptsetup-1.6.2/src/cryptsetup-reencrypt /dev/dm-10 --debug
First, NEVER EVER use /dec/dm-X devices directly.
Always use symbolic links in /dev/mapper or other links, which are not dynamic.
...
> open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
> path is LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
> file path is (null)
this is strange.
It creates temporary LUKS headers in file in current directory.
What filesystem you are using there?
> open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new //I thinks it should open /dev/loop0
> path is /dev/loop0
no, loop should be hidden there.
Anyway, could you add this to issues http://code.google.com/p/cryptsetup/issues/list
and add more info about your system?
I know you are using some complex storage config like multipath, so the best way
will be to discuss it with Ondra (as my former RH colleague) inside RH and when you
have all the info, just report it to issues page.
Thanks,
Milan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dm-crypt] run cryptsetup-reencrypt failed
2013-11-08 11:07 ` Milan Broz
@ 2013-11-13 8:54 ` Xiao Ni
0 siblings, 0 replies; 3+ messages in thread
From: Xiao Ni @ 2013-11-13 8:54 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt, Ondrej Kozina
Hi Milan Broz
Sorry reply this so late and I'm busy doing my work about RHEL7.
----- Original Message -----
> From: "Milan Broz" <gmazyland@gmail.com>
> To: "Xiao Ni" <xni@redhat.com>, dm-crypt@saout.de
> Cc: "Ondrej Kozina" <okozina@redhat.com>
> Sent: Friday, November 8, 2013 6:07:54 AM
> Subject: Re: [dm-crypt] run cryptsetup-reencrypt failed
>
>
> On 8.11.2013 11:18, Xiao Ni wrote:
> > [root@storageqe-06 /]# ./cryptsetup-1.6.2/src/cryptsetup-reencrypt
> > /dev/dm-10 --debug
>
> First, NEVER EVER use /dec/dm-X devices directly.
> Always use symbolic links in /dev/mapper or other links, which are not
> dynamic.
>
> ...
> > open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
> > path is LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new
> > file path is (null)
>
> this is strange.
>
> It creates temporary LUKS headers in file in current directory.
> What filesystem you are using there?
It's xfs.
>
>
> > open device LUKS-bfeb35f1-90b9-4bc6-ba43-a4302db7957b.new //I
> > thinks it should open /dev/loop0
> > path is /dev/loop0
>
> no, loop should be hidden there.
Thanks for the redress.
>
> Anyway, could you add this to issues
> http://code.google.com/p/cryptsetup/issues/list
> and add more info about your system?
>
> I know you are using some complex storage config like multipath, so the best
> way
> will be to discuss it with Ondra (as my former RH colleague) inside RH and
> when you
> have all the info, just report it to issues page.
I have discussed this with Ondra and please let me know if you need more information about this.
>
>
> Thanks,
> Milan
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-13 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <245352634.13975129.1383904841583.JavaMail.root@redhat.com>
2013-11-08 10:18 ` [dm-crypt] run cryptsetup-reencrypt failed Xiao Ni
2013-11-08 11:07 ` Milan Broz
2013-11-13 8:54 ` Xiao Ni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox