0

Using Debian 12 VM.

Is there any way to mount in the filesystem, a singular remote file (typically media, e.g. mkv) accessed via HTTP/S path?

I've tried various solutions:

rclone - won't mount a singular file, only directories httpfs2 - doesn't seem to work with ssl

I specifically want to mount these files on demand, so that they may be played via a local media server once indexed, and such media servers are file based, they cannot play remote media/HTTP streams.

Performance is also paramount here.

Any help or advice would be appreciated.

2
  • 4
    In general, one can't mount a single file. Also using http(s) to access files seems odd. Why don't you just e.g. use sshfs to get to the mountpoint where the files reside and have them indexed that way? Commented Feb 18 at 21:47
  • I do know that some media servers are object-storage based, e.g. using Minio/S3 storage, and not necessary local files. Commented Feb 19 at 11:16

2 Answers 2

2

"Mounting" is a concept that applies only to directories on Linux. So, you couldn't even theoretically "mount" a single file somewhere.

You might also be confusing rclone's WebDAV support for the ability to "mount a file via HTTP". WebDAV is functionality on top of HTTP that allows to treat remote access via HTTP more like a remote file system, with options to scan directories for files, get information on file sizes, ownership etc, which are all things that don't exist at all in HTTP itself or are optional.

So, long story short: while, sufficiently motivated, you might sit down and learn how to write your own userland file system (FUSE) to enable a local view on a single file served by some server via HTTP, and while you can certainly shoehorn that into an overlay system, a single file on HTTP really is not something you can sensibly mount.

3
  • You can mount disk images, those are single files. Commented Feb 19 at 16:02
  • @terdon ah, right, but I meant the thing you get then: the directory structure in that disk image, visible in the directory it was mounted on. Commented Feb 19 at 16:48
  • You can mount single files; that's how (for example) named-chroot sets things up (/var/named/chroot/etc/services amongst others) Commented Feb 19 at 20:33
2

I found httpdirfs which does what I need.

If you only want to access a single file, there is also a simplified Single File Mode. This can be especially useful if the web server does not present a HTTP directory listing.

e.g.

httpdirfs -f --cache --single-file-mode https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.0.0-amd64-netinst.iso mnt

Perhaps "mount" was a poor choice of words, but couldn't decide on anything more suitable.

Thanks for the help.

1
  • 3
    Hang on, are you sure this works? The example is using a disk image which is something you can mount. Are you sure it would allow you to "mount" a regular file that is not an image? Looking at the relevant git issue, it does look like it is indeed designed for arbitrary files and the example just happened to be an iso, but it would be worth confirming, if you can. Thanks for taking the time to post your solution by the way! Commented Feb 19 at 16:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.