[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the size of the loop-device?
Markus Laire wrote:
> losetup -e AES256 -H random /dev/loop7 "$DEV"
> losetup -e AES256 -H random /dev/loop6 /dev/loop7
> losetup -s $halfsize /dev/loop4 /dev/loop6
> losetup -o $halfsize /dev/loop5 /dev/loop6
You have three loops stacked which does have small run time overhead.
My advise is to stack only two. Something like this:
losetup -e AES256 -H random /dev/loop7 "$TMPDEV"
losetup -e AES256 -H random /dev/loop6 "$SWAPDEV"
losetup -e twofish256 -H random /dev/loop5 /dev/loop7
losetup -e twofish256 -H random /dev/loop4 /dev/loop6
If do decide to use $halfsize, then you need to make sure that sizelimit
(-s) and offset (-o) options given to losetup must be multiples of 512 bytes.
Just cutting some device size in half does not guarantee that.
--
Jari Ruusu 1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9 DB 1D EB E3 24 0E A9 DD
-
Linux-crypto: cryptography in and on the Linux system
Archive: http://mail.nl.linux.org/linux-crypto/