Create a share

Updated at:

This topic describes how to create a share in the Cloud Storage Gateway (CSG) console. After a share is created, you can mount the share on a local directory. This share is linked to an Object Storage Service (OSS) bucket, and any operations performed on the data within the share are applied directly to the corresponding data in the associated bucket.

Prerequisites

  • A file gateway is created and a cache is added.

  • An OSS Bucket is created.

    Important
    • A file gateway supports only OSS Buckets of the Standard, Infrequent Access (IA), and Archive storage classes. OSS Buckets with the back-to-source feature enabled are not supported.

    • Avoid connecting a gateway directly to an Archive OSS Bucket. If files will not be modified for a long time after being written, consider using a Standard or IA bucket. You can then use lifecycle rules to transition the storage class of the objects to Archive or Cold Archive. This approach is more cost-effective and efficient because it avoids unnecessary restore operations.

    • When a client writes a file to the gateway, the gateway records at least two actions: writing the file and setting the file's modification time. The gateway attempts to merge these actions, but may still initiate multiple operations on the OSS Bucket for a single file. Setting the modification time translates to modifying the object's metadata in the OSS Bucket by using the CopyObject API. For Archive or Cold Archive objects, this requires a time-consuming restore operation, which can slow down uploads and even cause write failures if the cache disk does not have enough space to upload the data in time.

