[pkg-cryptsetup-devel] Bug#574948: cryptsetup doesn't work if disk contains filesystem

Dmitry E. Oboukhov unera at debian.org
Mon Mar 22 12:20:22 UTC 2010


Package: cryptsetup
Version: 2:1.1.0~rc2-1
Severity: wishlist

Today I wanted to crypt one of my disk.
I added a record into /etc/crypttab:

mmedia /dev/sdb /etc/cryptdisk.key size=256,cipher=aes-cbc-plain,hash=ripemd160

then I did command:

# cryptdisks_start mmedia
Starting crypto disk...mmedia (starting)...
mmedia: the precheck for '/dev/sdb' failed: - The device /dev/sdb contains a valid filesystem type ext4. ... (warning).
mmedia (failed)...failed.

I searched an option to force crypdisk creating but couldn't.

Then I made:

# dd if=/dev/sdb of=first_meg.img bs=1M count=1
# dd if=/dev/zero of=/dev/sdb bs=1M count=1

Then command 'cryptdisks_start mmedia' began work:

# cryptdisks_start mmedia                  
Starting crypto disk...mmedia (starting)...
mmedia (started)...done.


Then I encrypted my disk:

# dd if=/dev/sdb of=/dev/mapper/mmedia bs=64M
# dd if=first_meg.img of=/dev/mapper/mmedia

Then I was able to continue using it.

I think that the fact that cryptsetup doesn't allow to create
cryptdevice if filesystem exists is a bug. At least it would be nice
to have an option to bypass this situation.

-- 

. ''`.                               Dmitry E. Oboukhov
: :’  :   email: unera at debian.org jabber://UNera@uvw.ru
`. `~’              GPGKey: 1024D / F8E26537 2006-11-21
  `- 1B23 D4F8 8EC0 D902 0555  E438 AB8C 00CF F8E2 6537
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20100322/4a615ad9/attachment.pgp>


More information about the pkg-cryptsetup-devel mailing list