All Products
Search
Document Center

File Storage NAS:Configure cross-zone disaster recovery for a General-purpose NAS file system

Last Updated:Feb 28, 2026

Synchronize data between two General-purpose NAS file systems in different zones of the same region using rsync. If the business file system becomes unavailable due to a zone-level outage, switch workloads to the disaster recovery file system.

File Storage NAS stores multiple replicas of data on different devices within the same zone. A zone-level service suspension caused by force majeure factors can temporarily block access to the file system. This cross-zone disaster recovery solution uses rsync for scheduled synchronization, not real-time replication. The recovery point objective (RPO) depends on the synchronization interval configured in the scheduled task.

Infrastructure

ComponentQuantityPurpose
VPC1Interconnects the ECS instance and both NAS file systems
vSwitch2 (one per zone)Connects each NAS file system to the VPC; provides network segmentation and isolation
General-purpose NAS file system2 (different zones, same region)Business file system + disaster recovery file system
ECS instance1Runs rsync for full and incremental data synchronization

Example configuration

The following example uses the China (Hong Kong) region.

ParameterBusiness file systemDisaster recovery file system
RegionChina (Hong Kong)China (Hong Kong)
ZoneHong Kong Zone BHong Kong Zone D
VPCtest01test01
vSwitchtest1test2

Prerequisites

Before you begin, ensure that you have:

  • A General-purpose NAS file system (the business file system) that contains the data to protect

  • A VPC in the target region with vSwitches in at least two zones

  • An Alibaba Cloud account with permissions to create NAS file systems and ECS instances

Step 1: Create the disaster recovery file system

Create a second General-purpose NAS file system with the same configuration as the business file system, except in a different zone.

  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 parameters. Keep all other parameters the same as the business file system. For more information, see Create a file system.

    ParameterDescription
    RegionSelect the same region as the business file system. In this example, select China (Hong Kong).
    ZoneSelect a different zone from the business file system. In this example, select Hong Kong Zone D.
    VPCSelect the same VPC as the business file system. In this example, select test01.
    vSwitchSelect a vSwitch in the target zone. In this example, select test2.
  4. Click Buy Now and follow the instructions to complete the payment.

  5. Verify that the new file system appears in the NAS console with a status of Running.

Step 2: Deploy rsync and synchronize data

Mount both file systems on an ECS instance, then use rsync for full synchronization followed by scheduled incremental synchronization. Follow the instructions for your protocol type.

NFS file system

Mount the file systems

  1. Log on to the ECS console. Click Create Instance. On the Custom Launch page, configure the following parameters:

    ParameterValue
    RegionSame region as the file systems. In this example, China (Hong Kong).
    Network and ZoneSame VPC as the file systems. Same vSwitch as the file system (recommended).
    InstanceMinimum specification.
    ImageCentOS. In this example, CentOS 7.6.
    StorageClick Elastic Ephemeral Disk|NAS File System|Dedicated Block Storage Cluster(Optional), then click Add File System to add both the business file system and the disaster recovery file system.

    Mount NFS file systems during ECS creation

  2. After the ECS instance is created, verify that both file systems are mounted: The business file system is mounted to /mnt/src and the disaster recovery file system is mounted to /mnt/dst.

       mount | grep nas.aliyuncs.com

    Mount verification output

Install rsync

sudo yum install -y rsync

Perform a full data synchronization

  1. Create a target directory in the disaster recovery file system:

       mkdir /mnt/dst/backupsystem
  2. Synchronize all data from the business file system to the disaster recovery file system:

       rsync -avP /mnt/src/ /mnt/dst/backupsystem/
  3. Verify the synchronization completed without errors by checking the rsync output for a summary line showing the total number of files transferred.

Synchronize incremental data

If applications write data to the business file system during or after the full synchronization, run the following command to synchronize incremental changes:

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

rsync scans the entire source directory before synchronizing incremental data. Synchronizing a small amount of data may take longer than expected.

Warning

The --delete option removes files from the disaster recovery file system that have been deleted from the business file system. To prevent accidental data loss, enable the recycle bin feature for both file systems. The recycle bin can restore deleted files and their metadata, including user identifiers (UIDs), group identifiers (GIDs), and access control lists (ACLs). For more information, see Recycle bin.

Configure a scheduled task

