Huawei Drive
At a glance
Section titled “At a glance”| Capability | Support |
|---|---|
| rclone support tier | Tier 3: Supported |
| Checksums | SHA-256 |
| Modification times | Not kept: files show their upload time |
| Case-insensitive names | No |
| Duplicate names allowed | No |
| Server-side copy | Yes |
| Server-side move and rename | Yes |
| Folder move and rename | Yes, in one step |
| Free space reporting | Yes |
| Empty folders | Yes |
| Change notifications | Yes |
| Uploads of unknown size | No |
| Public links | No |
Setup notes
Section titled “Setup notes”In CloudMount you add this drive from the Add drive screen, and the wizard asks for the options listed under Options. The notes below come from rclone’s setup guide.
Getting your own Client ID and Secret
Section titled “Getting your own Client ID and Secret”When you use rclone with Huawei Drive in its default configuration you are using rclone’s client_id. This is shared between all the rclone users. There is a global rate limit on the number of queries per second that each client_id can do set by Huawei.
It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use a separate client ID for each service to avoid rate limiting issues.
Here is how to create your own Huawei Drive client ID for rclone:
Follow the detailed guides for complete setup instructions:
Rclone uses the web application access method to connect to Huawei Drive. Before starting, you need to implement quick login authorization through Huawei Account Open Service. With user authorization credentials, rclone can call Huawei Cloud Drive Service APIs.
Create Server Application
Section titled “Create Server Application”Before accessing Drive service, developers need to create a server application first. For details, please refer to the WEB Application Access Development Preparation section in the “Huawei Account Service Development Guide”.
Enable Drive Application Switch
Section titled “Enable Drive Application Switch”- Log in to AppGallery Connect with your Huawei account.
- Create a project or select an existing project.
- Add a web application to the project.
- Open “Project settings” for the application and copy the OAuth 2.0 Client ID and Client Secret from the “General” tab.
- Open “API Management” for the project and enable “Cloud Drive”.
- Add
http://127.0.0.1:53682/as a redirect URI for the OAuth 2.0 Client ID.
The older Huawei Developer Console may show some of the same credential information, but AppGallery Connect is the place to create the project, application, API permission, and redirect URI used by rclone.
Sign Huawei Cloud Drive Privacy Notice and User Agreement
Section titled “Sign Huawei Cloud Drive Privacy Notice and User Agreement”Guide users to visit https://cloud.huawei.com/. First-time users need to sign the agreement before they can use Huawei Cloud Drive Service.
Application Access to Obtain Authentication Credential Access Token
Section titled “Application Access to Obtain Authentication Credential Access Token”Applications accessing Drive should use authentication credential Access Token. For specific acquisition methods, please refer to the WEB Application Access Development Guide section in the “Huawei Account Service Development Guide”.
Key steps summary:
- Create or select a project in AppGallery Connect.
- Add a web application to the project.
- Enable Cloud Drive in API Management.
- Configure
http://127.0.0.1:53682/as the OAuth redirect URI. - Copy the OAuth 2.0 Client ID and Client Secret from the application.
- Provide the client ID and client secret to rclone during configuration.
Scopes
Section titled “Scopes”Rclone uses the following OAuth2 scopes when accessing Huawei Drive:
https://www.huawei.com/auth/drive- Full access to Huawei Drive files (excluding application data folder)https://www.huawei.com/auth/drive.file- Access to files created by the applicationopenid- OpenID Connect authenticationprofile- Access to basic profile information
The drive.file scope is included in the default set used by rclone.
Alternative scopes available (not used by rclone by default):
https://www.huawei.com/auth/drive.appdata- Access to application data folderhttps://www.huawei.com/auth/drive.readonly- Read-only access to file metadata and contenthttps://www.huawei.com/auth/drive.metadata- Read/write access to file metadata onlyhttps://www.huawei.com/auth/drive.metadata.readonly- Read-only access to file metadata only
The default scopes provide read/write access to all files in your Huawei Drive.
Modification times and hashes
Section titled “Modification times and hashes”Huawei Drive does not support setting modification times. The API
always uses server-side timestamps, so file modification times from
the source are not preserved during upload. Modification times are
available as read-only metadata (mtime, btime).
Hash algorithm SHA256 is supported for file integrity verification.
Restricted filename characters
Section titled “Restricted filename characters”Huawei Drive has strict restrictions on file and directory names:
- Cannot contain:
< > | : " * ? / \or emoji characters - Cannot be exactly
. .. - Maximum length: 250 bytes
- Single quotes must be escaped with
\'in API calls
These restrictions are handled by rclone’s encoding:
- Backslashes
\are encoded - Invalid UTF-8 sequences are encoded
- Right-side spaces are encoded
Invalid characters will be replaced according to the encoding settings.
Resumable uploads
Section titled “Resumable uploads”Huawei Drive supports resumable uploads for files larger than the upload cutoff (default 20MB). Files are uploaded in chunks which allows for recovery from network interruptions.
File size limits
Section titled “File size limits”The maximum file size for Huawei Drive is 50 GiB.
Quota information
Section titled “Quota information”To view your current quota you can use the rclone about remote:
command which will display your usage and quota information.
Options
Section titled “Options”Standard options
Section titled “Standard options”The wizard asks for these when you add the drive.
client_id
Section titled “client_id”OAuth Client Id.
Leave blank normally.
Type: string
client_secret
Section titled “client_secret”OAuth Client Secret.
Leave blank normally.
Type: string
Advanced options
Section titled “Advanced options”The wizard shows these under Advanced options. Most drives work without changing any of them.
OAuth Access Token as a JSON blob.
Type: string
auth_url
Section titled “auth_url”Auth server URL.
Leave blank to use the provider defaults.
Type: string
token_url
Section titled “token_url”Token server url.
Leave blank to use the provider defaults.
Type: string
client_credentials
Section titled “client_credentials”Use client credentials OAuth flow.
This will use the OAUTH2 client Credentials Flow as described in RFC 6749.
Note that this option is NOT supported by all backends.
Type: bool · Default: false
root_folder_id
Section titled “root_folder_id”ID of the root folder.
Normally this is auto-detected, but if it fails or you want to speed up startup, you can set it manually.
Leave blank normally.
Type: string
chunk_size
Section titled “chunk_size”Upload chunk size.
Must be a power of 2 >= 256k and <= 64MB.
Type: SizeSuffix · Default: 8Mi
list_chunk
Section titled “list_chunk”Size of listing chunk 1-1000.
Type: int · Default: 1000
upload_cutoff
Section titled “upload_cutoff”Cutoff for switching to resumable upload.
Any files larger than this will be uploaded using resumable upload. The minimum is 0 and the maximum is 20 MiB (Huawei Drive API limit for single request uploads).
Type: SizeSuffix · Default: 20Mi
encoding
Section titled “encoding”The encoding for the backend.
See the encoding section in the overview for more info.
Type: Encoding · Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftPeriod,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot
description
Section titled “description”Description of the remote.
Type: string
Limitations
Section titled “Limitations”Huawei Drive has some rate limiting which may cause rclone to slow down transfers to avoid hitting the limits.
File name restrictions
Section titled “File name restrictions”- File names cannot contain:
< > | : " * ? / \ - File names cannot be exactly
. .. - Maximum file name length is 250 bytes
- Some unicode characters including emojis are not supported
API rate limits
Section titled “API rate limits”Huawei Drive imposes API rate limits. Rclone automatically handles these by backing off when limits are hit.
OAuth2 token expiry
Section titled “OAuth2 token expiry”- Access tokens expire after 1 hour
- Refresh tokens expire after 180 days
- Rclone will automatically refresh tokens as needed
File size limits
Section titled “File size limits”- Maximum file size is 50 GiB
- Files larger than this cannot be uploaded
Upload behavior
Section titled “Upload behavior”- Files smaller than
upload_cutoff(default 20MB) are uploaded in a single request using content or multipart method - Larger files are uploaded using resumable uploads with configurable chunk size
- Maximum single chunk size for resumable uploads is 64MB
- Resumable uploads support automatic retry on network errors
- SHA256 hash verification is supported for uploaded files
Server-side operations
Section titled “Server-side operations”- Server-side copy: Files can be copied within Huawei Drive without downloading and re-uploading
- Server-side move: Files and directories can be moved/renamed on the server side
- Directory move: Entire directories can be moved with a single API call
Directory operations
Section titled “Directory operations”- Huawei Drive supports creating empty directories
- Recursive listing is supported via
--fast-listfor efficient directory traversal - Huawei Drive has a special “applicationData” folder for app-specific data (not accessible via rclone’s default configuration)
Error handling
Section titled “Error handling”Common errors and their meanings:
401 Unauthorized: Invalid credentials or expired token403 Forbidden: Usually indicates insufficient permissions or API quota exceeded404 Not Found: File or directory does not exist409 Conflict: Directory already exists429 Too Many Requests: API rate limit exceeded, rclone will automatically retry
Performance tuning
Section titled “Performance tuning”For better performance:
- Increase
--transfersfor concurrent operations (default is 4) - Adjust
chunk_sizebased on your network speed and file sizes - Use
--fast-listfor operations on directories with many files to reduce API calls
Making backups
Section titled “Making backups”Huawei Drive is suitable for backups with some considerations:
- Use
rclone syncrather thanrclone copyto maintain exact directory structure - Consider using
--backup-dirto preserve deleted files - Verify transfers with
--checksumflag for critical data - Be aware of the 50 GiB file size limit for individual files
Supported features
Section titled “Supported features”Huawei Drive supports the following rclone features:
Copy- Server-side copy of filesMove- Server-side move/rename of filesDirMove- Server-side move of directoriesListR- Recursive listing for--fast-listAbout- Storage quota informationPurge- Delete directory and all contentsCleanUp- Empty the trashUserInfo- Get user account informationMetadata- Read and write file metadata/propertiesChangeNotify- Poll for remote changes (used byrclone mountandrclone rc vfs/poll-interval)
Integration with other services
Section titled “Integration with other services”Huawei Drive can be used as a backend for various rclone operations:
- Mount as a local filesystem using
rclone mount - Serve over HTTP using
rclone serve http - Serve over FTP using
rclone serve ftp - Serve over WebDAV using
rclone serve webdav
Note that some operations may be slower than local storage due to API limitations and network latency.