View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 10 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Jul 04, 2007 2:57 pm 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
So I took a stab at trying to setup LinHes with NFS sharing. My first goal was to setup the mythtvslavefrontend to be able to view the videos, music and pictures on the mythtvmasterbackend. Right now I was going to have everything stored on the mythtvmasterbackend. However I would really like to be able to see everything on both. I don't think I setup permissions correctly. So please tell me if I missed something.

I tried to use Cecils document and other posts but I think its all screwed up now.

I saw another post on this where he referenced everything in linhes so I will try to do the same here.

[b]On the slave backend in media settings>videos settings>general settings>directory to hold videos:

Now changed to:

/myth/video


etc/hosts on mythtvmasterbackend

root@mythtvmasterbackend:~# cat /etc/hosts
192.168.11.50 mythtvmasterbackend
192.168.11.52 mythtvslavefrontend
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/fstab on mythtvmasterbackend

root@mythtvmasterbackend:~# cat /etc/fstab
# /etc/fstab: filesystem table.

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda3 /myth ext3 defaults,auto 0 2

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda2 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdb /media/hdb auto noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hdc /media/hdc auto noauto,users,exec 0 0

#mythtvslavefrontend:/myth /mnt/mythtvslavefrontend rsize=8192,wsize=8192,soft,nf
svers=3





/etc/exports on mythtvmasterbackend

root@mythtvmasterbackend:~# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)


/myth sbe(rw,no_root_squash,async,no_subtree_check)



contents of /mnt on mythtvmasterbackend

root@mythtvmasterbackend:/mnt# ls
hdb hdc music mythtvslavefrontend video

/etc/hosts on mythtvslavefrontend

root@mythtvslavefrontend:~# cat /etc/hosts
127.0.0.1 mythtvslavefrontend localhost
192.168.11.52 mythtvslavefrontend
192.168.11.50 mythtvmasterbackend
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/fstab on mythtvslavefrontend

# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
#/dev/hda3 /myth auto defaults,auto 0 2

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda2 none swap defaults 0 0


mythtvmasterbackend:/myth /myth nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3

/etc/exports on mythtvslavefrontend

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#

/myth *(rw)





~/.mythtv/mysql.txt on mythtvslavefrontend

root@mythtvslavefrontend:~# cat ~/.mythtv/mysql.txt
DBHostName=192.168.11.50
DBUserName=mythtv
DBPassword=mythtv
DBName=mythconverg
DBType=QMYSQL3

# Set the following if you want to use something other than the
# machine's real hostname for identifying settings in the database.
# This is useful if your hostname changes often, as otherwise
# you'll need to reconfigure mythtv (or futz with the DB) every time.
# TWO HOSTS MUST NOT USE THE SAME VALUE
#
LocalHostName=mythtvslavefrontend

# If you want your frontend to be able to wake your MySQL server
# using WakeOnLan, have a look at the following settings:
#
# Set the time the frontend waits (in seconds) between reconnect tries.
# This should be the rough time your MySQL server needs for startup
#WOLsqlReconnectWaitTime=0
#
#
# This is the amount of retries to wake the MySQL server until the frontend
# gives up
#WOLsqlConnectRetry=5
#
#
# This is the command executed to wake your MySQL server.
#WOLsqlCommand=echo 'WOLsqlServerCommand not set'


cat /etc/mythtv/mysql.txt on mythtvslavefrontend

root@mythtvslavefrontend:~# cat /etc/mythtv/mysql.txt
DBHostName=192.168.11.50
DBUserName=mythtv
DBName=mythconverg
DBPassword=mythtv[code][/code]


Last edited by alexvd on Mon Jul 16, 2007 11:17 am, edited 4 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 7:31 am 
Offline
Joined: Tue Jan 23, 2007 1:38 pm
Posts: 251
Location: Sweden
One thing you could do to protect your recordings etc is to rsync the /myth directory to a separate drive (internal or usb) once in a while. Since you do want the database to be backed up too, it would make sense to stop the backend, run mythbackup, rsync and then restart the backend. This could be scripted if you like. It's very important to keep the owner/group on all the files (rsync -av) and this is easy to do when staying in one system.

If you are unwilling to stop the backend, you could let mysql export its backups to a second system as described here:
http://www.mythtv.org/wiki/index.php/Us ... aintenance
rsync would not be able to copy any open files, but I think that would not be a problem as long as you get the database copied.

This is a very low tech solution, of course, and it would not save you from a reinstall in worst case, but your content would be safe. :)

Cheers,
/Chris

_________________
LinHES R8.6.1
BE: AMD64X4, 4GB, Hauppauge usb tuners
FE1: Gigabyte F2A85X-UP4, nVidia GT640
FE2: Gigabyte GA-MA69GM-S2H, AthlonX2 4850E 2.5 GHz, 1GB, ASUS GEFORCE 7200GS 256MB
FE3: Asus Eeebox410


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 8:00 am 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
Thanks I will look into doing this. I know that rsync is very powerful way to copy and backup files remotely. I still havent learned how to use it completely yet.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 5:30 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
I do something like this to copy everything to the locally mounted backup disk:
Code:
find / -type f -name '*~' -print | xargs rm
find /myth/tmp -type f -print | xargs rm

/usr/local/bin/mythbackup &&
/usr/bin/rsync -av --delete /myth /backup

For a remote disk I'd probably make the last line something like:
Code:
/usr/bin/rsync -ave /usr/bin/ssh --delete  /myth USER@HOST:/backup

Where USER and HOST were the remote account you're copying to.

I actually do this using a slightly more sophisticated script, but the rest of the details are pretty specific to my machine setup.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 6:18 pm 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
TJC thanks for the advice.

Can you help me figure out why I cant seem to setup the media shares on my masterbackend. When I try to use the video manager it lists no files on the slave frontend. If i goto the frontend on the masterbackend it sees the all the movies in the video folder.

I just need you to look at the entries.

I think where I have screwed up is the where the symbolic links are pointing and the fstab entries.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 12:41 am 
Offline
Joined: Tue Feb 03, 2004 3:23 am
Posts: 159
Location: Friesland, The Netherlands
Couple of things I noticed:

On the masterbackend you have a /myth partition (which is exported with NFS) and a video directory under /mnt. You probably want to make sure that all media files reside under /myth (is probably the largest partition anyway).

Another thing on the masterbackend is that in the /etc/exports file you only export the /myth directory to a host called sbe. That host is probably taken from the example and isn't in your network. You probably want to replace sbe with mythslavefrontend.

Lastly you mount the exported /myth from the masterbackend under /myth on the slavefrontend. Nothing wrong with that, but then you also need to specify /myth/video as the location of where videofiles reside (after having moved the video directory from /mnt to /myth on the masterbackend) in the settings.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 1:58 pm 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
Hi thanks for replying. I took some time off but now I am back to try and fix this.

Yes all my media files are on the masterbackend right now in the /myth directory.

Code:
root@mythtvmasterbackend:~# cd /myth
root@mythtvmasterbackend:/myth# ls
archive  gallery  image_cache  motion  pretty  streamtv  tv
backup   games    lost+found   music   stream  tmp       video
root@mythtvmasterbackend:/myth# cd /myth/video
root@mythtvmasterbackend:/myth/video# ls
Dark Crystal                                cdrom
Dungeons and Dragons (dvdrip)               motion
Heavy.Metal_1981.H.264_AVC_AAC_5.1_720x392  reign of fire
The Sword and the Sorcerer [1982] {XviD}
root@mythtvmasterbackend:/myth/video#


I also changed the entry for the exports file on the masterbackend

Code:
root@mythtvmasterbackend:/etc# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)


/myth mythtvslavefrontend(rw,no_root_squash,async,no_subtree_check)


So you last comment I am confused with. I think you are saying that I have the symbolic link for videos on the slavefrontend pointing to the exported /myth from the backend. This is ok but I have to make sure that all the media files are in the /myth/video on the backend not in /mnt/. Is that right?

If so everything is setup right Afaik know but its not working.

One question I have is somewhere I read somebody saying that since they wanted to store all files centrally on the backend to comment out the fstab entry on the frontend to mount the /myth directory locally. I thought this was initially what I wanted but I wonder if this is screwing me up. Looking below should I have the /dev/hda3 /myth auto defaults, auto 0 2 commented out?



Code:
root@mythtvslavefrontend:~# cat /etc/fstab
# /etc/fstab: filesystem table.
#
# filesystem  mountpoint  type  options  dump  pass
/dev/hda1  /  ext3 defaults,errors=remount-ro  0  1
#/dev/hda3  /myth  auto  defaults,auto  0  2

proc  /proc  proc  defaults  0  0
/dev/fd0  /floppy  vfat  defaults,user,noauto,showexec,umask=022  0  0
usbfs  /proc/bus/usb  usbfs  devmode=0666  0  0
sysfs  /sys  sysfs  defaults  0  0
tmpfs  /dev/shm  tmpfs defaults  0  0
/dev/cdrom /cdrom  iso9660  defaults,ro,user,noexec,noauto  0  0
# Added by KNOPPIX
/dev/hda2 none swap defaults 0 0


mythtvmasterbackend:/myth /mnt/mythtvmasterbackend nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 2:37 am 
Offline
Joined: Tue Feb 03, 2004 3:23 am
Posts: 159
Location: Friesland, The Netherlands
You're getting close!

What I meant in my last comment was that you need to be consistent. I saw references to having the video directory on the slave under /mnt while you tried to mount it under /myth from the backend.

Let's disregard that now and move on to the current situation. You have correctly uncommented the local /myth mount (so the /dev/hda3 partition is not mounted there). The only thing to change now is the last line of your /etc/fstab. Change:

Code:
mythtvmasterbackend:/myth /mnt/mythtvmasterbackend nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3


into:

Code:
mythtvmasterbackend:/myth /myth nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3


And it gets mounted under /myth instead of /mnt/mythtvmasterbackend. You can also leave your /etc/fstab alone, but then in the mythtv setup screens you need to specify the correct pathnames all prefixed with /mnt/mythtvmasterbackend. But again this last comment might be confusing... :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 10:51 am 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
Willem

Thanks I came to the same conclusions over the weekend. I tried to just leave it with the way it was setup as is.

I actually had a error in my fstab line that is now fixed. So my last line in /etc/fstab on my mythtvslavefrontend is

Code:
mythtvmasterbackend:/myth /mnt/mythtvmasterbackend nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3


I changed in media settings=> general the directory to hold videos on the mythtvslavefrontend to

/mnt/mythtvmasterbackend/video



I guess I will try your suggested changes but boy I don't know why this is so hard. I have done it before.

It is still not working.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 10:58 am 
Offline
Joined: Wed Jun 01, 2005 3:59 pm
Posts: 199
Sorry I spoke to soon. I do see the files when I goto watch videos. However I dont see them when I use the video manager.

I guess video manager only scans files on the local machine right. Sorry for all the confusion.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu