Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Unix based question.


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

This will overwrite data on image.img irrevocably.

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

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 ? :)

share|improve this question
up vote 3 down vote accepted

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
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .