error mounting encrypted files

Steven R. Ringwald asric at asric.com
Wed Jul 7 08:42:23 UTC 2004


Paulo Antonio wrote:

>Up to Fedora 1, I could mount encrypted files but I
>can't do it on Fedora 2.
>
>I used to do:
>
># mount -o loop,encryption=xor encrypted_file /mnt/dir
>Password: <my password here>
>#
>
>Now I get:
>
># mount -o loop,encryption=xor encrypted_file /mnt/dir
>Password: <my password here>
>ioctl: LOOP_SET_STATUS: Invalid argument
>#
>
>I've seen similiar complaints on the net, but people
>complain about des or some other stronger encryption,
>while they say xor works. I can't even get xor
>working!
>
>I've tried loading modules such as cryptoloop, xor,
>des, etc. They all load, but I can't never mount the
>file. What's the matter with losetup? Please help.
>
I got the same thing, using AES encryption, instead of xor. What I 
needed to do was this:

modprobe loop
modprobe cryptoloop
modprobe aes

losetup -e aes /dev/loop0 /dev/md4
<give a password>
mke2fs /dev/loop0
losetup -d /dev/loop0

In my case, I have the filesystem, /dev/md4, in my fstab.

/dev/md4                /secure                 ext2 
noauto,encryption=aes 0 0

then, assuming that the modprobe above has been done, I can type:

mount /secure

and it asks me for a password and mounts the filesystem.

Now to get this to work for a filesystem that needs to be mounted at 
bootup, there is one more step:

mkinitrd --with=aes --with=cryptoloop --with=loop /boot/initrd 
<kernel-version>

Hopefully this helps. I have not used the XOR encryption, so I can only 
give the AES example, and say that it is working for me in this fashion.

Steve





-- 
Steven Ringwald
Asric Consulting Services





More information about the fedora-list mailing list