On Sun, 2008-05-18 at 23:30 +0300, Bogdan Cristea wrote:
I am trying to mount a file as encrypted filesystem on openSuSE 10.3 following indications from: http://en.opensuse.org/SDB:Using_the_Crypto_File_System#Use_a_file_as_encryp...
I am able to execute the first two steps with no problem:
1. dd if=/dev/urandom of=loop_fs bs=1024 count=20000
2. sudo /sbin/losetup -e 3des /dev/loop0 loop_fs
but at the third step I get an error and I am not able to figure out what it is:
3. sudo /sbin/mke2fs /dev/loop0 mke2fs 1.40.2 (12-Jul-2007) mke2fs: Device size reported to be zero. Invalid partition specified, or partition table wasn't reread after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table.
Can anyone tell me please how to solve this issue?
I did this and I can mount/umount my "container", I had intended on actually polishing this and doing an RFC for feedback. As user: - deterine where encrypted container will be placed - create dummy file : dd if=/dev/zero of=/encrypted/data.crypt bs=1m count=20480 of= is the path and name of the encrypted container creates a 20Gig dummy file, use dd if=dev/random ..... for a file that looks like it is all data. NOTE file creation time is greatly increased. - create a mount point for the container: mkdir /home/<user-Name>/Documents/data As root: - losetup /dev/loop7 ./data.crypt As user: - create key using /dev/random: cat /dev/random > foo NOTE press CTRL-C after 1 sec to stop filling foo. cat ./foo | cut -b 0-31 > /home/<user-Name>/crypto.key cryptsetup -c aes -d /home/<user-Name>/crypto.key create data.crypt /dev/loop7 As root: - cryptsetup -c aes -d /home/<user-Name>/crypto.key create data.crypt /dev/loop7 - create a file system on the container: mke2fs -j /dev/mapper/data.crypt - mount files system: mount /dev/mapper/data.crypt /home/<user-Name>/Documents/data At this point the container has an encrypted filesystem and is now mountable by root: - losetup /dev/loop7 ./data.crypt - cryptsetup -d /home/<user-Name>/crypto.key create data.crypt /dev/loop7 - mount /dev/mapper/data.crypt /home/<user-Name>/Documents/data -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org