All Products
Search
Document Center

File Storage NAS:Configure disaster recovery for General-purpose NAS

Last Updated:Jun 03, 2026

This tutorial shows how to build a cross-zone, active-standby disaster recovery solution for Alibaba Cloud General-purpose NAS within the same region by using the rsync command-line tool.

Solution overview

To protect applications from data loss during a zone-level failure or other disaster, use the rsync tool to build a cross-zone, active-standby disaster recovery solution for General-purpose NAS.

This solution includes the following infrastructure and cloud services:

  • One VPC: Creates a private network for cloud resources such as ECS instances and File Storage NAS.

  • Two vSwitches: Connect the two File Storage NAS file systems to the same network to enable communication and provide network isolation.

  • Two File Storage NAS file systems: Two NAS file systems in the same region but different zones provide high-performance, high-availability storage. If the primary file system fails, you can switch to the standby file system to ensure service continuity.

  • One ECS instance: Uses the rsync tool with a scheduled task to migrate incremental data, synchronize data between the two File Storage NAS file systems, and ensure data consistency.

Solution deployment

This tutorial uses a General-purpose NAS file system in Hong Kong Zone B of the China (Hong Kong) region as the primary system to build a disaster recovery solution. The configuration details are shown in the following table.

Parameter

Primary file system

DR file system

Region

China (Hong Kong)

China (Hong Kong)

Zone

Hong Kong Zone B

Hong Kong Zone D

VPC

test01

test01

vSwitch

test1

test2

Step 1: Create DR file system

First, create a General-purpose NAS file system to serve as the disaster recovery (DR) file system. This DR file system must be in a different zone within the same region and have the same specifications and protocol type as the primary file system.

  1. Log on to the NAS console.

  2. In the File System Selection Guide section of the Overview page, click Create below General-purpose NAS.

  3. In the Create panel, configure the following key parameters. Keep all other parameters the same as the primary file system. For more information, see Create a file system.

    Parameter

    Description

    Region

    Select the same region as the primary file system. This tutorial uses China (Hong Kong).

    Zone

    Select a different zone from the primary file system. This tutorial uses Hong Kong Zone D.

    VPC

    Select the same VPC as the primary file system. This tutorial uses test01.

    vSwitch

    Select a vSwitch within the VPC. This tutorial uses test2.

  4. Click Buy Now and complete the purchase as prompted.

Step 2: Deploy migration system and migrate data

After creating the DR file system, mount both it and the primary file system to the same ECS instance. Then, use the rsync tool to migrate the data and configure a scheduled task for incremental updates.

NFS file systems

  1. Mount the primary and DR NAS file systems.

    Log on to the ECS console, click Create Instance, and on the Custom Launch page, configure the following settings.

    • Region: Select the region where your NAS file systems are located. This tutorial uses China (Hong Kong).

    • Network and Zone: Select the same VPC as your NAS file systems. We recommend selecting the same vSwitch.

    • Instance Type: A low-specification instance is typically sufficient.

    • Image: Select CentOS. This tutorial uses CentOS 7.6 as an example.

    • Storage: Click Elastic Ephemeral Disk | File Storage NAS | Dedicated Block Storage Cluster (Optional), and then click Add File System. Add configurations for both the primary and DR NAS file systems. Refer to the following figure for an example.

      image.png

      After the ECS instance is created, the primary and DR NAS file systems are mounted. Run the following command to confirm:

      mount | grep nas.aliyuncs.com

      If the mount is successful, the output shows that the primary file system is mounted to the /mnt/src directory and the DR file system is mounted to the /mnt/dst directory.

      image.png

  2. Install the migration tool.

    sudo yum install -y rsync
  3. Migrate existing data.

    1. Create a directory in the DR file system. For example, create the dst/backupsystem directory.

      mkdir /mnt/dst/backupsystem
    2. Migrate the data from the primary file system to the backupsystem directory of the DR file system.

      rsync -avP /mnt/src/ /mnt/dst/backupsystem/
  4. Migrate incremental data.

    If applications running on other ECS instances write to the primary file system during the migration of existing data, you must synchronize the new incremental data after the initial migration is complete.

    rsync -avP --delete /mnt/src/ /mnt/dst/backupsystem/

    Because rsync first scans the source path, the command can be slow even for small amounts of incremental data.

    Warning

    The --delete option removes data from the DR file system that has been deleted from the primary file system. Use this option with caution to avoid accidental data loss. As a safeguard, you can enable the recycle bin feature for both file systems. If you accidentally delete files, you can restore them and their metadata (such as UIDs, GIDs, and ACLs) from the NAS recycle bin. For more information, see Recycle bin.

  5. Configure a scheduled task to migrate incremental data.

    Use crontab to configure scheduled incremental migration.

    1. Run the following command to open the crontab editor:

      crontab -e
    2. Configure the scheduled incremental migration.

      Add the following entry to crontab. In this example, 30 represents the minute and 00 represents the hour, meaning the incremental migration runs at 00:30 every day. You can adjust the schedule to meet your needs.

      30 00 * * * rsync -avP --delete /mnt/src/ /mnt/dst/backupsystem/ > /tmp/last_rsync_result.log 2>&1 &
    3. Run the following command to confirm the configuration:

      crontab -l
  6. Check the migration result.

    Run the following command to view the output of the last incremental copy:

    cat /tmp/last_rsync_result.log

