Mounting Shares Under Mythbuntu

To begin with, make sure that the appropriate Samba components are installed on the system. Normally, only the Samba server is installed but to mount CIFS or SMBFS share points additional packages are required. You may wish to include the utility commands installed with the Samba client package (smbclient) to aid you diagnosing problems, etc. However, all that is really necessary (on later systems, at least) is either the smbfs package or the cifs-utils package. Searching for "samba" and or "cifs" in the package manager should yield a list. Be sure to install the same version of the client and utilities as the version of Samba that is already installed on your system. If you are brave and you don't want to use the package manager to check what you're installing, you can try:

     sudo apt-get install smbclient cifs-utils

Note that the smbfs package is supposed to be superseded by the cifs-utils package but that some people experience problems with CIFS. If you are one of them, you may have to revert to SMBFS. To do this, install the smbfs package, which requires cifs-utils as one of its prerequisites:

     sudo apt-get install smbfs

Once the appropriate packages are installed, you should be able to do:

     man mount.cifs

and optionally:

     man mount.smbfs

Share points need to be mounted in the Mythbuntu file system somewhere. Usually, the top-level directory /mnt is used for this. We like to keep things organized so we create a second-level directory named after the machine we're mounting from and a third-level directory named after the share name. So, for example:

     sudo mkdir /mnt/videoserv
     sudo mkdir /mnt/videoserv/DVD

You can mount the shared video directory on a one-time-basis (good for testing) or permanently. To do it on a one time basis, use:

     sudo mount -t cifs // /mnt/videoserv/DVD --verbose -o

If you have problems mounting shares from an older version of Samba, you may be able to change "cifs" to "smbfs" (after you install smbfs, per the instructions above) but you should really upgrade your older Samba to a later version. Under the latest kernels, "smbfs" may not be supported.

To mount the share permanently, edit /etc/fstab with your favorite editor and add a line to mount the share:

     sudo emacs /etc/fstab
     #Samba shares
     //  /mnt/videoserv/DVD  cifs  \
         ro,noauto,guest,user=guest,sec=none,iocharset=utf8  0  0

You should test that you can mount the share now with:

     sudo mount /mnt/videoserv/DVD

If the mount does not succeed, you can usually find out what happened by doing:

     sudo dmesg | tail

Some other options that you may wish to consider for your fstab entry are:


These specify the password for the user on the video server (if any), that the video server's inode numbers should not be used on the local system (the default, but it never hurts to specify the defaults), and the mode for files and directories (if the video server doesn't support the CIFS Unix extensions).

Once you are sure that the mount will work, edit /etc/rc.local to automatically mount the share, after everything is up and running (the mount cannot be done directly in fstab, since Samba will not be up and running when the mounts are done -- besides, this allows for the video server to be down and not stop the system from booting):

     sudo emacs /etc/rc.local



# Bring up the Samba shares, once everything is up and running. #
# Note that the same fracking geniuses who screwed up the way system tasks # are started apparently had a crack at rc.local too. It no longer waits # until all tasks have started before it runs. So, we must force an # artificial delay to allow the network to come up before we try the Samba # mounts.
sleep 10
mount /mnt/videoserv/DVD


The share will come up mounted when next you reboot.

Note that, for MythVideo to work, all of the video files must be readable as part of the local filesystem. This means if you have a separate frontends and backends, they must all mount the directories themselves. Consequently, you must perform this step for each of your frontends/backends.

Also, since the full path names to all the videos are stored in the shared database, you must mount the video directories under exactly the same path on each of the systems that will view them. This restriction applies, even though you get to supply the list of directories (below, via the "Directories that hold videos" field). Perhaps the path names stored in the database should have been relative to the path names given in the "Directories that hold videos" field but, so far, this is not the case.