樹莓派|Raspberry Pi 3打造PLEX服務器

一、在樹莓派下安裝PLEX媒體服務器

1.在終端,將你的樹莓派更新至最新

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

2.重啟樹莓派

sudo reboot

3.添加https存儲庫的功能,如果你已安裝了,系統會報告“現在的版本已經是最新版”

sudo apt install apt-transport-https

4.添加Plex Media Server存儲庫

echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list

5.為存儲庫添加GPG密鑰

cd /tmp
wget https://dev2day.de/pms/dev2day-pms.gpg.key
ls (#查看是否已經下載好dev2day-pms.gpg.key文件)
sudo apt-key add dev2day-pms.gpg.key

6.回到根目錄

cd

7.更新源

sudo apt update

8.安裝Plex媒體服務器

sudo apt install plexmediaserver-installer 

樹莓派|Raspberry Pi 3打造PLEX服務器


9.創建默認配置文件,以便Plex知道要在哪個用戶下操作

sudo nano /etc/default/plexmediaserver.prev

將裡面的的

PLEX_MEDIA_SERVER_USER=plex

修改為

PLEX_MEDIA_SERVER_USER=pi

10. 重啟PLEX服務,看到如下界面說明已經安裝成功

systemctl restart plexmediaserver
systemctl status plexmediaserver
樹莓派|Raspberry Pi 3打造PLEX服務器


11.重啟樹莓派

sudo reboot

二、安裝USB外掛硬盤,實現電影資源存放

1.檢查插入的USB硬盤已安裝到哪裡

sudo cat /proc/mounts
樹莓派|Raspberry Pi 3打造PLEX服務器


2.安裝NTFS驅動器

sudo apt-get install ntfs-3g

3.查詢已插入硬盤的UUID

ls -l /dev/disk/by-uuid
樹莓派|Raspberry Pi 3打造PLEX服務器


4.現在我們創建一個新的目錄來掛載USB

sudo mkdir /media/usb1

5.接下來我們查詢硬盤的UID和GID

id -g pi
id -u pi

6.我們需要對fstab文件進行編輯。這是啟動時調用的文件,用於設置驅動器

sudo nano /etc/fstab

7.將以下代碼的UUID、UID和GID更改為你查詢到的填入

UUID=881EC0D61EC0BF06 /media/usb1 auto nofail,uid=輸入你的UID,gid=輸入你的UID,noatime 0 0
樹莓派|Raspberry Pi 3打造PLEX服務器


8.卸載之前掛載好的USB硬盤

sudo umount /dev/sda1

9.重新掛載USB硬盤

sudo mount -a

10.重啟樹莓派,完成全部安裝

sudo reboot


分享到:


相關文章: