LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Encrypted filesystem won't mount because of different version of losetup (https://www.linuxquestions.org/questions/linux-security-4/encrypted-filesystem-wont-mount-because-of-different-version-of-losetup-616885/)

hansv 01-28-2008 11:06 AM

Encrypted filesystem won't mount because of different version of losetup
 
Do my learned fellow linux enthousiasts know if there are different versions of losetup which are incompatible with each other?

I encounter the following:

I have two Linux distro's on my laptop.
1) Slackware 12.0, my main distro for use every day, all day
2) Ubuntu 7.10, to see if it is really user friendly.

I have a partition on my laptop on which I have created a encrypted (loopback) filesystem.

On slackware I can mount this with:
# losetup -e aes /dev/loop0 /dev/hda2
# mount .....

when I follow the exact same procedure on Ubuntu the mount fails with "unknown file system"
  • I have tried specifying different key lengths using the -k parameter (none work)
  • I can setup a new encrypted loopback filesystem on Ubuntu (which I then cannot read in Slackware).
  • The 'losetup' commands are different (accept different parameters)
  • when I mount my Slackware partition and use /slackpart/sbin/losetup I can mount the partition correctly. (So cryptoloop module and crypto subsystems are compatible between Slackware and Ubuntu.

Does anyone know if there are, in fact, different and incompatible versions of losetup and why these incompatibilities exist giving that in the end, they use the same cryptoloop and crypto modules.


Regards,
Hans Voss.

jailbait 01-28-2008 12:10 PM

Quote:

Originally Posted by hansv (Post 3037748)

when I follow the exact same procedure on Ubuntu the mount fails with "unknown file system"

Does anyone know if there are, in fact, different and incompatible versions of losetup and why these incompatibilities exist giving that in the end, they use the same cryptoloop and crypto modules.

I don't think that you have incompatible versions of losetup. The problem is most likely that you are using the wrong file system type in your mount command.

--------------------
Steve Stites

hansv 01-29-2008 02:14 AM

No, its not the mount command or the file system type.

I have used the mount command with and without specifying the proper file system (ext3).
And like I said, if I use the other version of losetup, everything just works. (without fs specification).

maroonbaboon 01-30-2008 08:18 PM

The (text) file

http://loop-aes.sourceforge.net/ciphers.README

mentions some compatibility issues between different implementations of loop encryption and involving different parameters for losetup. Not sure if this is relevant for you.

hansv 01-31-2008 04:06 AM

Ha, solved it.

Indeed "maroonbaboon", the text file in the link was not relevant for me. However, in looking up what parameters the Ubuntu (Debian based!) version of losetup understood I found what I was looking for (and missed completely, several times before).

The Debian (so also Ubuntu) version of losetup doesn't just use the provided password, it runs a hash over it first. (So between slackware and Ubuntu, even though I correctly typed the password, the password offered to the encryption system was quite different. Fortunately Ubuntu (debian) losetup has the '-N' parameter which suppresses the additional password hash.

so:
Slackware: losetup -e aes /dev/loop0 /dev/hda2
Ubuntu : losetup -e aes -N /dev/loop0 /dev/hda2


All times are GMT -5. The time now is 09:53 PM.