Reading External Drive with Media Tomb (Error could not list directory /media/ : Permission denied)

So you decided to abandon Windows and start using Linux.  Good for you. That’s the point that I’m at.  However, in the process I forwent a handful of software.  One of them was the Digital Living Network Alliance (DLNA) service invokable in Windows Media Player that allowed my Logitech Revue (connected to my TV) to communicate and read the video files indexed by Windows Media Player (on both internal and external drives).

When I switched over to Linux, there were two major processes I had to execute in order to get a similar communication service between my TV and computer started.  The first step was to install MediaTomb.  Out of the box, MediaTomb worked and communicated with my TV. I was able to access videos on my internal hard drive through my TV’s Logitech Revue without a problem.

However when I tried to add videos on MediaTomb from my external (Western Digital 500 MB) hard drive, I received the following error message:  Error: could not list directory /media/eBook/ : Permission Denied

Error when trying to read external drive via MediaTomb web interface

So, I tried changing the permissions on the drive (and all the folders) without any success.  The permissions could not be changed with sudo commands like:

find /media/eBook -type d -exec chmod 755 '{}' \;

So, below are the steps that I took to solve the problem.

First, I had to find out a little bit more information about the hard drive, it’s UUID in particular.  The easiest way to get this information is with a program called gParted.  Since I didn’t have it, I needed to install it.  Since I am using Ubuntu I executed the following command: sudo apt-get install gparted.

After the installation is complete you will need to open the program.  You can open the program with the following command:  gksudo gparted.  Please note that these commands may vary slightly with your version of Linux.

After issuing that command, the following interface will appear.  By default the partitions of your internal hard drive should show up.  They will be prefixed with the letters “sda”.  Take note of the upper right hand corner. There you will be able to switch to other drives mounted by Linux.  Ubuntu does a very nice job of mounting external drives and USBs on start up and anytime for that matter.  Faster than Windows in fact.

Using the upper right hand corner selection box, switch to /dev/sdb.  This will take you to your external drive.

Next, select the external drive that you would like for MediaTomb to be able to read from.

Once you right click and view it’s properties, you will get a Window like the following.  Take note of the UUID and if it’s sdb1, sdb2, 3 or so on.

Next you will edit your fstab file.  The fstab files provides a list of all disks and their partitions and indicates how they are to be initialized.  Mine for example, identifies all my internal drives.  So, I will need to modify it so that it loads and treats my eBook (soon to have the pseudo mediaBook) like an internal one so that MediaTomb can read it.  Before we do that, let’s create a new directory under my /media directory.  Do so by typing sudo mkdir /media/mediaBook.  I named mine mediaBook but you can name yours anything.

Next, open your fstab file with any text editor.  I like to use gedit, since it’s robust and already comes installed in Ubuntu.  You can open fstab with gedit by typing the following command: sudo gedit /etc/fstab

The fstab file will open in gedit like below.  Then you will add a line at the bottom.  Using the UUID that you wrote down previously, type the following line at the bottom of your fstab file with your drive IDs and custom names if you deviated from mine:

/dev/sdb1:     /media/the_dir_you_created     LABEL="any_name_you_want"  UUID="your_devices_UUID"    TYPE="ntfs (or the format of your external drive)"

This is what mine looks like.

Lastly, you will need to restart your system and MediaTomb.  The quick way to restart your system is by giving the following command on your terminal:  sudo shutdown -rq now.  After you boot up again, if MediaTomb did not restart automatically, you can restart it with the following command in your terminal:  sudo service mediatomb start

Now, when you fire up MediaTomb, you will be able to access your external drive via the mount point you set in your fstab.

If you have any questions about the process or related topics themselves, such as MediaTomb in general or DLNA for Linux (rather UPnP), please ask.   There are a lot of great alternative software packages for Linux that shouldn’t go unexplored and will definitely make the transition from Windows to Linux much easier.


1 Comment

Filed under Computer - Technical

One response to “Reading External Drive with Media Tomb (Error could not list directory /media/ : Permission denied)

  1. Pingback: VISTA TO UBUNTU (WITH SERVER APPS), Top Android Apps, Top Win8 Apps, etc | Adaptive Intelligence