LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Attaching an external drive to a server should be picked up by (XBMC) client (http://www.linuxquestions.org/questions/linux-newbie-8/attaching-an-external-drive-to-a-server-should-be-picked-up-by-xbmc-client-891732/)

martdj 07-14-2011 11:51 AM

Attaching an external drive to a server should be picked up by (XBMC) client
 
I post this here cause I have simply no idea to set this up. The problem is this: My movie collection is growing that large that it no longer fits on the 3TB storage I have available for it in my server. I therefore want to start using external disks, but as I don't want to waste electricty I want to switch this drive on only when I want to watch a movie which is on this drive. This drive will be connected to my server running Fedora 15 x64. The movies will (most likely) be played by a machine running XBMC on an Ubuntu minimal install (10.04). Currently I use NFS to create a mount on this machine to my media folder.
The question: How can I best setup this external drive and shares etc so to have these movies available from my XBMC machine when I switch on the drive, but nothing crashing when the drive is off (while the XBMC machine stays on)?

{BBI}Nexus{BBI} 07-14-2011 05:19 PM

It shouldn't crash. The most that should happen is a slight hang/pause while xbmc checks for the presence of the shares. After not finding them it will simply timeout.

martdj 07-15-2011 03:29 AM

Ok, but would XBMC notice if I switch the drive on in the sense that it will find the drive then? Also will the Fedora server be ok if a drive that's shared over NFS is switched off?

{BBI}Nexus{BBI} 07-15-2011 10:22 AM

Quote:

Originally Posted by martdj (Post 4415384)
Ok, but would XBMC notice if I switch the drive on in the sense that it will find the drive then?

There would be no need for xbmc to find the drive as the path to the share should already be defined by you in your xbmc.

For example on the server you connect the drive to, the drive it mounts to a directory called '/media/customvideos'. You create a share for /media/customvideos via NFS or Samba.

In xbmc you would browse to the share on the remote server and save that as a source for video content.

If the drive is not connected to the server and you try to access the share in xbmc, it will simply fail because there is no content to display.

When you connect the drive to the server, if the drive automounts to /media/customvideos, the share you created for it becomes active. So now if you try to access it via xbmc it will work. I hope that explaination helps.

Quote:

Also will the Fedora server be ok if a drive that's shared over NFS is switched off?
I can't speak for Fedora, but I shouldn't think it would matter. The best way to know is to try it and see.

martdj 07-15-2011 04:25 PM

I've run into a problem I'm afraid. My external harddisk is formatted in NTFS. The rights on the directory I want to share are root:root drwx...... In other words only the root user can access those files and I can't change those rights using chmod or chown. My xbmc machine when I mount the drive through NFS there complains about Access denied. Any ideas other than changing my drive to Ext2/4?

tekhead2 07-15-2011 04:41 PM

I think you may find this post of interest http://www.linuxquestions.org/questi...onroot-119700/

{BBI}Nexus{BBI} 07-15-2011 05:00 PM

If you cannot change the permissions on the mount point whilst the drive is mounted, diconnect the drive then chmod the mount point. There should be no need to change the file format of the drive being mounted. The NFS error Access denied is a permissions thing. I don't know how skilled you are at the terminal but webmin is a good web based admin tool. No I don't work for them and there are others. This is the one I use I can recommend it.

This is what you type to automount external devices as read/write by default: Gnome
Code:

sudo ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs
KDE su or su - to root first then do:
Code:

ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs

schneidz 07-15-2011 06:45 PM

wow, i have a setup quite similar:
- xbmc-live downstairs connected to my tv (acer revo) wifi
- fedora-14 upstairs (acer revo) ethernet
- - i took a 100mb disk from my old pc reformatted it as ext2 and got a ide -> usb cable (resting on a hitch hikers g2 dvd cover (it doesnt get that hot so i keep it plugged in)

i use sshfs with ssh keys on my xbmc machine and i put this in my .profile:
Code:

while [ 1 ]
do
 if [ ! -d /home/xbmc/hyper/tv/boondocks ]
 then
  sudo /etc/init.d/networking restart
  sshfs schneidz@192.168.1.25:/media/win/stuff /home/xbmc/hyper
 fi
 sleep 10
done &

it essentially checks if it can see my tv directory every 10 seconds and if not it restarts my wifi connection and tries to remount the drive.

tekhead2 07-18-2011 09:41 AM

Wow schneidz thats a really neat setup. I never thought of that.. I keep forgetting about the profile config. I'm going to be using that a lot more often!


All times are GMT -5. The time now is 07:31 PM.