How to use the ndmpcopy tool to copy file systems or directory structures

Product:


Hardware: All Celerra Products


Software: NAS code 6.0

Software: NAS code 5.6


Description:


How to use the NDMPcopy tool to copy file systems or directory structures.

 


Resolution:

 

NDMPcopy is an open source data copy tool commonly used on NAS platforms. It copies a file system or directory structure to another file system on the same or different Celerra, and supports NDMP incremental copies. It was officially introduced on DART 6.0, but it's also supported on release 5.6. The NDMPcopy also provides multiprotocol (NFS/CIFS) support, so it copies the UNIX permissions and CIFS ACL's. It can be used to copy file systems with different sizes.

 

Follow these steps:


 

 

1. First you need to create local users on both Data Movers ( source and destinations ) with /nas/sbin/server_user command. Use at least four characters on the usernames. Refer to "Celerra Command Reference Manual" for details.

 

2. Then, download the Linux version of NDMPcopy binary from this solution, or from www.ndmp.org for HP-UX and Solaris versions.

 

Note: Make sure you have connectivity between the Data Movers with server_ping command before running the NDMPcopy tool, otherwise the command can hangs.

 

Usage :


./ndmpcopy
Source and destination filer names and paths are required.

Usage:  ndmpcopy src_filer:/src/dir dest_filer:/dest/dir
                 [-sa none | user:password] [-da none | user:password]
                 [-sport ndmp_src_port] [-dport ndmp_dest_port]
                 [-dhost ndmp_dest_ip_addr] [-level ndmp_dump_level]
                 [-v] [-q] [-dpass] [-h]

Defaults:
   src_auth_type       = text
   src_auth_user       = root
   src_auth_password   =
   dest_auth_type      = text
   dest_auth_user      = root
   dest_auth_password  =
   ndmp_src_port       = 0  (0 means NDMP default, usually 10000)
   ndmp_dest_port      = 0  (0 means NDMP default, usually 10000)
   ndmp_dump_level     = 0  (valid range: 0 - 9)
   ndmp_dest_ip_addr   =   (no default: user needs to override dest_filer value)
   verbosity           = noisy
   different_passwords = no

 

The syntax is the following:

 

./ndmpcopy souce_ip_address:/mountpoint/path destination_ip_address:/mountpoint/path -sa user:password -da user:password -sport 10000 -dport 10000 -level 0 -v -v -v -v

 

The four v's at the end is to have a more verbose output.

 

Level 0 means full copy.

 

Level 9 is incremental from the previous level 0 or 9.

 

Example:

 

./ndmpcopy 10.0.0.1:/test/old 10.0.0.2:/gustavo/new -sa ndmpcopy:ndmpcopy -da ndmpcopy:ndmpcopy -sport 10000 -dport 10000 -level 0 -v -v -v -v
Creating NDMP connection.
Connecting to 10.0.0.1.
Authorizing connection with TEXT authorization.
    user = ndmpcopy, password = ndmpcopy.
Authenticated root with NDMP_AUTH_TEXT.
Creating NDMP connection.
Connecting to 10.0.0.2.
Authorizing connection with TEXT authorization.
    user = ndmpcopy, password = ndmpcopy.
Authenticated root with NDMP_AUTH_TEXT.
Sending MOVER_LISTEN message.
DUMP: Sending backup request, mover 0xa057e52, port 61161.
Environment:
  UPDATE = y
  TYPE = dump
  USER = root
  HIST = n
  FILESYSTEM = /test/old
  LEVEL = 0
  EXTRACT = n
DUMP: Done! returning.

RESTORE: Sending recover request.
RESTORE: Done! returning.

Main in infinite loop...
10.0.0.1: Received notify_connect request: version: 4,

10.0.0.1: CONNECT: Connection established.
10.0.0.2: Received notify_connect request: version: 3,

10.0.0.2: CONNECT: Connection established.
10.0.0.2: Received notify_data_read: offset:0 len:-1

10.0.0.1: LOG: server_archive: emctar vol 1, 54 files, 0 bytes read, 8230978006 bytes written
10.0.0.1: HALT: The operation was successful!
Waiting for 10.0.0.2 to halt too.
10.0.0.2: LOG: server_archive: emctar vol 1, 54 files, 8230978006 bytes read, 0 bytes written
10.0.0.2: HALT: The operation was successful!
Mover and data server halted, closing connection.
The transfer is complete.
Elapsed time: 0 hours, 1 minutes, 44 seconds.

 

For copies within the same Data Mover you can expect a transfer rate around 80 MB/Sec (284 GB/Hour), depending mostly on the Data Mover CPU utilization, the average file size and amount of files. The copy can also be monitored with server_pax command like a regular NDMP backup.

 

ATTENTION : NDMPcopy works like a backup/restore and therefore does not purge files. If you use NDMPcopy as a migration tool, make sure no files were removed from the source after the full copy was done. One alternative to ensure the copy will be consistent is to mount the source as read only, then do a full copy. Since the transfer rates are high, this might fit most of the situations, depending mostly on the file system size and number of files.

 

 

Note: Use an external client to run the ndmpcopy and NOT on the Control Station (especially not using the internal networks when running on the CS).