Difference between revisions of "Mediashares"
(→The Solution) |
|||
Line 41: | Line 41: | ||
mkdir /media/ubuntumedia/ | mkdir /media/ubuntumedia/ | ||
mkdir /media/ubuntumedia/mediashare/ | mkdir /media/ubuntumedia/mediashare/ | ||
+ | |||
+ | hint 'mkdir -p /media/ubuntumedia/mediashare/' (-p creates parent dirs if required) (thanks kuil:) | ||
now you should be able to successfully mount the folder in the client pc, and both pc's frontend and backend report media at /media/ubuntumedia/mediashare/ | now you should be able to successfully mount the folder in the client pc, and both pc's frontend and backend report media at /media/ubuntumedia/mediashare/ |
Revision as of 14:23, 15 February 2008
The Problem
You have setup a location for music or video files perhaps on your backend and you want to access these files from a frontend. This is slightly complicated by the fact that all systems need to share media from the same location or the mythdatabase will store the locations twice.
The Solution
You need to set up nfs and an export for your media directory.
first install the following, you may have these installed already.
$ sudo apt-get install nfs-kernel-server portmap nfs-common
For this example the media i wish to share is at
/media/ubuntumedia/mediashare
its a folder in a harddrive mounted at /media on my backend. I did try making a link to this folder in /data/ however this doesnt work you can't do this you need the actual path.
$ sudo nano /etc/exports
add the following line
/media/ubuntumedia/mediashare/ 192.168.1.0/24(rw,async)
restart the nfs-kernel-server
$ sudo /etc/init.d/nfs-kernel-server restart
ok thats the path to your media and you are granting access to any machine on the 192.168.1.x network obviously your paths and lan may be different.
on the client pc
$sudo mount mybackend://media/ubuntumedia/mediashare/ /media/ubuntumedia/mediashare/
replace mybackend with the name or ip of the pc having your media directory.
for this mount to work you need the exact same file path you probably already have /media/ so
mkdir /media/ubuntumedia/ mkdir /media/ubuntumedia/mediashare/
hint 'mkdir -p /media/ubuntumedia/mediashare/' (-p creates parent dirs if required) (thanks kuil:)
now you should be able to successfully mount the folder in the client pc, and both pc's frontend and backend report media at /media/ubuntumedia/mediashare/
Isn't that cool
to make it stick you need an entry in fstab
$ sudo nano /etc/fstab
mybackend://media/ubuntumedia/mediashare/ /media/ubuntumedia/mediashare/ nfs auto 0 0
now in your mythfrontend music you would set the filepath as (if it was video it'd be pretty much the same)
/media/ubuntumedia/mediashare/
and scan for new music, (actually rather than scan from a remote frontend do it from the pc holding the actual files otherwise it will be very slow to scan).
Thats pretty much it job done make another export for music or video and now all video and music are stored on your server and accessible.