This content comes from @What's worth buyingAPP, and the views only represent the author's own |Author: Cute little cherry
Hello everyone, this is Cherry, who loves tossing, picking up garbage, playing digital, and is keen to share NAS and docker play experience~
preface
After everyone bought the NAS, they put a bunch of hard disks on the NAS, ranging from 8 or 9 TB to hundreds of TB. However, for most NAS users, these hard drives can often only be used on the NAS itself, such as downloading various favorite movies, putting some family photos, deploying some code services, and so on.
However, NAS in this mode does not really play its core role - storage. The previous storage is only its most basic local storage function, how to distribute the hard disk in the NAS to the home, mobile phone, office and other scenarios, so as not to waste the hard disk money and the safety and reliability of the Raid.
So today, we will briefly list the most commonly used file transfer protocols on NAS, and make it clear that NAS space is a local disk.
I drew a sketch to introduce several ways of storage expansion, mainly relying on the file sharing transfer protocol, which is unified into network disks, and there is a separate introduction to a list of local disks.
In NAS mounting mode, the LAN is dominated by SMB/AFP/NFS, and the Internet is dominated by webdav/FTP.
In the local storage mounting mode, iSCSI is the main mode.
The demo machine used this time is still our familiar face - QNAP TS-464C2. The main reason why Cherry likes QNAP's machines is that QNAP's operating system has the most complete visualization functions, and many functions that used to require SSH operation can now be easily completed through applications and configurations under the visual interface.
The TS-464C2 is a new device to be released by QNAP in 2023 and is also an upgraded version of the TS-464C. In terms of processor, it adopts N5095 4-core and 4-thread configuration, built-in 8G memory, supports 4 2.5/3.5-inch hard disks, and 2 M.2 nVME solid state disks, which can easily be combined for storage and achieve highly reliable storage of data.
What are the advantages and disadvantages of SMB/AFP/NFS among file transfer protocols?
In fact, the earliest difference between the three lies in the corresponding system, SMB corresponds to the windows system, AFTP corresponds to the Apple system, and NFS corresponds to the Linux system. But for now, except for windows that can't use the AFP protocol, the others can basically be used with each other.
1. The simplest transmission method - SMB opening and mounting
As a creator, SMB transmission is an indispensable tool for me, especially when testing videos and images, I need to copy QNAP's data to different device areas. QNAP NAS is the most stable one I've ever used, and it has never dropped a disk since it was set up, and the transfer speed and stability are very high.
QNAP Client: Open QNAP's Console > Network & File Services – Win/Mac/NFS/WebDAV, select the first SMB service, and select Enable Options. If both QNAP dual network cards are plugged into the switch, we can also turn on [SMB multi-channel] and use the network aggregation feature of SMB3.0 to achieve intranet broadband speed superposition, truly releasing the transmission speed of SSD hard disks.
Win: Windows opens the SMB protocol by default, we only need to enter [nas-ip or hostname] in the folder search bar. For NAS devices such as QNAP, this can also be achieved through network discovery, adding network locations, and mapping network drives.
2. Apple's special protocol - AFP is enabled and Apple mounts practice
QNAP Terminal: Open QNAP's Console - Network & File Services - Win/Mac/NFS/WebDAV and start the AFP service.
MAC: The operation mode of the three protocols on the MAC side is the same, switch the current interface to the desktop, and make sure that the toolbar is in desktop mode. Click [Go - Connect to the server], and enter the corresponding URL according to the protocol in the pop-up server address.
SMB Protocol: [smb://nas IP Address]
AFP Protocol: [afp://nas IP Address]
NFS Protocol: [nfs://nas IP Address]
3. Lightweight small files are preferred, but there are some troubles - NFS is turned on and used by wins
QNAP Terminal: Open QNAP's Console - Network & File Services - Win/Mac/NFS/WebDAV and select the first NFS service. Generally speaking, the V3 version is sufficient, and the V4 version mainly adds Kerberos authentication and stricter security authentication for data transmission.
After NFS is enabled, we also need to set permissions for the shared folder. [Console - Permissions - Shared Folder] Select the folder that you are allowed to access, and click the settings in the middle of the three icons on the right.
Change the permission category at the top to NFS host access, and then select the upper permission permission. In the whitelist at the bottom, you can configure access rights for different IP addresses and domain names, including read and write permissions.
Win: The NFS client is not installed by default under windows, we need to go to [Control Panel - Programs - Enable or Disable Windows Functions] to find the NFS service and install 2 applications.
Then the mounting method is the same as SMB, and it is also achieved by adding network locations, mapping network drives, etc. It should be noted that NFS needs to add a folder path.
How Do I Expand and Share Storage over the Internet?
The three file transfer protocols just provided do not have some specific reinforcement for security, so they are generally used in the local area network. If we need to access NAS resources on the Internet, or use the drive letter on the NAS for remote PC use, webdav and ftps are recommended.
1. The universal storage sharing method, webdav mounting
QNAP Terminal: The opening method is still the same, so I won't go into details, but enable it in [Console - Network & File Service - Win/Mac/NFS/WebDAV], it should be noted here that webdav needs to be accessed by using the login account of the QNAP NAS, so it is best to assign a dedicated account to WebDAV and set the permissions for shared folders.
Note: It is recommended not to toss WebDAV permissions and web server ports here, which are more troublesome and need to be configured separately.
Win: Although Windows can mount webdav services through the registry, many people do not know how to engage in the registry. Therefore, we still recommend the most commonly used RaiDrive as a mount client. Refer to the settings in the picture, focusing on the port, HTTPS protocol, and account password.
After completion, there will be such a network disk in our disk area, and the space display is 7.99EB, so don't worry about this.
2. The classic FTP service can also be used as a picture bed
QNAP Terminal: In the QNAP system, the FTP service is managed through the official QuFTP application, and we need to download the QuFTP application from the application center. It is worth mentioning that QuFTP is both a server and a client, and we can also mount FTP services on other devices through here.
Here we recommend turning on the FTPS service, and then the default port 21 can be modified as soon as possible.
Win: Add the network location, enter the ftp:// domain name: port mode to access QNAP's FTP server.
After logging into our account, we will be able to see all the files we have set up that we have permission to access. However, as an FTP, the advantage and disadvantage is that it does not allow direct modification of files, which is useful in some aspects, and sometimes very useless, so it is gradually eliminated.
If you want to use the FTP server as a picture bed, you can use PicGo's FTP image bed plug-in
GraphBed: If you want to use GraphBed, you need to open a web server in the QNAP console, create a virtual host, fill in the FTP port, and check the root directory of GraphBed. Then you can access it through the path of the web server.
In the URL, fill in the domain name of the feedback, the host domain name, and the port of the web server of Weicom, and the username and password are the account passwords, respectively.
Highlight! Turn QNAP storage into a local disk on your computer
All of these methods we mentioned above are just setting QNAP's storage space to the network disk on the computer, which can be used to a certain extent, but it is not feasible for the installer.
Therefore, we need to "cut out" part of the storage through the iSCSI protocol and become the local disk of the computer.
1. Create iSCSI and two types of LUNs on the QNAP NAS
When we select a storage pool, click the Create button in the upper right corner, and you can see that you can add [Block LUN].
When we select a storage volume, click the Create button in the upper right corner, and you can see that you can see that you can add a file LUN.
Both block LUNs and file LUNs need to occupy the remaining space of the storage pool/volume. In addition, after the time of creating a storage volume, you can choose thick or thin LUN space when allocating LUNs, thick represents fixed storage space, and the remaining space must not be exceeded. Thin represents how much write takes up and can exceed the remaining space.
Open the iSCSI and Fibre Channel application, and in the iSCSI Destination List, you can see all the newly created LUNs.
It is worth noting that the LUNs here are all unmapped, in order to get the LUN resources from the PC, we also need to create a new iSCSI object, click the create button, and select [New iSCSI Target], the alias here must be filled in, you can fill in your favorite.
CHAP is authentication verification, the default is none, and you can choose to enter a custom account password
Select the network we need to map to, here under the same LAN as the PC
Finally, we need to select an unmapped LUN and right-click [Edit LUN Mapping]
Change the mapping of the LUN to the new iSCCI destination
2. What is the difference between the two types of LUNs? What is VJBOD Cloud?
Directly apply the screenshot provided by the official website, it is clear that block LUNs have more functions than file LUNs, but file LUNs are the optimal solution in the case of insufficient storage pool space.
Finally, there is a cloud-based VJBOD Cloud LUN, which is a feature provided by QNAP's suite [VJBOD Cloud], which is not the same thing as [VJBOD].
VJBOD Cloud is used to mount cloud storage objects to a NAS file system and become a cloud LUN for use by a computer, or a cloud volume for NAS use. The main cloud storage includes 16 cloud disks, including Alibaba OSS, Amazon S3, Digital Ocean, Google, Huawei OBS, HKT, Oracle, IMB Cloud, and Tencent Cloud. When data is backed up to the cloud, only incremental backups are used to reduce losses. It should be noted that the use of [VJBOD Cloud] requires the purchase of a license, and 1 license is provided for free.
3. How to use iSCSI and LUN on the PC side to create a local disk?
On the PC side, search for the iSCSI program and open it
If they are under the same LAN, Windows will automatically discover the existing iSCSI targets
Of course, you can also fill in the IP address of the QNAP NAS in the target field and select Quick Connect. After the connection is complete, you can see that the target of iSCSI is connected
At this time, we need to go to [Computer Management] - [Storage] - [Disk Management] to initialize the newly generated disk and assign a drive letter.
After assigning the drive letter, we are free to use this LUN as our local disk on Windows. Including the installation package of the system, etc., can be identified to solve the problems caused by transmission protocols such as SMB.
If we create multiple iSCSI targets on the QNAP NAS and assign different LUNs, they can also be seen on the Windows side. This is equivalent to extracting multiple virtual disks from the QNAP NAS and assigning them to different LAN destinations, so that everyone can use different LUNs but save all the data in the NAS.