Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been reading up on tools like Truecrypt, loop-AES and Cryptoloop that use a "loop device" to create an encrypted disk volume within a file.

On the README page for loop-AES, it has this paragraph about journaling file systems:

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

Don't use a journaling file system on top of file backed loop device. Device backed loop device can be used with journaling file systems as device backed loops guarantee that writes reach disk platters in order required by journaling file system (write caching must be disabled on the disk drive, of course). With file backed loop devices, correct write ordering may extend only to page cache (which resides in RAM) of underlying file system. VM can write such pages to disk in any order it wishes, and thus break write order expectation of journaling file system.

Do you know what they mean by "on top of file backed loop device"? Are they referring to a situation where my disk is physically formatted with a journaling file system (like ext3, ext4, or XFS) and then within that file system I create a file which houses the virtual disk volume? Or are they describing the reverse, where the journaling file system is within the file that houses the virtual disk volume?

I have my Linux partitions formatted as ext4, so if they're referring to the first situation, I would have to resize partitions and create an ext2 or FAT partition to save the file that will house the Truecrypt/loop-AES/Cryptoloop volume.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

A "file backed loop device" is a loop-mounted disk file.

Such as mounting /home/mike/mydisk.raw on /mnt.

Device backed is when you've mounted something from /dev, like /dev/sda3

The situation they are referring to has the following structure:

Files
  |
  v
Journaled Filesystem
  |
  v
Encrypted loop mount
  |
  v
Disk file
  |
  v
Journaled Filesystem
  |
  v
Physical device

As you can see there are two filesystems in the chain with two lots of caching and two lots of journaling. Not only wasteful but can cause problems with write-ordering. So just don't use journaling on the top-level filesystem. It's simple enough to turn off.

The situation they say I OK has the following structure:

Files
  |
  v
Journaled Filesystem
  |
  v
Encrypted loop mount
  |
  v
Physical disk

You see there is only one filesystem (and only one set of journaling and caching) in that arrangement.

share|improve this answer
    
In your first diagram, would it be acceptable to replace the "Files -> Journaled Filesystem" with "Files -> Non-journaled filesystem", while keeping "Journaled filesystem -> Physical device"? If yes, that would mean I can keep the underlying ext4 journaling file system which is already in place for my partitions, as long as the file which houses the encrypted volume doesn't have another journaling file system. I definitely wouldn't want journaling at 2 layers anyway, I'm just trying to understand where the journaling is allowed if it's allowed once. –  Mike Rowave Apr 3 '11 at 23:23
    
Yes. As they say: Don't use a journaling file system on top of file backed loop device. which means you can use it for the filesystem holding the file backed loop device. –  Majenko Apr 4 '11 at 7:51
    
Thanks. My previous confusion was because I was unclear on what "on top of" meant, as it can mean different things depending on how one visualizes the file systems. –  Mike Rowave Apr 4 '11 at 9:02
    
The easiest way of visualizing it is to imagine the physical disk is at the bottom of the stack and you, the user, are at the top. –  Majenko Apr 4 '11 at 9:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.