su -
yum install wget
wget https://downloads.plex.tv/plex-media-server/0.9.12.4.1192-9a47d21/plexmediaserver-0.9.12.4.1192-9a47d21.x86_64.rpm
yum localinstall plexmediaserver-0.9.12.4.1192-9a47d21.x86_64.rpm
service plexmediaserver start
ps -ef | grep -i plex
#
# A plex media server should now be running under the user-id "plex" eg.
#
# plex 27302 1 0 Jun25 ? 00:03:54 /usr/lib/plexmediaserver/Plex Media Server
# plex 27346 27302 0 Jun25 ? 00:01:18 /usr/lib/plexmediaserver/Plex DLNA Server
netstat -plant | grep -i LIST | grep Plex
firewall-cmd --list-all
cat > /etc/firewalld/services/plexmediaserver.xml << EOS
<?xml version="1.0" encoding="utf-8"?>
<service version="1.0">
<short>plexmediaserver</short>
<description>Plex Media Server</description>
<port port="1900" protocol="udp"/>
<port port="3005" protocol="tcp"/>
<port port="5353" protocol="udp"/>
<port port="8324" protocol="tcp"/>
<port port="32400" protocol="tcp"/>
<port port="32400" protocol="udp"/>
<port port="32410" protocol="udp"/>
<port port="32412" protocol="udp"/>
<port port="32413" protocol="udp"/>
<port port="32414" protocol="udp"/>
<port port="32469" protocol="tcp"/>
</service>
EOS
firewall-cmd --permanent --add-service=plexmediaserver
firewall-cmd --reload
firewall-cmd --list-all
wget http://localhost:32400/web/index.html
[root@localhost ~]# sestatus | grep -i mode
Current mode: enforcing
Mode from config file: enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# sestatus | grep -i mode
Current mode: permissive
Mode from config file: enforcing
[root@localhost ~]# wget http://localhost:32400/web/index.html
rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
yum install VirtualBox-4.3 binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms fuse fuse-devel fuse-libs ntfs-3g cmake boost boost-devel
cd /usr/local/src/
git clone https://github.com/Thorsten-Sick/vdfuse.git
cd vdfuse/
svn co http://www.virtualbox.org/svn/vbox/trunk/include/
sh vdbuild_new include/ vdfuse.c
# Some mount points for the images
mkdir -p /mnt/plex/vhda
mkdir -p /mnt/plex/vhda1
mkdir -p /mnt/plex/vhda2
mkdir -p /mnt/plex/vhda3
mkdir -p /mnt/plex/vhda4
mkdir -p /mnt/plex/vhdb
mkdir -p /mnt/plex/vhdb1
mkdir -p /mnt/plex/vhdb2
mv vdfuse /usr/local/sbin/
modprobe loop
# Mount the whole disk image under a raw Disk level mount point
vdfuse -r -f /nas/backups/someBackupImage.vhd /mnt/plexMounts/vhda/
# Mount as read only the individual partitions on the disk with the correct Filesystem type.
mount -t ntfs-fuse -o loop,ro,noatime /mnt/plex/vhda/Partition1 /mnt/plex/vhda1
mount -t ntfs-fuse -o loop,ro,noatime /mnt/plex/vhda/Partition2 /mnt/plex/vhda2
mount -t vfat -o loop,ro,noatime /mnt/plex/vhda/Partition3 /mnt/plex/vhda3
mount -o loop,ro,noatime /mnt/plex/vhda/Partition4 /mnt/plex/vhda4
# Mount a second disk image
vdfuse -r -f /nas/backups/someOtherBackupImage.vhd /mnt/plexMounts/vhdb/
mount -t ntfs-fuse -o loop,ro,noatime /mnt/plex/vhdb/Partition1 /mnt/plex/vhdb1
ls /mnt/plex/vhdb1
cd /usr/local/src/
git clone git://github.com/torarnv/sparsebundlefs.git
cd sparsebundlefs/
yum install fuse fuse-devel fuse-libs gcc-c++
make
# Create somewhere to mount the Time Machine backup
mkdir -p /mnt/plex/sparsea
mkdir -p /mnt/plex/sparsea1
mkdir -p /mnt/plex/tma1/
mv sparsebundlefs /usr/local/sbin/
# Add HFS+ filesystem support
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum install kmod-hfsplus
# Create the Time Machine File System (TMFS)
cd /usr/local/src/
git clone https://github.com/abique/tmfs
cd tmfs
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
DESTDIR=install-test make install
make install
modprobe loop
# Mount the whole disk image under a raw Disk level mount point
sparsebundlefs -f /nas/TimeMachine/myMacBackup.sparsebundle /mnt/plex/sparsea
# Find out which partitions, their location and size are included in the mounted Disk image
[root@localhost plex]# parted /mnt/plex/sparsea/sparsebundle.dmg unit B print
Warning: Unable to open /mnt/plex/sparsea/sparsebundle.dmg read-write (Read-only file system). /mnt/plex/sparsea/sparsebundle.dmg has been opened read-only.
Warning: Unable to open /mnt/plex/sparsea/sparsebundle.dmg read-write (Read-only file system). /mnt/plex/sparsea/sparsebundle.dmg has been opened read-only.
Model: (file)
Disk /mnt/plex/sparsea/sparsebundle.dmg: 934504050688B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 20480B 209735679B 209715200B fat32 EFI System Partition boot
2 209735680B 934369812479B 934160076800B hfsx disk image
[root@localhost plex]# losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
/dev/loop0 0 0 1 1 /mnt/plex/vhda/Partition1
# Mount the desired partition under it's own mount point.
# Note: --offset = **Start** vale above, minus the traliby B(Byte) character.
# --sizelimit = **Size** vale above, minus the traliby B(Byte) character.
[root@localhost plex]# losetup -f /mnt/plex/sparsea/sparsebundle.dmg --offset 209735680 --sizelimit 934160076800 --show
/dev/loop1
[root@localhost plex]#
mount -t hfsplus -o loop,ro /dev/loop1 /mnt/plex/sparsea1
# Mount the Time Machine contents under it's own mount point
tmfs /mnt/plex/sparsea1 /mnt/tm-root -ouid=$(id -u),gid=$(id -g),allow_other
ls /mnt/plex/tma1/*/Latest/Macintosh\ HD/
modprobe loop
mkdir -p /mnt/iso/dvd0
mkdir -p /mnt/iso/cd0
mount -t iso9660 -o loop /nas/backups/iso/some-DVD.iso /mnt/iso/dvd0
mount -t iso9660 -o loop /nas/backups/iso/some-CD.iso /mnt/iso/cd1
# Change interface: enp3s0 (per --get-active-zones) and dport 44444 to suit
firewall-cmd --add-port=44444/tcp --permanent
firewall-cmd --add-port=44444/udp --permanent
firewall-cmd --direct --add-rule ipv4 nat PREROUTING 0 --in-interface enp3s0 --protocol udp --dport 44444 --jump REDIRECT --to-ports 32400 --permanent
firewall-cmd --direct --add-rule ipv4 nat PREROUTING 0 --in-interface enp3s0 --protocol tcp --dport 44444 --jump REDIRECT --to-ports 32400 --permanent
firewall-cmd --reload
firewall-cmd --get-active-zones
firewall-cmd --direct --get-all-rules
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)