losetup

From RaySoft

losetup is used to associate loop devices with regular files or block devices, to detach loop devices and to query the status of a loop device. If only the DEVICE argument is given, the status of the corresponding loop device is shown.[1]

Documentation

Parameters

-d FILE|DEVICE, --detach FILE|DEVICE
Detach the FILE or DEVICE associated with the specified loop device.
-e CIPHER, -E CIPHER, --encryption CIPHER
Enable data encryption with specified CIPHER.

Examples

Create a encrypted file system in a file
dd if='/dev/urandom' of='cryptfile' bs='1M' count=20
losetup --encryption 'twofish' '/dev/loop0' 'cryptfile'
mke2fs '/dev/loop0'
losetup --detach '/dev/loop0'
Create a encrypted ISO image
mkisofs -R -o 'image.iso' 'pfad/zu/den/dateien'
dd if='/dev/urandom' of='crypt.iso' bs='1M' count=700
losetup --encryption 'twofish' '/dev/loop0' 'crypt.iso'
dd if='image.iso' of='/dev/loop0'
losetup --detach '/dev/loop0'

References

  1. man 8 'losetup'