Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using curlftpfs, is it possible to mount a file available through FTP on a loop device? I get a Permission denied error when I try it:

$ sudo losetup /dev/loop0 FTPMount/BigFile
losetup: failed to setup loop device: Permission denied

Permissions are OK, /dev/loop0 is free, and losetup works as intended on any other files. If this problem is with curlftpfs, how would I mount a file in a remote FTP server on a loop device?

share|improve this question
What about sudo mount -o loop FTPMount/BigFile /target? – speakr Jun 14 '12 at 10:04
It's a LUKS-encrypted file, so mount doesn't work directly. – moatPylon Jun 14 '12 at 10:08
up vote 3 down vote accepted

First, by default FUSE – which curlftpfs is based on – denies access to all other users, even to root, for security reasons. This has to be disabled using -o allow_root.

Second, mounting a filesystem requires support for random access to any part of the file. FTP does not support this properly (although there are extensions), and curlftpfs does not seem to support such extensions at all ­– it will RETR the entire file even if only a few bytes are desired. Because of this, mounting disk images over FTP is pretty much impossible.

share|improve this answer
impossible or impractical? – Bobby Jun 14 '12 at 11:16
impractical, with a little bit of impossible. If the only operation supported is to retrieve the entire file, then the entire image could be retrieved once and cached in memory or disk; but then it wouldn't really be "over FTP" anymore... – grawity Jun 14 '12 at 11:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .