Advertisement
Lazur

SMB/CIFS & RAR2FS in Autofs on Ubuntu Server 14.04 & 16.04

Dec 15th, 2014
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.56 KB | None | 0 0
  1. # Last Update: 2016.09.08
  2.  
  3. # NOTE: Replace rootuser with the actual username
  4.  
  5. # Install rar2fs
  6. wget https://gist.githubusercontent.com/lazuratus/1b7e8196a554aeedfc56/raw/7ef9349f063b1e8a7da41a0292fdb2b5eeec273c/install_rar2fs.sh
  7. chmod +x install_rar2fs.sh
  8. sudo ./install_rar2fs.sh
  9.  
  10. # Install Autofs & CIFS
  11. sudo apt-get -qy install autofs cifs-utils
  12.  
  13. # Create credentials for each device in /home/rootuser/.smb_<hostname>
  14. # Filename examples: /home/rootuser/.smb_nas1 & /home/rootuser/.smb_nas2
  15. # Content example for: /home/rootuser/.smb_nas1
  16. username=nas1_smb_username
  17. password=nas1_smb_password
  18.  
  19. # chmod .smbcredentials
  20. sudo chmod 600 /home/rootuser/.smb_*
  21.  
  22. # /etc/auto.master
  23. /-              /etc/auto.cifs          --timeout=120 --ghost
  24. /-              /etc/auto.rar2fs        --timeout=120 --ghost
  25.  
  26. # /etc/auto.cifs
  27. /mnt/smb/nas1/movies  -fstype=cifs,ro,credentials=/home/rootuser/.smb_nas1,iocharset=utf8           ://192.168.1.110/movies
  28. /mnt/smb/nas2/movies  -fstype=cifs,ro,credentials=/home/rootuser/.smb_nas2,iocharset=utf8,sec=ntlm  ://192.168.1.115/movies
  29. # (sec=ntlm might be needed for older nas systems)
  30.  
  31. # /etc/auto.rar2fs
  32. /mnt/rar2fs/nas1/movies  -fstype=fuse,ro,allow_other,noatime,umask=222,--seek-length=2  :rar2fs#/mnt/smb/nas1/movies
  33. /mnt/rar2fs/nas2/movies  -fstype=fuse,ro,allow_other,noatime,umask=222,--seek-length=2  :rar2fs#/mnt/smb/nas2/movies
  34.  
  35. # Restart autofs service
  36. sudo service autofs restart
  37.  
  38. # Download Plex Media Server
  39. # 32-bit version (only needed for 32-bit Ubuntu Desktop)
  40. wget --content-disposition "https://plex.tv/downloads/latest/1?channel=16&build=linux-ubuntu-i686&distro=ubuntu"
  41. # 64-bit version
  42. wget --content-disposition "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu"
  43. # Or get direct link for latest version at https://www.plex.tv/downloads/
  44. # Download Plex Media Server > Download > Choose your platform > Linux > Ubuntu 64-bit (10.04 Lucid or newer)
  45. wget https://downloads.plex.tv/plex-media-server/1.1.3.2700-6f64a8d/plexmediaserver_1.1.3.2700-6f64a8d_amd64.deb
  46.  
  47. # Install Plex Media Server
  48. sudo dpkg -i plexmediaserver_1.1.3.2700-6f64a8d_amd64.deb
  49.  
  50. # If having connectivity problems with a Windows 7 share
  51. # Execute the following in Command Prompt (Administrator)
  52. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f
  53. reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "Size" /t REG_DWORD /d 3 /f
  54. # For the settings to take effect, restart the 'Server' service via services.msc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement