Cryptsetup using loop device makes it stop
Hi, i'm trying to use cryptsetup to create an encrypted image file. So i luksFormat-ed it on my server, everything went fine, and on that server i can mount it without a problem.
But on my laptop (same distro, different kernel), there's something that doesn't work. Here's the output i get
$ sudo cryptsetup luksOpen crypto.img crypto --debug
# cryptsetup 1.4.3 processing "cryptsetup luksOpen crypto.img crypto --debug" # Running command luksOpen. # Locking memory. # Allocating crypt device crypto.img context. # Not a block device, using free loop device /dev/loop0. # Trying to open and read device /dev/loop0. Cannot read device /dev/loop0. # Unlocking memory. Command failed with code 15: Block device required
And these are some command i tried to fix the problem :
$ sudo losetup -f /dev/loop0 $ sudo ls -lh /dev/loop0 brw-rw---T 1 root disk 7, 0 May 27 08:00 /dev/loop0 $ sudo losetup -d /dev/loop0 loop: can't delete device /dev/loop0: No such device or address
I know this might not be the best place to ask, because this looks like it's more of a kernel or loopdev problem, but i don't really know where to address this question, so I'm sending this there in hope you'll be able to help.
Thanks for your awesome work anyway, and thanks for your possible help.
Signature · 3 lines
Clément Hertling (Wxcafe) ------ ------ Sent from my netbook's cyberspace
you are probably having a problem with loop device module.
It doesnt look like it was build in the kernel and if its build as a module,it is not loaded.
run below command first and then try to reopen the volume normally and see if it will work
sudo modprobe loop
Well i'd love this to work, but i have that in my .config
CONFIG_BLK_DEV_LOOP=yCONFIG_BLK_DEV_CRYPTOLOOP=y
and it still doesn't work. I guess loopdev is in my kernel.
Signature · 3 lines
Clément Hertling (Wxcafé) ------ ------ Sent from my desktop's cyberspace
Quoted 14 lines · .. ink ..
you are probably having a problem with loop device module.
It doesnt look like it was build in the kernel and if its build as a module,it is not loaded.
run below command first and then try to reopen the volume normally and see if it will work
sudo modprobe loop
_______________________________________________
dm-crypt mailing list
[email protected]
http://www.saout.de/mailman/listinfo/dm-crypt
Quoted 6 lines · Clément Hertling (Wxcafé)
Well i'd love this to work, but i have that in my .config
CONFIG_BLK_DEV_LOOP=yCONFIG_BLK_DEV_CRYPTOLOOP=yand it still doesn't work. I guess loopdev is in my kernel.
cryptoloop option is not important, the first one is enough.
What is your kernel version and arch?
(I should add this to cryptsetup debug output :)
1) try it in two steps:
losetup /dev/loop0 crypto.img
cryptsetup luksOpen /dev/loop0 crypto
Does it work this way?
2) try last stable cryptsetup 1.6.1, does it help?
If it still doesn't work, please use cryptsetup 1.6.1 and send (me or to the list) output of:
uname -a
lsblk
dmsetup table
strace cryptsetup luksOpen crypto.img crypto --debug
Thanks,
Milan