Simulation completed, mostly following the howto here:
http://weichselbraun.net/manual/encrypted_dvd/encrypted_dvd.htmlhighighted in red the difference from the howto
dd if=/dev/zero of=/system/dvd.img bs=1000000 count=4700
losetup /dev/loop0 /system/dvd.img
cryptsetup -c aes-cbc-essiv:sha256 -y -s 256 luksFormat /dev/loop0
< enter the passphrase >
cryptsetup luksOpen /dev/loop0 dvd
mkudffs --media-type=dvd /dev/mapper/dvd
mkdir /iso
mount /dev/mapper/dvd /iso
mount -o remount,rw /iso
# add some data, i.e. /iso/testfile
umount /iso
cryptsetup luksClose dvd
losetup -d /dev/loop0
At this point my image is prepared,
now I remount /system as read-only (
don't do this on your '/' and '/home' filesystems), therefore simulating a read-only media like CD/DVDs.
mount -o remount,ro /system
the
mount command show it better:
/dev/sda13 on /system type ext4 (ro,noatime,acl)
now, I try to use the encrypted image:
cryptsetup luksOpen /system/dvd.img secret
< enter the passphrase >
mount /dev/mapper/secret /mnt
[ mount: block device /dev/mapper/secret is write-protected, mounting read-only ]
You can see, there are no errors here, even using a read-only filesystem/image.
ls /mnt:
total 0
drwxr-xr-x 2 root root 40 Jan 8 22:19 lost+found/
-rw-r--r-- 1 root root 9 Jan 8 23:20 testfile
df -T
...
/dev/sda13 ext4 76G 41G 32G 57% /system
/dev/mapper/secret
udf 4.4G 290K 4.4G 1% /mnt
losetup -a
/dev/loop0: [080d]:12 (/system/dvd.img)
ending the tests:
umount /mnt
cryptsetup luksClose secret
all is fine here, even when using read-only device.
May I suggest to check your container using the md5sum utility ? results should match.
DVD: md5sum /media/New/diskimage
HD: md5sum <location of your working copy on hd of the diskimage file>
also, once you have mapped your container using:
cryptsetup luksOpen /media/New/diskimage diskimage
try:
udffsck /dev/mapper/diskimage
AS