Use crontab to schedule automatic incremental synchronization.

  1. Open the crontab editor:

       crontab -e
  2. Add the following line to run incremental synchronization daily at 00:30: The five fields before the command define the schedule: Adjust the schedule based on your RPO requirements. A more frequent schedule reduces potential data loss but increases resource usage.

    FieldValueMeaning
    Minute30Run at minute 30
    Hour00Run at hour 00 (midnight)
    Day of month*Every day
    Month*Every month
    Day of week*Every day of the week
       30 00 * * * rsync -avP --delete /mnt/src/ /mnt/dst/backupsystem/ > /tmp/last_rsync_result.log 2>&1 &
  3. Verify the scheduled task is saved:

       crontab -l

Check the synchronization result

After the scheduled task runs, check the log:

cat /tmp/last_rsync_result.log

SMB file system

Mount the file systems

  1. Log on to the ECS console. Click Create Instance. On the Custom Launch page, configure the following parameters:

    ParameterValue
    RegionSame region as the file systems. In this example, China (Hong Kong).
    Network and ZoneSame VPC as the file systems. Same vSwitch as the file system (recommended).
    InstanceMinimum specification.
    ImageWindows Server. In this example, Windows Server 2019.
    StorageClick Elastic Ephemeral Disk|NAS File System|Dedicated Block Storage Cluster(Optional), then click Add File System to add both the business file system and the disaster recovery file system.
    Public IP AddressSelect Assign Public IPv4 Address to download the migration tool.

    Mount SMB file systems during ECS creation

  2. After the ECS instance is created, verify that both file systems are mounted: Expected output shows the business file system mounted on X drive and the disaster recovery file system mounted on Y drive:

       net use
       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

Install rsync

  1. Download rsync for windows.

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

Perform a full data synchronization

Open the Command Prompt and run the following commands. Replace X and Y with the actual drive letters.

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

By default, SMB file systems do not support account permission configurations. If SMB Active Directory (AD) or ACL is enabled, the --no-perms, --no-owner, and --no-group options are not required.

Synchronize incremental data

Run the following command. Replace X and Y with the actual drive letters.

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

rsync scans the entire source directory before synchronizing incremental data. Synchronizing a small amount of data may take longer than expected.

Warning

The --delete option removes files from the disaster recovery file system that have been deleted from the business file system. To prevent accidental data loss, enable the recycle bin feature for both file systems. The recycle bin can restore deleted files and their metadata, including UIDs, GIDs, and ACLs. For more information, see Recycle bin.

Configure a scheduled task

  1. Create a script file named dailyrsync.bat on C drive with 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. Open the Control Panel and click System and Security. In the Administrative Tools section, click Schedule tasks.

  3. In the Task Scheduler window, choose Actions > Create Task.

  4. Click the General tab, enter a task name in Name, and select Run only when user is logged on.

  5. Click the Triggers tab. Click New Trigger. Select On a schedule for Begin the task, select Daily, and specify the execution time. In the Advanced settings section, select Enabled. Click OK.

  6. Click the Actions tab. Click New Action. Select Start a program for Action. In the Program/script section, select the dailyrsync.bat script file created on C drive. Click OK.

  7. Click OK.

  8. Restart the ECS instance and verify that the scheduled task appears in Task Scheduler.

    Scheduled task verification

Check the synchronization result

After the scheduled task runs, check rsync.log on C drive to confirm the output of the most recent incremental data synchronization.

Step 3: Perform a switchover

If you need to switch your workloads to the disaster recovery file system, mount the disaster recovery file system on all business systems where the business file system was previously mounted.

NFS file system

Mount the backupsystem directory of the disaster recovery file system to the business system. For more information about mounting, see Scenarios.

sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <<Mount target>>:/backupsystem <<Business system directory>>

Replace the following parameters:

  • <<Mount target>> -- The mount target of the disaster recovery file system.

  • <<Business system directory>> -- The local directory of the business system to which the disaster recovery file system is mounted. Example: /mnt. The data in this directory reflects the state of the last scheduled synchronization.

SMB file system

Mount the disaster recovery file system to a drive on the business system. For more information about mounting, see Scenarios.

net use Y: \\<<Mount target>>\myshare

Replace the following parameters:

  • <<Mount target>> -- The mount target of the disaster recovery file system.

  • Y -- The drive letter to assign to the disaster recovery file system. The data on this drive reflects the state of the last scheduled synchronization.

  • myshare -- The name of the shared SMB directory. This value cannot be changed.