C H A P T E R 5 |
The sndradm Command |
Note - To use the Remote Mirror software, you must be the root user. |
This chapter describes the Remote Mirror software's /usr/sbin/sndradm command and options.
The topics in this chapter include:
The /var/adm/ds.log file contains operation log messages for the Remote Mirror commands. For example, these log messages show a volume set enabling and updating:
Note - If you use a command without specifying any volume set arguments, the command operates on all Remote Mirror volume sets. |
For example, to update the secondary volume from the primary volume:
sndradm -u [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
The /usr/sbin/sndradm command uses the command switches shown in TABLE 5-1. TABLE 5-2 shows the commands sorted in alphabetical order and TABLE 5-3 shows the options.
TABLE 5-4 describes the commands and synchronization situations performed from a primary host, secondary host, or both.
Enable the software for the specified set (sync not required). |
Use the following commands to enable and disable volume sets. |
|
Use the following commands to enable and disable volume sets. |
||
Stop the software replication, enter logging mode, and track changes using bitmaps. |
||
Copy the entire contents of the primary volume to the secondary volume; also known as full synchronization. |
||
Copy the entire contents of the secondary volume to the primary volume; also known as full reverse synchronization. |
||
Update only the changed data of the primary volume to the secondary volume; also known as update synchronization or resynchronization. |
||
Update only the changed data of the secondary volume to the primary volume; also known as reverse synchronization or reverse update. |
||
Update or reconfigure the disk group name or cluster resource tag. |
||
Move all the specified Remote Mirror sets to a different group. |
||
See the display that results from entering this command at the command prompt |
||
See the display that results from entering this command at the command prompt |
||
Display the status of the link connecting systems running the software. |
||
Use the following commands to enable and disable volume sets. |
||
Enable the software for the specified set (sync not required). |
Use the following commands to enable and disable volume sets. |
|
See the display that results from entering this command at the command prompt |
||
Display the status of the link connecting systems running the software. |
||
Add or delete a Sun StorageTek Point-in-Time Copy software volume group for use with the software. |
||
Copy the entire contents of the primary volume to the secondary volume. |
||
Copy the entire contents of the secondary volume to the primary volume. |
||
Use after fixing a failed bitmap volume. It clears the BMF error and commits the current state of the Remote Mirror set to the bitmap header. |
||
Reconfigure the specified volume sets by moving them to a different group. |
||
Update only the changed data of the primary volume to the secondary volume; also known as update synchronization or resynchronization. |
||
Update only the changed data of the secondary volume to the primary volume; also known as reverse synchronization or reverse update. |
||
See the display that results from entering this command at the command prompt |
||
TABLE 5-4 describes the commands and synchronization situations which can be performed from a primary host, secondary host, or both.
Use the following commands to enable and disable volume sets.
Enable the software for the specified set (sync not required). |
Use the following commands to enable and disable volume sets. |
|
Use the following commands to enable and disable volume sets. |
||
Stop the software replication, enter logging mode, and track changes using bitmaps. |
Note - When you first enable the Remote Mirror software, you must enable it on the primary and secondary hosts. Always maintain the same volume set field order on primary and secondary hosts. |
The sndradm -e and -E commands enable the Remote Mirror volume set (volset) and start logging changes to the volumes. Also use these commands to create one-to-many, many-to-one, and multihop volume sets. See One-to-Many, Many-to-One, and Multihop Volume Sets.
![]() |
Caution - When creating volume sets, do not create secondary or bitmap volumes using partitions that include cylinder 0. Data loss might occur. See VTOC Information. |
When you first enable a set, the software assigns a default name of shost:sdev, where shost is the secondary host name and sdev is the secondary volume partition name, separated by a colon (:). The volume set name is referred to in this document as set-name.
After executing these commands, you can use the shost:sdev name for a volume set each time you issue a command, instead of specifying the complete primary and secondary host, volume, and bitmap information for a volume set.
This command sets the bitmap to indicate that a full synchronization between volumes is required. It also enables logging and adds the local volume set (including the local bitmap volume) to the storage volume (sv) driver control.
sndradm -e [-n] [[-f volset-file] | volset]
This command clears the bitmap logging to indicate that the specified volumes are fully synchronized and enables logging. It also adds the local volume set (including the local bitmap volume) to the storage volume (sv) driver control.
sndradm -E [-n] [[-f volset-file] | volset]
After you enable a volume set, you can synchronize or update the volumes. See Starting a Full Synchronization and Starting an Update Resynchronization for more information.
Use the sndradm -d command when the primary and secondary volumes no longer need to be associated with each other as software volume sets.
This command discards any active logging information in the bitmap volumes. See Enabling and Disabling Volume Sets to re-enable software replication and Starting a Full Synchronization to re-establish identical replicated sets.
Note - This command also removes the information for the specified set from the Sun StorageTek software configuration. |
When you issue this command, the software terminates all replication services between the specified primary and secondary volumes and discontinues the relationship between these volume sets. It also discards any active bitmaps that track temporary differences between primary and secondary volumes.
sndradm -d [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Note - Use the sndradm -e command to enable software volume sets before using this command. Enabling and Disabling Volume Sets describes this command. |
Use the sndradm -I command to add or delete Point-in-Time Copy software volumes for use with enabled software volume sets. You can use this command on the secondary and primary hosts to offer data protection during reverse and forward synchronization update operations. You also use this command to offer data protection during an automatic or manual resynchronization.
The sndradm -I a command creates configuration entries marked with the ndr_ii key. The ndr_ii entries contain an additional state field that the kernel uses to determine when point-in-time copies must be made. The kernel notifies the Remote Mirror software synchronization daemon whenever a synchronization is started and waits for sndrsyncd to perform any necessary copies before allowing the synchronization to proceed.
The daemon is also notified when any Remote Mirror software resynchronization starts or finishes executing. The daemon performs Point-in-Time Copy operations on the secondary or target host, if configured to do so.
Consider the following when configuring a volume set:
This command adds a Point-in-Time Copy volume group entry to the Sun StorageTek configuration.
sndradm -I a master-vol shadow-vol bitmap-vol
where master-vol, shadow-vol, and bitmap-vol are the full path to the raw device nodes for configured Point-in-Time Copy volumes. In this case, the master-vol is the Remote Mirror secondary volume.
See the Sun StorageTek Availability Suite 4.0 Point-in-Time Copy Software Administration Guide for more information about these volume sets.
This command deletes a Point-in-Time Copy volume group entry from the Sun StorageTek configuration.
sndradm -I d master-vol shadow-vol bitmap-vol
where master-vol, shadow-vol, and bitmap-vol are the full path to the raw device nodes for configured Point-in-Time Copy volumes.
Use the sndradm -l command to start bitmap logging on enabled volume sets and I/O groups. Issue the sndradm -l command as follows:
To resume Remote Mirror software operations after using the sndradm -l command, use the sndradm -u command to perform an update resynchronization or the sndradm -m command to perform a full resynchronization. Note also that, when issued from the secondary host, the sndradm -l command does not work on the secondary volume for any volume that is currently synchronizing.
This command enables you to stop replication between primary and secondary volumes and to start logging data changes on these volumes. The Remote Mirror software continues logging even if the operations of a volume set or I/O group are interrupted.
If all volume sets in an I/O group are replicating (meaning that the secondary volumes contain a valid copy of the corresponding primary volumes), all sets in the group enter logging mode automatically whenever one volume set enters logging mode. This scheme ensures that the secondary volumes contain a valid copy.
sndradm -l [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
The following commands enable you to synchronize and update volume sets.
See also Restarting an Initial Synchronization and Performing a Reverse Copy or Update After a Primary Volume or Network Link Failure.
Copy the entire contents of the primary volume to the secondary volume; also known as full synchronization. |
||
Copy the entire contents of the secondary volume to the primary volume; also known as full reverse synchronization. |
||
Update only the changed data of the primary volume to the secondary volume; also known as update synchronization or resynchronization. |
||
Update only the changed data of the secondary volume to the primary volume; also known as reverse synchronization or reverse update. |
||
Wait for a synchronization operation to finish executing before executing other commands. |
If, after enabling the volume sets, the initial synchronization operation using the sndradm -m or sndradm -u commands is interrupted, the software restarts the synchronization, according to the conditions described in the following table:
A full synchronization operation, starting from the beginning. |
||
As specified in Rehearsing Disaster Recovery, do the following tasks after the network link or disk failure is repaired:
1. Place the primary and secondary host volumes into logging mode if they are not already in logging mode.
See Stopping Replication and Starting Logging.
2. Perform the reverse copy or update.
Use the sndradm -m command when all of the following conditions exist:
Use the sndradm -m -r command when all of the following conditions exist:
You can use the primary volume during reverse synchronization
(sndradm -m -r). The primary volume shows a consistent volume image of the latest data as soon as the reverse synchronization starts. If your application had been writing to the secondary volume as part of a failure or disaster rehearsal, you can move the application back to the primary volume when the reverse synchronization starts. See also Rehearsing Disaster Recovery.
If a synchronization initiated by the sndradm -m or sndradm -m -r commands is interrupted, use the sndradm -u update command to finish executing the synchronization. You can use the sndradm -p, sndradm -P, and dsstat commands to view volume set status.
See also Restarting an Initial Synchronization and Performing a Reverse Copy or Update After a Primary Volume or Network Link Failure
This command enables you to start a full copy operation from the primary volume to the secondary volume. It also enables replication concurrently from the primary volume to the secondary volume so that any new writes to the primary volume are also replicated to the secondary volume.
sndradm -m [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
This command enables you to start a full reverse copy operation from the secondary volume to the primary volume. It also enables replication from the primary volume to the secondary volume so that any new writes to the primary volume are also replicated to the secondary volume.
sndradm -m -r [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Use the sndradm -u command when all of the following conditions exist:
Use the sndradm -u -r command when all of the following conditions exist:
Note - You can use the primary volume during reverse synchronization
|
If a synchronization initiated by the sndradm -m or sndradm -m -r commands is interrupted, use the sndradm -u update command to finish executing the synchronization. You can use the sndradm -p, sndradm -P, and dsstat commands to view volume set status.
See also Restarting an Initial Synchronization and Performing a Reverse Copy or Update After a Primary Volume or Network Link Failure.
This command resynchronizes the secondary volume from the primary volume. It updates the secondary volume according to changes based on the bitmaps maintained while replication was stopped. It also enables concurrent replication between the primary and secondary volumes so that any new write operations to the primary volume are also replicated to the secondary volume.
sndradm -u [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
This command resynchronizes the primary volume from the secondary volume. It updates the primary volume according to changes based on the bitmaps maintained while replication was stopped. It also enables concurrent replication between the primary volume and secondary volumes so that any new write operations to the primary volume are also replicated to the secondary volume.
Tip - You can also use this command to roll back volume changes on the primary volume from a Point-in-Time Copy software image captured on the stopped secondary volume. |
sndradm -u -r [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Use the sndradm -w command in one of the following situations:
This command enables you to make the software wait until an in-progress copy or update synchronization finishes executing. It prevents another software command from executing on the specified volume set or I/O group.
sndradm -w [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Note - Before reconfiguring or changing volume sets (except for changing the volume set bitmap), place the volume sets in logging mode by using the
|
The following commands enable you to reconfigure or modify a volume set.
Move all the specified Remote Mirror sets to a different group. |
||
Update or reconfigure the disk group name or cluster resource tag. |
Use the sndradm -R b command when you need to assign a new bitmap to a volume set.
This command enables you to assign a new bitmap to an existing volume set. You can change the bitmaps on the primary or secondary host. This command copies any data from the old bitmap to the new bitmap.
sndradm -R b {p|s} new-bitmap-name [-C tag] [-n] [[-f volset-file] |volset | set-name]
Note - Before reconfiguring or changing volume sets (except for changing the volume set bitmap), place the volume sets in logging mode by using the
|
Use the sndradm -R g command to move volume sets to a different I/O group.
To move multiple sets to a single io-groupname, keep the io-groupname the same and specify different set-names on the command line.
This command enables you to move volume sets to a different I/O group, thereby updating an existing I/O group. You must specify at least one set-name. Issue this command from the primary and secondary hosts.
Note - The new group name must be identical on both the primary and the secondary hosts. |
sndradm -R g io-groupname [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
|
1. Place the I/O group volume sets into logging mode:
3. After you finish changing the sets, perform an update synchronization using the sndradm -u command.
|
1. Place the I/O group volume sets into logging mode:
3. After you finish changing the sets, perform an update synchronization using the sndradm -u command.
Note - Before reconfiguring or changing volume sets (except for changing the volume set bitmap), place the volume sets in logging mode by using the
|
Use the sndradm -R m command to change the replication mode of a volume set.
Note - You can remove one volume set, selected volume sets, or all volume sets from a group using the sndradm -R g command. See To Remove Volume Sets From an I/O Group and Change the Replication Mode and Moving a Volume Set to a Different I/O Group. |
This command enables you to reconfigure the replication or mirroring mode of a volume set.
sndradm -R m {sync|async} [-C tag] [-n] [[-f volset-file] |volset | set-name]
|
1. Place the I/O group volume sets into logging mode:
2. Choose one of the following commands:
3. Change the volume set replication mode of each volume set:
4. If desired, add the volume sets you have changed to a different or the previous I/O group:
See also Moving a Volume Set to a Different I/O Group
5. After you finish changing the sets, perform an update synchronization using the sndradm -u command.
Use the sndradm -R -f command to change the current volume sets being operated on by the Remote Mirror software. This command is useful when you use a volume set file and have made changes to it.
The fields for the volume set file specified using the -f option are similar to those in the volset, described in TABLE 5-3:
phost pdev pbitmap shost sdev sbitmap ip {sync|async} [g io-groupname] [C tag]
[q qdev]
See Setting Up a Volume Set File and the rdc.cf man page for more information.
This command enables you to update or reconfigure the current volume set information from a specified volume set file.
sndradm -R -f volset-file [-g io-groupname] [-C tag] [-n]
Note - The Remote Mirror software is cluster-aware in the Sun Cluster environment and provides high-availability (HA) for the Sun StorageTek software. |
Use the sndradm -R C command in cases where the disk group name or cluster resource tag are not indicated by the volume path name. This command does not affect remote volumes and cannot be used in nonclustered environments.
You can also move all volume sets in one cluster tag to another cluster tag. Use the command as follows:
This command enables you to update or reconfigure the current disk group name or cluster resource tag of the local volume in a volume set. tag here is defined as the disk group name or cluster resource tag.
sndradm -R C tag [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Use the following commands to display information about volume sets.
When using the sndradm -p and sndradm -P commands to display status information, the reported status also includes information on the state of the set. Use the volset | set-name options to view the status for a single volume set. Use the -g io-groupname and -C tag options to filter the output so that it includes only those volumes that are part of io-groupname or tag.
Note - Issue this command from the primary host to display information correctly. |
This command displays a brief version of the Remote Mirror software status for volume sets and I/O groups. The following is example output of this command on the primary host:
# sndradm -p /dev/rdsk/c4t96d0s1 -> fast7:/dev/rdsk/c2t0d0s1 /dev/rdsk/c4t97d0s1 -> fast7:/dev/rdsk/c2t0d0s1 /dev/rdsk/c4t98d0s1 -> fast7:/dev/rdsk/c2t0d0s1 |
sndradm -p [volset | set-name] [-g io-groupname] [-C tag]
This command displays a detailed version of the Remote Mirror software status for volume sets and I/O groups. The following is example output of this command on the primary host:
The reported status also includes information on the state of the set:
sndradm -P [volset | set-name] [-g io-groupname] [-C tag]
Use the sndradm -i command to display volume set and I/O group names. This command displays volume set information in a volume set file format. See Section , Setting Up a Volume Set File.
Tip - You can also use the output of this command to create a volume set file suitable for editing and using with the sndradm -R -f volset-file command. |
This command enables you to display a list of the current volume set and I/O group names in use. The following is an example of the output.
Note that the output is formatted as it would be entered in a volset-file:
phost pdev pbitmap shost sdev sbitmap ip {sync|async}.
sndradm -i [volset | set-name] [-g io-groupname] [-C tag]
Use the -g io-groupname and -C tag options to filter the output so that it includes only those volumes that are part of io-groupname or tag.
Use the sndradm -H command to check the status of the link connecting primary and secondary hosts.
Note - Use the ping(1M) command to supplement the link status shown by sndradm -H. |
This command displays the currently configured primary and secondary host machine names, volumes, and bitmap volumes for the selected sets. It also shows whether the link between machines is active or inactive. For example:
where shost is the secondary host name and sdev is the secondary volume partition name, separated by a colon (:). When you first enable a set, the Remote Mirror software assigns a default volume set name of shost:sdev.
If you specify no arguments, the Remote Mirror software displays all configured volume sets. However, for best display results, specify a volume set using shost:sdev.
Use the sndradm -a command to enable or disable autosynchronization. See Choosing Automatic or Manual Resynchronization for more information about autosynchronization.
This command enables or disables the Remote Mirror software autosynchronization. If Remote Mirror software autosynchronization is enabled on the primary host, the synchronization daemon attempts to resynchronize volume sets if the system reboots or link failures occur.
The default state is disabled.
sndradm -a {on|off} [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
Consider the following when using autosynchronization with Sun Cluster:
# sndradm -n -r -m
These commands apply only to memory-based queues. They have no effect on disk queues.
Note - Ensure that you do not configure the queue size to be larger than the available cache. As a rule of thumb, reserve 5 percent of the total cache. |
Use the following commands to set the maximum number of writes or 512-byte blocks that can be queued in asynchronous mode.
See Tuning the Asynchronous Queue.
This command enables you to set the maximum number of write operations to queue for asynchronous mode volume sets. The default value number is 4096. For example, set this value to 1000 to ensure that the secondary volume is never more than 1000 write operations behind the primary volume.
sndradm -W value [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
This command enables you to set the maximum number of 512-byte blocks in the asynchronous queue. The default number is 16384, allowing about 8 Mbytes of data per queue.
sndradm -F value [-g io-groupname] [-C tag] [-n] [[-f volset-file] |volset | set-name]
These commands apply only to memory-based queues. They have no effect on disk queues.
Note - Ensure that you do not configure the queue size to be larger than available cache. As a rule of thumb, reserve 5 percent of the total cache. |
The queues containing the Remote Mirror software asynchronous write operations are stored in system kernel memory. You can tune or adjust these queues so that they are correctly sized for your Remote Mirror software use and volume data set size. Left untuned, the queues can appear to slow performance and consume more system memory than is desirable.
Consider the following steps when tuning asynchronous queues:
1. The number of volume sets and whether a group contains a large number of volume sets in asynchronous mode (such a group shares a single queue and might affect performance).
The number of volume sets is most important. Large queue settings matched with a small number of volume sets ensures better performance than large queue settings with a large number of volume sets. However, try not to size queues so large that you exhaust kernel memory and degrade your system's performance.
This section includes the following topics:
The Remote Mirror software's asynchronous mode helps when your network has sufficient bandwidth to handle many write transactions or when your replicating application (such as a database) performs burst-writes at a rate higher than the network limits allow.
Generally, you use asynchronous mode for a volume set when the I/O write rate is less than the throughput of the network you are using for replication. This mode provides low latency rates to the software, resulting in faster response at the host (see Asynchronous Replication Mode).
As the number of write operations in the queue increases, the transactions can exceed the ability of the queue and network to process them (depending on network bandwidth and latency). The Remote Mirror software appears slow and reports less than optimal write transaction performance. Unless you tune (or size) the queue correctly, asynchronous mode performance might appear to be the same as or worse than synchronous mode, depending on the volume data set size.
Consider changing the software's default queue size if:
You can change the asynchronous queue size by using the sndradm -W and
sndradm -F commands. The Remote Mirror software sets the following default sizes for the queue:
Default maximum number of write operations in the queue
|
|
Default maximum number of 512-byte data blocks
|
|
1. Type the following to display the current queue size:
# sndradm -P /dev/vx/rdsk/rootdg/ds4-clone -> nws:/dev/vx/rdsk/rootdg/ds4-sndr-s autosync: on, max q writes: 4096, max q fbas: 16384, mode: async |
The kstat command also displays queue information:
2. Perform any of the following kstat(1M) commands to show more information.
The following kstat(1M) kernel statistics output shows information about the asynchronous queue. In this example, the queue is sized correctly.
This example shows only a portion of the command output needed for this section; the kstat command actually displays more information. The following table explains the settings and statistics shown in the example.
Default maximum number of 512-byte blocks in the asynchronous queue. Set this using sndradm -F |
|
Default maximum number of write operations to queue for asynchronous mode volume sets. Set this using sndradm -W. According to this setting, each write consumes 2 Kbyte for the 8 Mbyte of data. |
|
A total of 878 512-bytes blocks (approximately 439 Kbytes) have been put into the queue. |
|
A total of 483 write transactions have been put into the queue.[1] |
|
The following kstat(1M) kernel statistics output shows information about the asynchronous queue, which is incorrectly sized.
This example shows only a portion of the command output needed for this section; the kstat command actually displays more information.
This example shows the default queue settings, but the application is writing more data than the queue can handle. The async_block_hwm value of 16380 indicates that the application is approaching the limit for 512-byte blocks. The next few I/O operations might not be placed into the queue.
The value of async_throttle_delay indicates that the application has been delayed 16497 x 2 milliseconds. In this example, if the system has sufficient memory, increase the size of maxqfbas using the sndradm -F command.
You can have memory-based or disk-based queues. Disk-based queues have some advantages over memory-based queues. See Disk-Based Asynchronous Queues for further information. You can configure a disk queue when you first enable a set or you can use these commands later.
You can add, remove, and replace disk queues for sets and groups of sets with the disk queue CLI commands. You can also set each queue for blocking or non-blocking mode. See Blocking Mode and Non-blocking Mode for more information.
Note - The sndradm -q command is valid only in logging mode. |
This command enables you to add, remove, or replace a disk queue to a set or to a group.
sndradm -g io-groupname -q a vol
sndradm -g io-groupname -q r newvol
sndradm -q a newvol shost:sdev
For example, this is how to add a disk queue to a Remote Mirror set:
This command enables you to set the disk queue blocking mode for a set or group.
sndradm -D {block | noblock} set
For example, to change from blocking mode to nonblocking mode, type:
You can change the number of asynchronous threads from the default value of 2. You can set the number of threads to a higher number limited only by practical considerations.
This command enables you to set the number of asynchronous threads that drain the asynchronous queues.
See Multiple Asynchronous Flusher Threads for more details.
Copyright © 2006, Sun Microsystems, Inc. All Rights Reserved.