Overview
This document provides a detailed description of how to use the Cloud File Storage (CFS) system on a Windows client. This guide uses Windows Server 2012 R2 as an example. The operating methods of other versions of operating systems, such as Windows Server 2008 and Windows Server 2016, are the same.
Operation Steps
Step 1: Create File System and Mount Point
Step 2: Connect to Instance
2. Verify network communication.
Before mounting, need to confirm network reachability between the client and the file system (need to enable Telnet service on Windows client). Can verify by telnet command (for example, telnet 192.168.1.1 445). The following is open port information required for each protocol and client:
|
NFS 3.0 | 111,892,2049 | telnet 111, 892 and 2049 |
CIFS/SMB | 445 | telnet 445 |
Note:
Windows does not support mounting with NFSV4 currently.
If the network is unreachable, it is suggested to check whether the security group of the CVM allows access. If communication is still unable, submit a ticket to contact us. Step 3: Mounting File System
Note:
It is recommended to use SMB to mount CFS.
Mounting CIFS/SMB File System
There are two ways to mount the CIFS/SMB file system: through the command line and through the graphical interface.
Mount file system via command line
Use FSID to mount the file system. The mounting command is as follows:
net use <shared directory name>: \\\\<mount point IP>\\FSID
Example:
net use X: \\\\10.10.11.12\\fjie120
Mount file system via graphical interface
1. Click to enter the start menu interface. 2. If you are using windows 10 or windows Server 2019 and higher versions of the operating system, it is required to modify the registry to allow Guest access to SMB.
If not modified, it will have the following error prompt:
Note:
Microsoft officially explains the changes related to this permission as follows:
Run the following instruction via CMD with the administrator command:
reg add "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 1 /f && net stop lanmanworkstation /y && net start lanmanworkstation && net start SessionEnv
3. Right-click on This PC and select Map network drive.
4. In the pop-up window, set the "Drive" letter name and folder (i.e., the mount directory seen in the CIFS/SMB file system), and click Finish.
5. Enter the mounted file system and right-click to create a new file to verify the correctness of reading and writing.
Mounting NFS File System
1. Enable NFS service
Note:
Before mounting, ensure the system has started the NFS service.
1.1 click , select Control Panel > Programs > Enable or Disable Windows Features. 1.2 In the opened Add Role and Features Wizard window, keep the default configuration and click Next for 5 times continuously.
1.3 In the Features interface, select Client for NFS, then click Next.
1.4 Click Install.
1.5 Restart the CVM to finish enabling the Windows NFS Client Service.
Note:
Windows Home version does not include an NFS client option, use the Windows Server operating system or Windows Professional version.
2. Verify whether the NFS service is started.
2.1 Open the CMD Tencent Cloud Command Line Interface and run the following command:
2.2 If NFS-related information is returned, it indicates that the NFS client is operating normally.
3. Add anonymous access users and user groups
3.1 Run the CMD command tool as an administrator, execute the following instructions to modify the registry, allow anonymous user/user group access, and set Mount's Lock parameter to No (Windows only supports NFS V3.0, which does not support file lock service)
reg add "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default" /v AnonymousUid /t REG_QWORD /d 0 /f && reg add "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\Default" /v AnonymousGid /t REG_QWORD /d 0 /f && reg add "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ClientForNFS\\CurrentVersion\\User\\Default\\Mount" /v Locking /t REG_DWORD /d 0 /f
3.2 Run the following command to restart the NFS client service, so that the modified registry takes effect. Or restart the Windows system to make the modified registry take effect.
net stop nfsclnt && net stop nfsrdr && net start nfsrdr && net start nfsclnt
4. Mounting NFS File System
Mount file system via command line
In the CMD Tencent Cloud Command Line Interface, enter the following command to mount the file system. Among them, the default subdirectory of the system is FSID.
mount -o nolock mtype=hard <mount point IP>:/<FSID> <shared directory name>:
Example
mount -o nolock mtype=hard 10.10.0.12:/z3r6k95r X:
Note:
FSID mount command can be obtained from file storage console > file system details > mount point information.
Step 4: Uninstalling File System
Uninstall shared directory via CMD command
To uninstall the shared directory in some cases, open the command line terminal and run the following command. "Directory Name" is the full path of the root directory or the file system.
Example of NFS:
Example of SMB:
Uninstall shared directory via graphical interface
To disconnect the mounted file system, right-click the disk and click Disconnect in the menu that appears. Just do this to disconnect the file system.
Step 5: Terminate Resource
Note:
After the file system is deleted, the resources cannot be recovered. It is recommended that you back up the resources before deleting the file system.
You can terminate a file system from the Tencent Cloud console. Enter the Tencent Cloud CFS Console, select the file system to be terminated, click Delete and Confirm to delete the file system.