0

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?

2
  • 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
3

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.

2
  • 1
    impossible or impractical? – Bobby Jun 14 '12 at 11:16
  • 1
    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... – user1686 Jun 14 '12 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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