Mapping a block device

Use the rbd command to map an image name to a kernel module. You must specify the image name, the pool name and the user name. rbd will load the RBD kernel module if it is not already loaded.

Prerequisites

  • A running IBM Storage Ceph cluster.

  • Root-level access to the node.

Procedure

  1. Return a list of the images.
    Example
    [root@rbd-client ~]# rbd list
  2. Following are the two options to map the image:
    • Map an image name to a kernel module:

      Syntax

      rbd device map POOL_NAME/IMAGE_NAME --id USER_NAME

      Example

      [root@rbd-client ~]# rbd device map rbd/myimage --id admin
    • Specify a secret when using cephx authentication by either the keyring or a file containing the secret:

      Syntax

      [root@rbd-client ~]# rbd device map POOL_NAME/IMAGE_NAME --id USER_NAME --keyring PATH_TO_KEYRING

      or

      [root@rbd-client ~]# rbd device map POOL_NAME/IMAGE_NAME --id USER_NAME --keyfile PATH_TO_FILE