Home > Uncategorized > LUKS encrypted image with udisk

LUKS encrypted image with udisk

I tried to find a way to create and mount a LUKS encrypted image. Thanks to udisks it starts well:

dd if=/dev/zero of=.encrypted bs=20M count=1024
/sbin/cryptsetup luksFormat .encrypted
udisksctl loop-setup -f .encrypted
udisksctl unlock -b /dev/loop0

Sadly I did not find how to Ext4 format without sudo.

sudo /sbin/mkfs.ext4 -m 0 /dev/dm-0
udisksctl mount -b /dev/dm-0

Fortunately once created it’s possible to mount the encrypted image without root privileges:

udisksctl loop-setup -f .encrypted
udisksctl unlock -b /dev/loop0
udisksctl mount -b /dev/dm-0
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: