Crypsetup (Unix) is not reading my device

4

2

I have a Unix based question.

Intro:

Trying to create local image which is coded by the cryptsetup tool. Here are my steps:

abcdef# dd if=/dev/zero of=image.img bs=512M count=1
1+0 records in
1+0 records out
536870912 bytes (537 MB) copied, 6.39732 s, 83.9 MB/s
abcdef# cryptsetup luksFormat image.img

WARNING!
========
This will overwrite data on image.img irrevocably.

Are you sure? (Type uppercase yes): YES
Cannot read device image.img.



Q:
How can I make it work correctly(creating local image with crypting support) or how can I (if its possible of course) to swindle my os? Any idea's ? :)

R.U

Posted 2011-01-25T13:25:17.297

Reputation: 43

Answers

3

You should use loopback device for this:

losetup /dev/loop0 image.img
cryptsetup luksFormat /dev/loop0

Probable next steps:

cryptsetup luksOpen /dev/loop0 qqq
mkfs.ext3 /dev/mapper/qqq
mount /dev/mapper/qqq /mnt/tmp/

# work with mounted container in /mnt/tmp

umount /mnt/tmp/
cryptsetup luksClose qqq
losetup -d /dev/loop0

Vi.

Posted 2011-01-25T13:25:17.297

Reputation: 13 705