NAS Tossing Note 1: From OpenWrt to Unraid

AI generated summary

This article is about the author’s experience with home NAS. The author first shared the problems he encountered when using the Ficom N1 box as a media server, and then introduced his thinking process when choosing to upgrade the equipment, and finally chose the finished N100 host assembled in a small workshop. He introduced the configuration and installation process of the N100 host in detail, and explained why the Unraid system was chosen as the underlying system. The author also mentioned some shortcomings of the Unraid system, such as slow installation of plug-ins and Docker containers, and troublesome network settings for virtual machines.

A further introduction to home NAS.

Foreword

Continuing from the above, after moving out of the Tianma Student Apartment, I purchased the Ficom N1 box, Thunderbird TV, AppleTV and Swans M200 as audio and video systems. However, after using it for about 5 months, I still have a lot of dissatisfaction. It may be time to upgrade during Double Eleven.

Image

Openwrt

Let’s first talk about the shortcomings of the previous plan. The first is the 2G + 8G configuration of the N1 box itself. I don’t know if it is too reluctant to run Docker. I encountered quite a few bugs during actual use. Including but not limited to – waking up to find the Docker container, the image has been cleared (the actual Docker root directory has been tampered with by a mysterious force), any changes to services or settings after running for a few days will directly crash, as a castrated version of Linux Openwrt does not support many common commands, Docker containers are intermittently disconnected from the network, etc. There is also a rather strange phenomenon. Every time the system is restarted, the system disk is mounted as zero read-only, so mount -o remount,rw / must be manually executed every time.

Although letting a soft routing system serve as a NAS was a bit overwhelming, it was still too much to run on a hundred-dollar N1 box, so I finally decided to give up on it and look up.

Image

alist

The second is the issue of resource storage. My previous storage solution was: local 1t solid state drive + Alibaba Cloud*3 + Quark*2. I also encountered many problems during use. The local 1t small space is destined to only be used to store a small amount of precious movies and other types of files. Therefore, the main resources are Alibaba Cloud and Quark. Alibaba Cloud does not support offline downloads. All resources must be obtained from others, and Blu-ray original disc resources are almost No (mostly Remux); as for Quark, the offline function is limited to the latest and popular magnets. The most disgusting thing is that after turning on SVIP, the speed is still limited intermittently, which leads to frequent encounters where you want to watch movies but are speed-limited. Half of the time buffering has begun, and officials have even begun to cut self-funded SVIP and 88VIP. As Alibaba-based software, the appearance of these two cloud disks is also quite ugly. Regardless of the instant seal for sharing some resources, even the files saved in the user’s own cloud disk may suddenly evaporate.

In addition, even if Alibaba Cloud and Quark activate SVIP, the upper limit of capacity is limited to 6-8t, which is far from enough to store the original disk. The current multi-account solution only treats the symptoms but not the root cause. Continuously adding accounts will make file management more and more complicated. The more confusion there is.

The last little need is Home Assistant. There are more and more smart devices in the home, and the Mijia APP becomes more and more uncomfortable the more I use it. The need for HA emerged. Previously, N1 had installed the OP system and could no longer deal with HA, so it had to consider upgrading.

Hardware

Selection of equipment

After considering upgrading the N1 box, it became a difficult question which device to replace next. After several days of research, the general options are as follows:

  • Synology DS224+

  • QNAP TS-464C

  • Extreme space Z2PRO

  • Folk expert QNAS 4

  • Finished mini host: Intel mini PC, Lingqi, Changwang, etc.

  • Tattered King Star Snail

Prices are sorted in descending order, ranging from 400-2400. The advantages and disadvantages of each are summarized as follows:

  • Synology/QNAP has a professional system, strong stability, and great after-sales service, but it is high-priced and low-spec, giving it an Apple-like beauty.

  • Domestic Extreme Space systems are easy to use, cost-effective, and good-looking. However, they retain the consistent style of domestically produced privacy theft and may go bankrupt in recent years, making NAS useless.

  • QNAS: It is a great test of hands-on ability and can make the most cost-effective small console, but the stability of purchasing parts and assembling it by yourself is worrying.

  • Finished mini host: The price/performance ratio is higher than that of finished NAS, but its usage is closer to All in One. There is no hard disk cabinet that comes standard with NAS, so most people will not consider it when buying NAS.

  • Interstellar Snail: Needless to say, with the cooperation of Hei Qunhui, NAS has been able to enter thousands of households. No matter how ugly, noisy or bulky, it is not a disadvantage at the price of 400 yuan.

After comprehensively considering my own conditions: a hard-working student with an empty wallet, mobile needs due to an unstable residence, data security and transmission efficiency that do not require too much expertise, etc., I finally chose the finished N100 small host assembled in a small workshop. .

The starting price of this Zhongbai N100 host is around 450, which is a real price butcher. The price of Synology with the same level of CPU is four or five times higher. Other advantages include: the mini host can be put directly into the pocket when moving. Compared with the finished NAS, the memory module and SSD can be freely expanded. As for the problem of hard drive cabinets, I currently cannot use large-capacity mechanical hard drives (simply because my wallet does not support it. According to the price conversion of 1t/100, I need to save about 20 to 30t of my existing resources, plus data redundancy) Yu, it can be said that it is a gold bar directly), and the final option is still to mount the network disk. Although it cannot achieve the privacy of resources and the transmission rate of the intranet level, it is also a very cost-effective transition solution.

Image

Mini host

Out of the box, the accessories include a 12V*3A power supply and an HDMI cable, as well as a 2.5-inch hard drive mounting bracket. After adding the memory module and hard drive, the configuration is as follows:

  • CPU: Intel? N100 @ 2871 MHz

  • Memory: Samsung ddr4 2666 8G

  • Hard drive: Goodega 1t SSD

  • Interface: USB3.2*4, USB2.0*1, Gigabit single network port, HDMI/DP.

Looking at it this way, the beggar’s version still has its reasons. The interface is indeed somewhat “streamlined”. A single network port is destined to not be used for simple soft routing. The Gigabit transmission rate also limits the bandwidth limit. The C port is brutally castrated. In addition, it is very The pitfall is that the N100 does not support dual-channel memory. Of course, this is Intel’s trick.

Image

Nude photo*1

Unscrew the four screws on the bottom to easily access the inside of the machine. It can be seen that its internal structure is relatively loose, the workmanship is average, and it has a “small factory style”. It is really difficult to complain about this shit-yellow battery. However, the official gift is a 2.5-inch hard drive mounting bracket. If necessary, a SATA solid state can be added later, which is quite conscientious.

Image

Internet speed test

Use the TV-end infuse to conduct network tests (both APPLE TV and the host computer are connected to the router through network cables). The network speed basically reaches Gigabit, and four people in the local area network can watch the Blu-ray original disc at the same time without lag.

Software

Unraid system

Image

Install the memory and hard disk, write Unraid to the USB flash drive and connect it, then just connect the keyboard and press F7 to enter Bios, and finally choose to boot from the USB flash drive. The Unraid system is installed and the whole process is as smooth as silk. (Currently, I am using the Unraid happy version, and I will switch to regular version depending on the actual use experience. After all, the price of 60 dollars is really unaffordable). As for why you chose Unraid?

  • Windows: I bought this thing just to get rid of windows, so naturally it is impossible to install it.

  • iStoreOS: I heard that it is just an OP system plus an app store, which seems to be overkill.

  • Heiqunhui: The original intention of choosing this type of product is to install Heiqun, but Heiqun does not support N100.

  • TrueNas: Mainly focuses on ZFS storage system, the page is beautiful, but the support for virtual machines and docker is not very good.

  • OMV: It looks similar to Unraid, but the interface is too ugly.

In the end, the main reason for choosing Unraid is its good virtual machine/docker support. Unraid is also the only system other than Black Group that has an application store, which will make future troubles easier. As for Unraid’s criticized read and write speed and zfs, personal demand is not very big. The most important reason is that Unraid can be used as the underlying system. If you want to install TrueNas or OMV later, you can do it through a virtual machine.

Image

Disk management

As the most important thing about nas system is the disk management method, Unraid is just like its name. Although I don’t use it for the time being, I still like this mapping strategy. Unraid places the hard disks mainly used for storage in the array device, and the others include verification disks and cache disks. If you want to add a hard disk later, you only need to simply assign it to the array and restart the device. If the hard disk is damaged, you can also insert a new hard disk and then try again. Restore data based on the education disk. Because my main storage method is a network disk, I have not added a verification disk.

In the sharing option, Unraid establishes an index of the disk in the unit of User, which is very convenient for the management of multiple disks. All files in the disk are mapped in the user folder, and any storage-related operations can be performed through User shared folder is equivalent to using multiple hard drives directly as one.

Image

CA store

It is actually not very rigorous to say that Unraid has an app store. After all, its merchant is called Community Applications, which is a real private store. The store is divided into plug-ins and docker containers. All plug-ins have been blocked, and all errors will be reported when installed directly; the Docker container’s approximately 18m image can be pulled for about an hour (mobile 300M broadband). Unraid does not have VPN-related plug-ins, which means that the fucked-up network can only be solved through soft routing (what kind of AIO is it if it relies on soft routing?)

I have to say that in this fucked-up Internet environment in China, 80% of the time spent on the Internet is spent on the Internet. The installation plug-in can be installed manually. For Docker, you can change the image source. However, the image source often has bugs such as unable to find the image, and the speed improvement is limited. The most troublesome thing is the virtual machine. During the process of installing the virtual machine, if commands such as “clone from GitHub” or “pull image from Dockerhub” appear, the system will directly fail to install, and the virtual machine usually passes through the physical network card. To obtain an independent IP, the network environment is naturally different from that of Unraid. When installing the virtual machine, because the gateway cannot be set, the OP system that used the N1 box as a bypass router cannot be used as a proxy, so we have to find a new solution. . .

The Unraid system itself does not have any functions except the basic disk array and virtual machine/Docker, such as file management, file synchronization, intranet penetration, photo album, media server, etc. These easy-to-implement functions of Synology suites all rely on docker images contributed by the open source community, but as a paid closed-source system, the functions are really too few. For docker, although the CA store provides configuration templates, the installation method of Synology Suite is like a mobile application market. The plug-in is still not small. I think that since it is an application market for unraid systems, many Docker paths, networks, and devices Mapping can be configured in advance. For example, media files are mapped to /mnt/user/media, and the device automatically searches and fills in the path, instead of requiring the user to manually configure it every time. Moreover, the domestic network environment has extremely high requirements on users’ hands-on ability, and the actual experience is worrying. All in all, if you are serious about playing NAS, you should buy Synology.

Backup

Since Unraid does not have the powerful file snapshot function of ZFS, and the system runs on a USB flash drive, regular backup is very important.

Image

User script

The solution I chose is rclone? A simple Shell script. Because I am using the Kaixin version of the system, the official Unraid server cannot be used, and the apps like Appdatabackup and luckybackup in the application market feel a bit bulky, and I hope it should be compressed before backup. Then transfer, so I chose to write one myself~

#!/bin/bash

TIMESTAMP=$(date + %Y%m%d-%H%M%S)
# Define the name of the compressed file, including timestamp
BACKUP_FILE="/mnt/user/backup/appdata-$TIMESTAMP.tar.gz"
tar -czvf "$BACKUP_FILE" /mnt/user/appdata

if [ $? -eq 0 ]; then
    rclone copy "$BACKUP_FILE" alist:backup
    if [ $? -eq 0 ]; then
        rm -f "$BACKUP_FILE"
    else
        echo "rclone failed to copy the file."
        exit 1
    fi
else
    echo "tar failed to create the backup file."
    exit 1
fi

ShellScript

The idea is to regularly package the file /boot in the USB flash drive and the configuration mapping path Appdata of the Docker application through the cron plug-in, and then use the rclone command to upload the compressed file to remote storage.

Time Machine Backup

Image

Shared hard drive

After using nas, Mac’s time machine can also be better utilized. You only need to create a world machine shared folder, and then this folder will automatically appear in the Mac’s Finder, which can realize automatic backup when connected to the LAN. Finally No need for an external hard drive.

Media Server

Image

For the time being, the media server uses Alist (although it is not a media server) + rclone. Alist mounts the network disk as webdav, and rclone mounts webdav as a local disk.

Image

115

After experiencing Alibaba Cloud and Quark for half a year, I purchased another 115 membership for 500 yuan/8 years, hoping that the experience would be improved.

