Rekeying a Disk using the CLI

When KeyControl rekeys a disk, it creates a new key and then begins decrypting the disk using the old key. As each block is decrypted, the Policy Agent re-encrypts it using the new key.

The following procedure applies to all types of Windows disks and to Linux data disks. You cannot, however, rekey a Linux system device (such as /root, /swap, or /home) using this procedure. Instead, use the htroot rekey command as described in Rekeying a Linux System Device.

  1. For Linux, log into the VM as root. For Windows, log in as a System Administrator and open a Command Prompt or start Windows PowerShell.
  2. If you want to check the available disks on this VM, enter the hcl status command.
  3. If this VM belongs to a Cloud VM Set that uses the Single Encryption Key (SEK) option and you want to verify that there is a new version of the SEK key available, enter the hcl keyversion diskname command, where diskname is the name of the disk that you want to rekey. For Linux, use the short form of the disk name. (For example, sdb1 instead of /dev/sdb1.) For Windows, specify the drive letter or folder mount associated with the disk. (For example, f: or g:\data).

    The command returns the key version being used by the disk as well as the current SEK key version. The following example shows a disk that is currently encrypted with an older version of the SEK key:

    # hcl keyversion sdb1
    keyversion: 2 SEKversion: 4

    In this case, you should rekey the disk to bring it up to date. If the key version matches the SEK version however, there is no need to rekey the disk. For more information on the SEK option, see Data Deduplication with Cloud VM Sets.

  4. If this is a Linux system and you have not enabled Online Encryption for this VM, unmount the disk you want to rekey. For more information, see Linux Online Encryption Prerequisites and Considerations.
  5. Enter the command hcl rekey [-s] diskname, where:

  6. For Linux, the progress of the command is displayed automatically. For Windows, use the hcl status command to check the progress.

  7. If the rekey operation is interrupted on Windows, the Policy Agent automatically restarts it when the system comes back online. For Linux, you can: