TOS allows you to mount a TOS bucket as a local drive on Windows. This lets you manage your buckets as if they were a local file system. This topic uses a 64-bit Windows 10 operating system to demonstrate this process.
Prerequisites
- Make sure your account has read and write permissions for the bucket to be mounted, and that you have obtained this account's access key ID and secret access key. For more information, see Access Key management.
- You have obtained the Region ID and S3 endpoint of the bucket. For more information, see Regions and endpoints.
Notes
We recommend using Rclone to mount buckets for small-scale testing or similar scenarios. However, using Rclone in a production environment is not recommended. For production environments, use S3, TOS APIs, or TOS SDKs instead.
Step 1: Install Winfsp and Rclone
- Install Winfsp as a dependency.
- Download Winfsp to your local device.
- Double click the installer, winfs-2.0.23075.msi, and follow the prompts to complete the installation.
- Download and extract Rclone to your local device. In this example, we will extract Rclone to C:\Tools. For more information, see the Rclone forum.
- Set up the environment variable path for Rclone.
- On your desktop, right click My PC and select Properties.
- At the bottom of the About page, click Advanced System Settings.
- In the System Properties dialog box, click Environment Variables.
- In the Environment Variables dialog box, under System variables, double click Path.
- In the Edit environment variable dialog box, click New and enter the local path where Rclone was extracted. In this example, the path is C:\Tools\rclone-v1.57.0-windows-amd64. Then, click OK.
- In the Environment Variables dialog box, click OK.
- Check if the Rclone installation was successful.
- On your desktop, open the search box and type cmd. Then, open the Command Prompt window.
- Run this command to verify that Rclone was installed successfully.
- If successful, the command returns output containing text similar to the following:
Step 2: Configure the connection
- In the Command Prompt window, enter rclone config and press Enter to start an interactive set-up process.
- Follow the instructions below to select the appropriate options and enter the required information.
tip
Select the options based on the text description, as the numbers of options may vary by Rclone version.
- Modify Rclone configurations.
warning
- By default, Rclone uses the path style to access object storage systems, which needs to be changed to the virtual-hosted style to access TOS.
- Rclone uses HTTP/2 by default. To access TOS, disable HTTP/2.
- Run this command to view the path of the configuration file.
- Open the configuration file and append the following to the connection configuration.
- Below is the modified configuration file.
Step 3: Mount the bucket as a local drive
- In the Command Prompt window, type this command and press Enter.
- The command returns output containing text similar to the following:
- On your desktop, double click This PC and click the drive letter set in the previous step. In this example, we will use the "F:" drive.
- If you see the bucket in the F: drive, then it has been successfully mounted as a local drive.
-
Related operations
In the Command Prompt window, press ctrl -c to unmount the bucket.
warning
Before unmounting the bucket, ensure that all operations, such as uploads, are complete.
FAQ
Q: After mounting the bucket locally and accessing the drive, I receive the error "Dir.Stat error: BadRequest". What should I do?
A: This error may be caused by an incorrect access key ID or secret access key. Verify and correct them in your rclone configuration file, then remount the bucket.