SMB file systems

  1. Mount the primary and DR NAS file systems.

    Log on to the ECS console, click Create Instance, and on the Custom Launch page, configure the following settings.

    • Region: Select the region where your NAS file systems are located. This tutorial uses China (Hong Kong).

    • Network and Zone: Select the same VPC as your NAS file systems. We recommend selecting the same vSwitch.

    • Instance Type: A low-specification instance is typically sufficient.

    • Image: Select Windows Server. This tutorial uses Windows Server 2019 as an example.

    • Storage: Click Elastic Ephemeral Disk | File Storage NAS | Dedicated Block Storage Cluster (Optional), and then click Add File System. Add configurations for both the primary and DR NAS file systems. Refer to the following figure for an example.

      image.png

    • Public IP: Select Assign Public IPv4 Address to download the migration tool.

    After the ECS instance is created, the primary and DR NAS file systems are mounted. Run the following command to confirm:

    net use

    If the mount is successful, the output shows that the primary file system is mapped to the X drive and the DR file system is mapped to the Y drive.

    Status       Local        Remote                      Network
    
    -------------------------------------------------------------------------------
    OK           Y:        \\12e4874****-v****.cn-hongkong.nas.aliyuncs.com\myshare
                                                    Microsoft Windows Network
    OK           X:        \\12f7094****-c****.cn-hongkong.nas.aliyuncs.com\myshare
                                                    Microsoft Windows Network
  2. Install the migration tool.

    1. Download the rsync for Windows migration tool.

    2. Extract the downloaded package to the C drive and rename the folder to cwRsync.

  3. Migrate existing data.

    Open a Command Prompt window and run the following commands to migrate data from the primary file system to the DR file system.

    cd c:\cwRsync
    rsync.exe -avP /cygdrive/X/ /cygdrive/Y/ --no-perms --no-owner --no-group

    Replace X and Y with the actual drive letters.

    Note

    By default, Alibaba Cloud SMB does not support account permission configurations. If you have enabled SMB AD/ACL, you do not need to use the --no-perms, --no-owner, or --no-group options.

  4. Migrate incremental data.

    rsync.exe -avP --delete /cygdrive/X/ /cygdrive/Y/ --no-perms --no-owner --no-group > c:/rsync.log

    Because rsync first scans the source path, the command can be slow even for small amounts of incremental data.

    Warning

    The --delete option removes data from the DR file system that has been deleted from the primary file system. Use this option with caution to avoid accidental data loss. As a safeguard, you can enable the recycle bin feature for both file systems. If you accidentally delete files, you can restore them and their metadata (such as UIDs, GIDs, and ACLs) from the NAS recycle bin. For more information, see Recycle bin.

  5. Configure a scheduled task to migrate incremental data.

    1. Create a script file.

      Create a file named dailyrsync.bat on the C drive and add the following content. Replace X and Y with the actual drive letters.

      c:\cwRsync\rsync.exe -avP --delete /cygdrive/X/ /cygdrive/Y/ --no-perms --no-owner --no-group  > c:\run.log
    2. Configure the scheduled incremental migration.

      1. Open Control Panel, click System and Security, and in the Administrative Tools section, click Task Scheduler.

      2. In the Task Scheduler window, select .

      3. Click the General tab, enter a Name for the scheduled task, and select Run only when user is logged on.

      4. Click the Triggers tab, then click New. From the Begin the task drop-down list, select On a schedule. Set the task frequency to Daily and specify a run time. In the Advanced settings section, ensure Enabled is selected. Click OK.

      5. Click the Actions tab, then click New. From the Action drop-down list, select Start a program. In the Program/script field, select the dailyrsync.bat script file that you created in the Create a script file step. Click OK.

      6. Click OK.

      7. Restart the ECS instance to verify the result.

        If the system displays the following information, the scheduled task is running correctly.

        image.png

        After the task runs successfully, check the rsync.log file on the C drive to view the output from the last incremental copy.

Step 3: Switchover

To perform a switchover, mount the DR file system on all application systems.

NFS file systems

This example shows how to mount a DR NFS file system on a Linux-based application system. For more information about mounting NAS file systems, see Mounting scenarios.

Run the following command to mount the backupsystem directory of the DR file system to your application system.

sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <<mount_target>>:/backupsystem <<local_directory>>

Replace the following parameters with your actual values:

  • <<mount_target>>: The mount target of the DR file system.

  • <<local_directory>>: The local directory on the application system where you want to mount the DR file system, for example, /mnt. After a successful mount, the data in this directory is synchronized up to the time the last scheduled incremental task was completed.

SMB file systems

This example shows how to mount a DR SMB file system on a Windows-based application system. For more information about mounting NAS file systems, see Mounting scenarios.

net use Y: \\<<mount_target>>\myshare

Replace the following parameters with your actual values:

  • <<mount_target>>: The mount target of the DR file system.

  • Y: The drive letter to which the DR file system will be mapped. After a successful mount, the data on this drive is synchronized up to the time the last scheduled incremental task was completed.

  • myshare: The SMB share name. This name cannot be changed.

Summary

This tutorial covered how to:

  1. Configure a scheduled task to migrate incremental data.

  2. Switch file systems on your application systems.