Can I use fstab to mount HTTP shares?

3

I typically mount the "drive" in question in Windows with an http://1.2.3.4/sharename address. In Linux (Ubuntu 10.04), I tried adding the following entry to /etc/fstab to no avail:

http://1.2.3.4/sharename /mnt/sharename cifs username=myusername,password=mypassword 0 0

When I mount /mnt/sharename, I see this error:

mount, wrong fs type, bad option, bad superblock on http://1.2.3.4/sharename

How can I mount this path in Ubuntu 10.04?

David Fox

Posted 2010-08-27T11:54:58.453

Reputation: 449

Answers

2

http: is usually used for WebDAV shares, so:

  • If you use Ubuntu, you'll probably have GNOME or KDE. Both accept URLs like dav://host/path in their file managers.

    (GNOME also lets you gvfs-mount dav://address from terminal.)

  • If you want to skip the GVFS and Kio layers, you will want davfs.

    (cifs, which you are trying to use, is purely for the Windows file sharing protocol.)

user1686

Posted 2010-08-27T11:54:58.453

Reputation: 283 655

3

Probably not. fstab isn't magic, it's just a list of file systems that your computer will try to mount at start time (and other times, but start time is usually where it's read). The file is read, and then various mount utilities are used, depending on the file system type. And CIFS as a protocol isn't remotely close to the http protocol. It's like you're writing 'plug the Nintendo 64 cartridge into the XBox360' and assuming it will just work. You need something that actually speaks http in this instance.

Do you really need file system over http, or do you want to just read/write files on a webserver that you control? If it's the latter, you need to figure out how those files are served on a fileserver (cifs, nfs) and configure that.

Do you really want to serve over http? It wasn't designed (though can be forced into it) as a file system protocol. Look into WebDav, and there are some (http://savannah.nongnu.org/projects/davfs2) true drivers for webdav.

Rich Homolka

Posted 2010-08-27T11:54:58.453

Reputation: 27 121

I don't have specific access to the box hosting the mapped drives currently in use by my Windows users. So, it's not a "do you need" or "do you want" question, it's a "have this, how do I make it work" :) – David Fox – 2010-08-27T20:15:44.627

1

That is not a HTTP share in Windows, either. It's a CIFS share.

Instead just use

 //1.2.3.4/sharename /mnt/sharename cifs username=myusername,password=mypassword 0 0

Janne Pikkarainen

Posted 2010-08-27T11:54:58.453

Reputation: 6 717

It just times out. Does the username need a domain or anything? – David Fox – 2010-08-27T12:18:03.123

CIFS is not served over HTTP. – user1686 – 2010-08-28T10:16:26.567

1

Mine works like this:

office:/OurDocs$  /mnt/home/our_docs  cifs  user,_netdev,noatime,nodiratime,user=myusername

or

1.2.3.4:/OurDocs$  /mnt/home/our_docs  cifs  user,_netdev,noatime,nodiratime,user=myusername

Tom

Posted 2010-08-27T11:54:58.453

Reputation: 1 321