Create a share

  1. On the Gateway List page, find and click the target file gateway. Then, click the Shares > Create.

  2. On the Bucket Settings page, configure the following parameters.

    Bucket settings

    Parameter

    Description

    Cross-region binding

    • Select Yes to allow the Cloud Storage Gateway to access OSS Buckets in different regions.

    • Select No to restrict the Cloud Storage Gateway to accessing only OSS Buckets in its region.

    Bucket region endpoint

    The region endpoint of the selected OSS Bucket.

    Bucket name

    Select an existing OSS Bucket or enter a subdirectory within an OSS Bucket.

    Note
    • Subdirectories can contain only letters and digits.

    • Starting from version 1.0.38, you can map the root directory of the file system to a subdirectory in an OSS Bucket for access isolation.

    • The subdirectory can be an existing directory or a new one. After the share is created, this subdirectory becomes the root directory, and all subsequent files and directories are created within it.

    • OSS Buckets with the back-to-source feature enabled are not supported.

    • Cloud Storage Gateway cannot guarantee a single write operation per file, so it does not support OSS Buckets with a compliance retention policy enabled.

    Use SSL to connect to bucket

    Selecting Yes secures the connection to the OSS Bucket with SSL.

  3. On the Basic Information page, configure the following parameters.

    Basic information

    Parameter

    Description

    Share name

    The name of the NFS or SMB share. If you select the NFS protocol, this name also serves as the virtual path for NFSv4.

    Note

    The name must start with a letter, be no more than 32 characters long, and can contain letters, digits, underscores (_), hyphens (-), and periods (.).

    Protocol

    Choose NFS or SMB.

    • NFS protocol: Suitable for accessing mounted OSS Buckets from Linux systems.

    • SMB protocol: Suitable for accessing mounted OSS Buckets from Windows systems.

    Cache

    Select the cache disk you have created.

    Note

    Cache disk space allocation rules:

    • For cache disks up to 5 TB: The system reserves 20% of the space for metadata. For example, if you create a 40 GB cache disk, the available cache space is 32 GB.

    • For cache disks larger than 5 TB: 1 TB is dedicated to metadata storage. For example, if you create a 20 TB cache disk, the available cache space is 19 TB.

    User mapping

    Configures the mapping between NFS client users and NFS server users:

    • none: NFS client users are not mapped to the nobody user on the NFS server.

    • root_squash: Restricts the root user. When an NFS client accesses as root, it is mapped to the nobody user on the NFS server.

    • all_squash: Restricts all users. All NFS client users are mapped to the nobody user on the NFS server, regardless of their original identity.

    • all_anonymous: Restricts all users. All NFS client users are mapped to the anonymous user on the NFS server, regardless of their original identity.

    Note

    This parameter can be set only when the Protocol is NFS.

    Browsable

    Allows the share to be browsable in Network Neighborhood.

    Note

    This parameter can be set only when the Protocol is SMB.

    Windows ACL

    Enables access-based enumeration (ABE) for the SMB share directory mounted on the client.

    Note
    • This parameter can be set only when the Protocol is SMB.

    • To enable Windows ACL, the gateway must first be joined to an Active Directory domain.

    Access-based enumeration

    When enabled, users can only see the files and folders they have permission to access.

    Note

    This parameter can be set only when Windows ACL is enabled.

    Add to sync group

    After adding a share to a real-time synchronization group, the system automatically disables the reverse synchronization feature for that share. Any changes to the data in the share's OSS Bucket are then automatically synchronized to the local client.

    Note
    • To use this option, you must create a sync group in advance, and the sync group's bucket must be the same as the share's bucket.

    • Currently, only standard, enhanced, and performance Cloud Storage Gateways support the real-time synchronization feature.

    • The real-time synchronization feature relies on Alibaba Cloud's Simple Message Queue (formerly MNS), so adding a share to a sync group incurs corresponding fees.

    Advanced settings

    Select Advanced Settings to display the Advanced Settings configuration page.

  4. (Optional) On the Advanced Settings page, configure the following parameters.

    Advanced settings

    Parameter

    Description

    Mode

    The working mode of the share, which includes replication mode and cache mode. Cache mode is the default when advanced settings are not enabled.

    • Replication mode: All data is stored in two copies, one in the local cache and the other in OSS.

    • Cache mode: The local cache stores all metadata and frequently accessed user data. The full dataset is stored in OSS.

    For general cloud migration or backup scenarios, cache mode is recommended.

    Transfer acceleration

    You can configure this only if Cross-region binding is enabled in the Bucket Settings. Transfer acceleration fully utilizes the gateway's public bandwidth to speed up data transfer in cross-region scenarios. Before using it, ensure you enable the transfer acceleration endpoint for the OSS Bucket.

    Directly read from OSS

    By default, when a gateway share receives a read request and the data is not in the cache, the gateway downloads the data from the OSS Bucket to the cache disk and performs some data pre-reading. However, if read requests are completely random and the cache disk is much smaller than the bucket, pre-reading and storing data in the cache may not be effective. Enable this option only in such cases.

    Upload optimization

    Enables real-time cache reclamation, suitable for pure data backup-to-cloud scenarios.

    Reverse synchronization

    Synchronizes metadata from OSS to the local gateway. This is useful for gateway disaster recovery, data restoration, and data sharing scenarios.

    Note
    • Reverse synchronization scans all objects in the bucket. If there is a large number of objects, this will incur OSS API request fees. For details on fees, see the request fees section in Object Storage Service (OSS) pricing.

    • This option is unavailable if you selected Add to Sync Group on the Basic Information page.

    Reverse synchronization interval

    If you set Reverse synchronization to Yes, you can set the Reverse synchronization interval. The minimum value is 15 seconds and the maximum is 36,000 seconds.

    Note

    If the bucket contains a large number of objects, set the reverse synchronization interval to more than 3,600 seconds to avoid high OSS API request fees from frequent scanning.

    Ignore deletes

    Prevents accidental data loss by not synchronizing file delete operations to OSS. The full dataset is retained in OSS.

    NFS v4 optimization

    Improves upload efficiency for NFSv4 mounts. After this option is enabled, mounting via NFSv3 is no longer supported.

    Note

    This parameter can be configured only if the NFS protocol is selected in the Basic Information settings.

    Sync delay

    Sets a sync delay. Files are uploaded after a delay when closed, preventing frequent local modifications from creating fragments in OSS. The default value is 5 seconds, and the maximum is 120 seconds.

    Advanced settings for replication mode

    When Mode is set to Replication Mode, you can select Advanced Settings for Replication Mode, and the Advanced Settings for Replication Mode configuration page appears.

  5. (Optional) On the Advanced Settings for Replication Mode page, configure the following parameters.

    Advanced settings for replication mode

    Parameter

    Description

    Configure replicated directories

    This setting controls the scope of data that operates in replication mode.

    • If not selected, all data runs in replication mode by default.

    • If selected, click Add Directory on the configuration page and enter the target data directory paths to specify which directories run in replication mode. Data in unspecified directories will run in cache mode.

    Note
    • When a directory is changed from cache mode to replication mode, files in that directory are synchronized only if data download is enabled. We recommend enabling data download for replication mode at the same time.

    • The specified directory path is relative to the share's root directory. For example, if the real path of the directory to be replicated is /mnt/myshare/mydir/, and /mnt/myshare is the mount point, enter /mydir/.

    Data download

    When data download is enabled, reverse synchronization or real-time synchronization can download both metadata and file data. If not enabled, only metadata is synchronized.

    Note
    • Data download requires the cache disk capacity to be at least 1.1 times the total size of the files you intend to replicate. Plan your cache disk capacity based on the expected growth of your bucket usage.

    • Enabling data download for the first time triggers a full scan, which may affect performance. Ensure the gateway is idle when you enable data download until all data is downloaded.

    • Data download supports only one-write, multiple-read scenarios. If the corresponding bucket has multiple accessors (including gateways and direct OSS access), allow only one accessor to upload files to the OSS Bucket, while others can only download. A multiple-write, multiple-read scenario may cause data loss. Use this feature with caution.

    Download speed limit

    This can be configured only when Data Download is enabled. The download speed limit must be between 0 MB/s and 1,280 MB/s. Setting it to 0 MB/s means no speed limit.

    Reverse synchronization interval

    This can be configured only when Data Download is enabled. It supports a reverse synchronization interval from 3,600 seconds to 36,000 seconds.

    Note
    • If the bucket contains a large number of objects, set the reverse synchronization interval to more than 3,600 seconds to avoid high OSS API request fees from frequent scanning.

    • Since accessing a directory is the only trigger for reverse synchronization, use real-time synchronization to ensure data from unaccessed directories and new data are downloaded promptly.

  6. Review your configuration on the summary page and click Finish.

What to do next

Access a share directory