After mounting 115 through alist, the conclusion is as follows: In terms of the degree of harmony, it is much better than Alibaba Cloud and Quark, and there will basically be no harmonious network disk resources. After all, this is also a feature of 115?; In terms of resources, 115 mainly uses magnetic links to download , and the sharing function is almost unavailable. The speed of magnetic force may be one of the best in China for old resources, but it is slower than Quark for new resources. It is speculated that this is the reason for the gradual loss of users; in terms of download speed, it is between Alibaba Cloud and Between Quark, Alibaba Cloud does not limit the speed during the whole time, and almost slows down the bandwidth. Quark must limit the speed every night, and the speed is about 1m/s. However, after several days of actual testing, the speed of 115 starts to limit after about 8 o’clock every night. About 5m/s. Generally speaking, it is still far behind the local hard disk. The original movie is unwatchable at night. I have to lament that there are no discordant and unrestricted network disks in China.

The biggest advantage of 115 is the network disk capacity. If you pay 500 yuan for 8 years, you will get 8T, which is a bargain price. As long as you don’t run away later, if the space is not enough, you can expand it at will with the price of 25r/5t on a certain treasure, so you basically don’t have to worry about running out of space. In order to make better use of it, you can also use the network disk space as your own cloudreve space and give up expensive oss.

nohup rclone mount alist:115 /mnt/user/embydata/movies --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty & amp;

ShellScript

Although a folder was created for emby in the path, emby was not used in the end because the metadata search was too slow. With a very powerful client (infuse), the video metadata does not need to be served. Scrape the ends. As for other media servers, plex, jellyfin, etc. are not within the scope of my consideration, because they cannot recognize Blu-ray original discs, and I personally have a habit of viewing original discs. It is better to still use alist and leave everything else to infuse.

Intranet penetration

Since it is used as a NAS, intranet penetration is still an essential requirement. Unlike the “one-click penetration” that comes with finished NAS, Unraid requires users to configure it themselves.

Image

cloudflare

The solution I chose is Cloudflare tunnels, and it is the universal cloudflare. Part of the reason is that I personally don’t like zerotier’s method of establishing a virtual LAN by “punching holes”. It requires the client to also install the app and connect to the VPN, which is troublesome and cannot be shared with friends; secondly, of course, the fool-like deployment method of CF .

To use Cloudflare tunnels, you need to apply for the zerotrust service. The prerequisites are a foreign currency credit card and a domain name. It just so happened that I applied for the ICBC Constellation Visa card some time ago and used it to successfully obtain zerotrust. The domain name was the second-level domain name of hiripple.com.

The method to install the tunnels service on Unraid is also very simple. Create new tunnels in cloudflare, directly copy the official Docker cli and run it in the Unraid terminal. Refresh the interface and you will see that the tunnels are connected. After that, mapping the IP and port of the intranet device is as follows It’s as easy as adding DNS records. What’s even more amazing is that the domain name reverse proxy in this way comes with its own SSL certificate, truly achieving one-click intranet penetration.

Image

Download speed measured

The download speed measured using alist is about 1m/s to 2m/s, which is barely enough. The CF network is relatively unstable in China, sometimes fast and sometimes slow. After all, there are too many people using it. It is worth mentioning that when using CF tunnels, remember to turn off rocket-loader (if it was turned on before).

Soft routing/other Docker applications

Since it is an AIO server, soft routing must also be arranged~

Image

Openwrt

Unraid has good hardware pass-through performance, so you only need to create an Openwrt virtual machine. For the virtual machine, you do not need functions such as Alist, Aria2, and docker suites. You only need to retain the most basic scientific Internet tools, so the initial memory and CPU are only Just the minimum configuration is required. Finally, use the website: https://openwrt.ai to easily configure the image you need.

Because this host has a single network port, my solution is still used as a soft router, especially for some devices that are not convenient for traveling abroad, such as Appletv, Quest2, etc. Other Dockers include Nextcloud, Aria2, Alist, qinglong, koishi, etc. It is not too stressful for this small host to run more than a dozen at the same time.

At this point, the first round of tossing is over.

Image

The power of three phases

Image

This content is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license.