Skip to content

Instantly share code, notes, and snippets.

@xmesaj2
Created March 24, 2023 20:41
Show Gist options
  • Save xmesaj2/0a4ecf61b0270ad16d8af44f221e8688 to your computer and use it in GitHub Desktop.
Save xmesaj2/0a4ecf61b0270ad16d8af44f221e8688 to your computer and use it in GitHub Desktop.
Plex LXC Unprivileged Debian mergerfs shared disk samba cifs snapraid AMD Vega7 iGPU
apt update && apt upgrade -y
apt install apt-transport-https curl vim wget sudo gnupg2 -y
echo "deb https://downloads.plex.tv/repo/deb public main" | tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | apt-key add -
apt update
apt install plexmediaserver
systemctl status plexmediaserver
systemctl enable plexmediaserver
apt update && apt install -y curl gpg
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/keyrings/rocm.gpg
cat <<EOF | tee /etc/apt/sources.list.d/rocm.sources
Types: deb
URIs: https://repo.radeon.com/rocm/apt/latest
Suites: ubuntu
Components: main
Signed-By: /etc/apt/keyrings/rocm.gpg
EOF
apt update && apt install -y rocm-opencl-runtime
sh -c "echo ROC_ENABLE_PRE_VEGA=1 >> /etc/profile"
apt install -y radeontop
getent group render | cut -d: -f3
getent group video | cut -d: -f3
radeontop
usermod -aG render,video root
radeontop
getent group plex | cut -d : -f3
ls -la /shared
ls -la /
usermod -u 1000 plex
groupmod -g 1000 plex
ls -la /var/lib/
chgrp -h plex /var/lib/plexmediaserver
ls -la /var/lib/
chown -h plex /var/lib/plexmediaserver
ls -la /var/lib/
systemctl restart plexmediaserver.service
systemctl status plexmediaserver.service
apt update && apt install firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all
mkdir -p /etc/apt/keyrings
apt update && apt install -y curl gpg
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/keyrings/rocm.gpg
cat <<EOF | tee /etc/apt/sources.list.d/rocm.sources
Types: deb
URIs: https://repo.radeon.com/rocm/apt/latest
Suites: ubuntu
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/rocm.gpg
EOF
apt update && apt install -y rocm-opencl-runtime
sh -c "echo ROC_ENABLE_PRE_VEGA=1 >> /etc/profile"
apt install -y radeontop
radeontop
wget https://github.com/trapexit/mergerfs/releases/download/2.34.1/mergerfs_2.34.1.debian-bullseye_amd64.deb
dpkg -i mergerfs_2.34.1.debian-bullseye_amd64.deb
vim /etc/fstab
apt install snapraid
ls /dev/disk/
ls /dev/disk/by-uuid/
vim /etc/fstab
mount -a
mkdir -p /mnt/disk0
mkdir -p /mnt/parity
mkdir -p /srv/mergerfs/pool1
mount -a
cd /srv/mergerfs/pool1/
ls
vim /etc/snapraid/snapraid.conf
cd /etc/
mkdir snapraid
cd snapraid/
vim snapraid.conf
snapraid
snapraid status
cd ..
ln -s /etc/snapraid/snapraid.conf snapraid.conf
ls
snapraid status
vim /etc/fstab
vim snapraid/snapraid.conf
snapraid sync
snapraid status
useradd shareuser
passwd shareuser
smbpasswd -a shareuser
apt install samba-common
apt install samba-common-bin
vim /etc/samba/smb.conf
apt-get install samba
systemctl restart smbd
systemctl status smbd
ip a
arch: amd64
cores: 6
features: fuse=1,keyctl=1,nesting=1
hostname: plex
memory: 3512
mp0: /srv/mergerfs/pool1/movies,mp=/shared
net0: name=eth0,bridge=vmbr0,hwaddr=12:2B:79:3C:5E:FE,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-107-disk-0,mountoptions=lazytime,size=8G
startup: order=2,up=10
swap: 2512
tags: plex
unprivileged: 1
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0 0
lxc.idmap: u 0 100000 1000
lxc.idmap: u 1000 1000 1
lxc.idmap: u 1001 101001 64535
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 45 100045 60
lxc.idmap: g 105 103 1
lxc.idmap: g 106 100106 894
lxc.idmap: g 1000 1000 1
lxc.idmap: g 1001 101001 64535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment