Loop mount file available through FTP

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?

moatPylon

Posted 2012-06-14T09:48:01.847

Reputation: 118

What about sudo mount -o loop FTPMount/BigFile /target? – speakr – 2012-06-14T10:04:30.053

It's a LUKS-encrypted file, so mount doesn't work directly. – moatPylon – 2012-06-14T10:08:54.753

Answers

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.

user1686

Posted 2012-06-14T09:48:01.847

Reputation: 283 655

1impossible or impractical? – Bobby – 2012-06-14T11:16:06.263

1impractical, 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 – 2012-06-14T11:19:27.263