I followed the instructions below here, in order to use the RPI as a NAS with a RAID-1 array with two mirroring 2.0 TB Harddisk drives (the abbreviation for these is: HDDs, they can be seen in the photo). Samba is a service which makes the NAS accessible to Windows computers on the same sub net mask. The IP address and RPI credentials are used to access the NAS from a Windows computer. Also install CX File Explorer on your phone and then the NAS is accessible on you Android smartphone, a very cool feature.
I then simply used that same RPI which acts as the NAS, to also run the Plex server which is accessible behind the NAT by typing the IP address and port number which defaults to 32400. The Plex server is accessible with any webbrowser by any device on the same subnet as the Plex server. You can also set-up Plex server to port forward and thus serve you anywhere in the world using your login credentials. I have a double NAT, which means two routers between the RPI and the Internet Service Provider (ISP), so that is a tricky proposition to get external access for me. It can be done but one has to bridge the first router through to the second one, which I don’t want to do.
In the above photo you will see a powered hub and a RPI. The RPI gets its power from the battery bank and I will make a connection for the powered USB hub also to take its power therefrom so that it acts as a UPS, in the future.
Plex server instructions are summarised below:
Plex Install: https://pimylifeup.com/raspberry-pi-plex-server/
Set a Static IP for the RPI: https://thepihut.com/blogs/raspberry-pi-tutorials/how-to-give-your-raspberry-pi-a-static-ip-address-update
Install a Torrent Web App called Deluge: https://pimylifeup.com/raspberry-pi-deluge/
You also need to type in the following command:
sudo chmod -r 755 “your USB HARD DRIVE Path ie: /sda/pi”
This is required or the
Plex server won’t be able to read you usb drive.
If you don’t have a UPS and have a power failure and the RPI cannot see the RAID-1 array follow these instructions:
One of my drives failed and in the process of setting up a new one that I bought, which was smaller than the functioning 2.0TB HDD, I realized this cannot be done unless the sdb drive which only had one massive partition called sdb1 needs to subdivided with one partition exactly the same as the new 1.0TB HDD that I bought.
This is problematical as all the data on the Raid-1 array has to be copied into another drive, the sdb drive partioned and reformatted. The easiest way for me was simply to use the Diskmgt.msc function from Windows. The raid-1 array has to be stopped using the mdadm utility. Don’t reboot the RPI as this will cause a major lockout and disk fault. I did exactly that and then had to use the new rpi imager to reimage the RPI’s SD card and rerun through all these steps again. Oh mercy, that was a painful lesson.