In addition to performing actions through the LifeKeeper GUI, the mirror can also be administered using the command line. There are several commands (found in the $LKROOT/bin directory) that can be used to administer a DataKeeper resource.

Mirror Actions

mirror_action <tag> <action> [source] [target(s)]

<tag> is the LifeKeeper resource tag of the DataKeeper resource

<action> is one of: pause, resume, force, fullresync

[source] (optional) is the current source system (if source is not specified, it will use the current system the command was run from)

[target] (optional) is the target system (or list of systems) that the action should affect (if target(s) is not specified, it will use all of the applicable target(s))


To pause the mirror named datarep-ext3:

mirror_action datarep-ext3 pause

To resume replication from adam to both eve and sophocles:

mirror_action datarep-ext3 resume adam eve sophocles

To force the mirror online on system eve:

mirror_action datarep-ext3 force eve

To resume replication and force a full resynchronization from adam to sophocles:

mirror_action datarep-ext3 fullresync adam sophocles

Mirror Resize

The mirror_resize command performs an offline mirror resize allowing a DataKeeper mirror to be resized without having to delete and recreate the resource. It should be run on the source system and the mirror must be out of service. The underlying disks should be resized before resizing the mirror. The size of the underlying disks will be auto-detected and used as the new mirror size.

mirror_resize [-f] -s <size> <tag>

<tag> is the tag of a mirror resource

-f forces the resize without user prompts (not recommended)

-s <size> specifies alternate mirror size (in KB) This parameter is required.

Recommended Steps for Mirror Resize:

  1. Take the mirror and all dependent resources out of service.
  1. Perform the disk resize on the underlying mirror disks (e.g., extend logical volume, expand LUN). Perform this on both source and target. (Remember that the target size must be greater than or equal to the source size.)
  1. Run mirror_resize on the source system. This will update the internal metadata and bitmap for the mirror to reflect the newly expanded disk size.

Example: mirror_resize –s <size in KB> <tag>

  1. Bring only the mirror (i.e., datarep) resource in service. A resync of the newly expanded disk or partition will occur.
  1. Perform the file system resize on the mirror device (e.g. resize2fs /dev/mdX where X is md device number for the mirror being resized such as /dev/md0). Note: An fsck may be required before being able to resize the file system.
  1. Bring the file system and application resources online.

Bitmap Administration

bitmap -a <num>|-c|-d|-x <size_kb>|-X <bitmap_file>

-a <num> adds the asynchronous write parameter to the bitmap file. It is needed if a synchronous mirror is upgraded to include an asynchronous target. The default value for <num> is 256. To calculate the correct value for this limit, see the Asynchronous Mirroring Information in Mirroring with SIOS DataKeeper for Linux.

-c cleans the bitmap file (zeroes all the bits). This can be used to avoid a full resync in case an exact replica of the source disk exists on the target. Use this option with extreme caution.

-d dirties the bitmap file (sets all the bits to ones). This option can be used to force a full resync, for example after a split-brain situation has occurred.

-m reads the bitmap and produces merge stream.

-X <bitmap file> examines the bitmap file and displays useful information about the bitmap and the mirror.

-x <size_kb> extends bitmap file to be valid with disk of size_kb.
(Note: This option is only used internally for mirror resizing.)

In addition, the mdadm command may also be used to administer a DataKeeper resource, as the DataKeeper resource is actually an md device. Refer to the mdadm(8) man page for details. Note: When using mdadm, be sure to use the version that is located in $LKROOT/bin, as it is more up-to-date than the version included with the operating system.


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment