Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.