Geek Freely: share

    Featured Post

    The whole point in this post is to run your own VPN service, and allow you to connect remote devices to your home network.

    To start off yo…

    Showing posts with label share.

    Showing posts with label share.

    So I decided to setup a samba share on my Plex Media Server so I could pull off the mobile photos that are uploaded.

    First off you need to know the location of your mobile uploads, on Ubuntu Server 12.04 that would be:

    cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Mobile\ Photos/

    Once you are aware of the location you can now define the samba share. Open the following file, with write privileges:

    sudo nano /etc/samba/smb.conf

    At the very end of this file, put in your share details:

    [Pictures]

    path = /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media Upload/Mobile Photos/

    available = yes

    valid users = macleod

    read only = yes

    browseable = yes

    public = yes

    writable = no

    Share name is [Pictures], path is obviously path and the rest of the settings are self-explanatory.

    Restart samba using the following command

    sudo service smbd restart

    And to test the syntax use the following:

    testparm

    I used the following link for most of the information provided here:

    So I finally decided to build a dedicated Plex Media Server, my desktop wasn’t cutting it.

    I used the following Plex link to educate myself about the system requirements.

    The Hardware

    Basically it stated that for every HD movie I wish to trans-code and stream I needed a passmark of about 2000.

    Check

    to determine your CPU passmark, and investigate what you need.

    I decided that at maximum I would have 3 simultaneous streams going on, of my home movies of course. All these streams being HD – factor in your network upload speeds when determining what you can handle.

    So, ballpark I needed a processor capable of about 6000 on the passmark scale – and I also made room for overhead.

    I went with the following processor which gave me a passmark around 7300.:

    Start with the processor then let this dictate the rest, I like to keep my systems small so I was looking for a mini-ITX that was LGA 1150 compatible. Please remember and check the CPU maker site to confirm motherboard (MB) compatability.

    The MB I chose in the end was:

    Mini-ITX means smaller case. I went with the following for simplicity.

    So I have my processor, my MB, my case. I added 4GB of RAM and a 120GB SSD. The solid state disk was a little large, since I won’t keep my movies locally. This is the RAM and HD:

    The Software

    So to keep things slick I decided to install Plex on Ubuntu, I figure any future services I want to run will no doubt work on Linux, that and I know Ubuntu. Check the official Plex site for more details on setting this up

    I installed Ubuntu Server, because I don’t really see a need for a GUI front-end, Plex is configured via the web. After installing Ubuntu Server, installing Plex is simple enough:

    Download the .deb package from . if you are putting it on a USB for installing on the Ubuntu Server, you may want to install usbmount to automount inserted USB sticks.

    sudo apt-get install usbmount

    Once you have the .deb package on your server, go ahead and install with the following command, relative to your .deb filename of course:

    sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb

    To setup the server, open a browser window, and go to http://127.0.0.1:32400/web, replacing 127.0.0.1 for the IP of the server if you are configuring this remotely.

    Setting Up NAS Shares

    The next thing you are going to want to do before getting involved with the configuration is map all your samba shares.

    You will need cifs-utils:

    sudo apt-get install cifs-utils

    I used the following link to work out my samba situation:

    Make a .smbcredential file in your home directory so you can map your fstab correctly. In this file put username and equals sign and the access username for the share (and domain if loging into a domain) on the first line, put password and equals sign and the password for that user account on the second line of the file. The file should look like:

    username=MyUsername

    password=MyPassword

    # OR:

    # username=MyUsername@MyDomain

    # password=MyPassword

    # OR: (for cifs on Windows Serve 2003)

    # username=MyDomain/MyUsername

    # password=MyPassword

    Edit fstab to map your mounts (sudo nano /etc/fstab). Entries in your fstab should look similar to the following:

    //master/install_files /path/to/mnt cifs iocharset=utf8,credentials=/path/to/.smbcredentials,uid=1000 0 0

    Where…

    //$SERVER/$SHARE $MOUNTPOINT $FS_TYPE credentials=$SMB_CREDENTIALS,uid=$UID,gid=$GID

    # e.g.

    SERVER=master

    SHARE=install_files

    MOUNTPOINT=/path/to/mnt

    FS_TYPE=smbfs

    SMB_CREDENTIALS=/path/to/.smbcredentials

    UID=1000

    GID=1000

    Once completed exit nano and save the changes to fstab. Make sure that the shares mount correctly:

    sudo mount -a

    If successful, reboot and make sure that mounts and Plex start automagically.

    Now configure your Plex shares! Enjoy.

    So I have FreeNAS running samba shares on my network, for the most part I really don’t need to access the data on my actually Linux boxes – only my HTPC.

    But I decided I wanted to create mount point on the media folder of my Ubuntu install.

    So here is what I had to do in fstab (/etc/fstab)

    //freenas_server/sharename /media/localsharedirectory cifs credentials=/home/macleod/smb.credentials,uid=mountuser,gid=mountgroup,iocharset=utf8,codepage=cp437,auto 0 0

    My credentials are stored in smb.credentials, like so:

    username=myuname

    password=mypwd

    And I got most of the information from here:

    Obviously replace mountgroup, mountuser with your ubuntu username and group (group is probably the same as name).  Also replace the appropriate shares and credentials – hopefully you get the picture.

    UPDATE:

    I edited the fstab entry so I now define the iocharset and codepage, this is so foreign characters are displayed correctly in the filesystem, and applications.  I noticed the issue due to having display issues in iSub and Subsonic.

    UPDATE2:

    The DOS Charset should be CP437 – CP850 is missing a few which I needed for foreign language music artists.

    I was trying to use symbolic links:

    ln -s /mnt/Personal/Music /mnt/user/Music

    But I needed to add them to the wheel group – which didn’t make sense, I tried doing everything relative, instead of absolute – like indicated http://www.proftpd.org/docs/howto/Chroot.html but it didn’t work for me.  Adding them to wheel basically allowed them to navigate anywhere they wanted.

    If anyone has had success using symlinks with their proftpd server, do let me know.

    In the end I had to mount a null filesystem

    mount_nullfs /mnt/Personal/Music /mnt/user/Music

    This basically duplicates the filesystem, any changes made to the dupe will affect the original, so be very careful with your user privilages.

    To undo this “link” you can simple umount the dupe

    umount /mnt/user/Music

    I do not currently know of any ill side effects to this, but I would appreciate any feedback from the guru’s out there.

    I do have to run these commands every-time the system starts – this is a real drawback – I would love to use symbolic links, but have not been able to work it out.

    Subscribe to:

    Labels

    Blog Archive

    Links

    Leave a Reply

    Your email address will not be published.