tags:

views:

2228

answers:

5

First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.

I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable.

Currently there are a few options I'm looking at, the most insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed.

It's a cheap solution, OK?

Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. any browser that isn't Internet Explorer).

Some Clarifications

  • The computers used to access this website are a mixture of WIndows (XP) and Linux (Ubuntu) with a mixture of browsers (Opera and Firefox).
  • In linux entering smb://computer/share only seems to work in Nautilus (and presumably Konqueror / Dolphin for you KDE3.5/4 people). It doesn't work in Firefox or Opera (Firefox does nothing, Opera complains the URL is invalid).
  • I don't have a Windows box handy atm so I'm unsure if \\computer\share works in anything apart from IE (e.g. Firefox / Opera).
  • If you have a better idea for consolidating a bunch of random samba shares (it certainly can't get much worse than mine ;-)) it's worth knowing that there is no guarantee that any of the servers I would be wanting to index / consolidate would be up at any particular moment. Moreover, I wouldn't want the knowledge of what they have shared lost or hidden just because they weren't available. I would want to know that they share 'foo' but they are currently down.
A: 

For a Linux/Mac environment you might want to consider broadcasting the share list through Avahi/Zeroconf. I'm not sure how well does this work with Windows machines. On the other hand - if it's mostly media, wouldn't it be better to have all the shares mounted on a central server that would index them and stream the content to clients? Something along MediaTomb.

@SCdF : just checked, got my first kernel panic in a year's time... No, Samba does not handle disappearing mounted shares well (at least not while reading from them).

DSF still requires a central location for the filesystem root (Samba and DFS).

skolima
+2  A: 

To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately.

Alternatively, if you want to consolidate SMB shares you could try using Microsoft DFS (which also works with Samba).

You set up a DFS root and tell it about all the other SMB/Samba shares you have in your environment. Clients then connect to the root and see all the shares as if they were hosted on that single root machine; the root silently redirects clients to the correct system when they open a share.

Think of it as like symbolic links or a virtual file system for SMB.

It would solve your browsing problem. I'm not sure if it would solve your searching one.

Dave Webb
+3  A: 

@Skolima,

WRT mounting them all on a central server, I'm not sure that would work in my situation.

Firstly because I don't have a central server (one of the drivers behind the madness is not buying anymore hardware).

Secondly, the particular computers containing the shares are not guaranteed to be on at any particular time so I don't think that would work.. unless smb mounts automagically deal with their mounts going up and down..?

SCdF
+2  A: 

I'd probably just setup Apache on the SAMBA servers and let it serve the files via HTTP. That'd give you a nice autoindex default page too, and you could just wget and concatenate each index for your master list.

A couple of other thoughts:

  1. file://server/share/file is the defacto Windows way of doing it
  2. You can register protocol handlers in Windows, so you could register smb and redirect it to file://. I'd suspect GNOME/KDE/etc. would offer the same.
Mark Brackett
+2  A: 

Hmm, protocol handlers look interesting.

As Mark said, in Windows protocol handlers can be dealt with at the OS level

Protocol handlers can also be done at the browser level (which is preferred, as it is cross platform and doesn't involve installing anything).

Summary of how it works in Firefox
Summary of how it works in Opera

SCdF