Ultimate Media Server Stack: Plex + Open Media Vault + Debian Wheezy Part 2

An Overview

In the previous post we set up a new server running Open Media Vault and Plex on top of that. Next we are going to take our hard drives and mount them into one file system.

Now would be a really good time to power off you VM and take a snapshot!

Heads Up!

  • The IP address I will use is: 192.168.4.25 replace with your server’s ip when needed.
  • I’ll be using a virtual machine in VMWare Fusion, transpose my methods to your environment.
  • I’ll be using three 20gb virtual hard drives, you may have more or less but the steps should be the same.

 

Step Four: Fuse Those File Systems

At this point your file systems should be created. If not please take a look at my previous post. We are going to install MHDDFS and fuse our file systems together to store our media. If you have time you should check out this article, it explains why one would prefer MHDDFS to RAID or Greyhole. Start off by opening an ssh session to your media server as the root user and then enter the following command:


apt-get update && apt-get upgrade -y && apt-get install mhddfs -y;

Okay, that was easy but what now? It’s time to configure our fstab in a way that will fuse our file systems together into one mount point. There is going to be two ways of doing this. Pick a method based on your set up.

 

Method 1:

The first method is the ideal way to do this. It is for people who have installed their OS on a hard drive that is not the one that they plan on storing their media on. The main reasons for doing it this way is to reduce load on the main hard drive and to prevent the main drive from becoming full.

You can skip this method if you chose Method 2.


mkdir /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files mkdir /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files touch /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files/media-drive1.test touch /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files/media-drive2.test mkdir /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint

Your drives will show up in /media/disk-uuid/ . In my case my first media drive shows up as /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/ and the second media drive /media/f0903353-b83e-4e86-8f41-fcb39bde420d/. Your main HDD will not show up in media since its mount point is /. Also be aware that your hard drives uuid’s will be different than mine and you will need to replace mine with yours in the commands above and below.

What have we done this far? We just created a folder on each drive to store our media files in called “files”. Then we put a test file in each “files” folder. Lastly we created a folder called “MediaFusePoint”; we will mount all of the “files” folders here. In reality these folders could be named anything but for the purposes of this tutorial I felt those names were appropriate.

Open the file /etc/fstab with an editor like nano or vi:


nano /etc/fstab

Add a line like this to the end of the file:


mhddfs#/media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files,/media/f0903353-b83e-4e86-8f41-fcb39bde420d/files  /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint fuse defaults,allow_other 0 0
Make sure to use your disk UUIDs, not mine!

This entry will tell Debian to fuse the “files” folders into one file system mounted at the “MediaFusePoint” folder. Type: ctrl+o to save the file then type: ctrl+x to close the file. Next enter the following commands:


mount -a ls /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint/

If you see “media-drive1.test” and “media-drive2.test” in the folder everything went perfectly! Those two drive are now one single file system when access at the “MediaFusePoint” folder!

#Optional clean up
rm /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files/media-drive1.test
rm /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files/media-drive2.test

 

Method 2:

The second method is for someone who has installed their OS on a large hard drive and wants to use that as part of their fuse file system. This method is not preferred due to performance issues that could arise and because there is a possibility that you will fill up your OS hard drive.

[/alert]

You can skip this method if you chose Method 1.


mkdir /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files mkdir /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files mkdir /files touch /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files/media-drive1.test touch /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files/media-drive2.test touch /files/media-drive3.test mkdir /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint

Your drives will show up in /media/disk-uuid/ . In my case my first media drive shows up as /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/ and the second media drive /media/f0903353-b83e-4e86-8f41-fcb39bde420d/. Your main HDD will not show up in media since its mount point is /. Also be aware that your hard drives uuid’s will be different than mine and you will need to replace mine with yours in the commands above and below.

What have we done this far? We just created a folder on each drive, including our main drive, to store our media files. We called this folder “files”. Then we put a test file in each “files” folder. Lastly we created a folder called “MediaFusePoint”, we will mount all of the “files” folders here . In reality these folders could be named anything but for the purposes of this tutorial I felt those names were appropriate.

Open the file /etc/fstab with an editor like nano or vi:


nano /etc/fstab

Add a line like this to the end of the file:


mhddfs#/media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files,/media/f0903353-b83e-4e86-8f41-fcb39bde420d/files,/files  /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint fuse defaults,allow_other 0 0
Make sure to use your disk UUIDs, not mine!

This entry will tell Debian to fuse the “files” folders into one file system mounted at the “MediaFusePoint” folder. Type: ctrl+o to save the file then type: ctrl+x to close the file. Next enter the following commands:


mount -a ls /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/MediaFusePoint/

If you see “media-drive1.test”,”media-drive2.test”, and “media-drive3.test” in the folder everything went perfectly! Those two drive are now one single file system when access at the “MediaFusePoint” folder!


#Optional clean up rm /media/0ed86a80-d78d-4bc5-b77d-b4f075d905a1/files/media-drive1.test rm /media/f0903353-b83e-4e86-8f41-fcb39bde420d/files/media-drive2.test rm /files/media-drive3.test

 

In the next post we will set up our file shares and share permissions.

Leave a Reply

%d bloggers like this: