Menu Close

Red Hat Training

A Red Hat training course is available for Red Hat Ceph Storage

Chapter 6. Kernel Module Operations

Important

To use kernel module operations, you must have a running Ceph cluster.

Important

Clients on Linux distributions aside from Red Hat Enterprise Linux (RHEL) are permitted but not supported. If there are issues found in the cluster (e.g. the MDS) when using these clients, Red Hat will address them, but if the cause is found to be on the client side, the issue will have to be addressed by the kernel vendor.

6.1. Getting a List of Images

To mount a block device image, first return a list of the images.

To do so, execute the following:

[root@rbd-client ~]# rbd list

6.2. Mapping Block Devices

Use rbd 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.

To do so, execute the following:

[root@rbd-client ~]# rbd map {image-name} --pool {pool-name} --id {user-name}

For example:

[root@rbd-client ~]# rbd map --pool rbd myimage --id admin

If you use cephx authentication, you must also specify a secret. It may come from a keyring or a file containing the secret.

To do so, execute the following:

[root@rbd-client ~]# rbd map --pool rbd myimage --id admin --keyring /path/to/keyring
[root@rbd-client ~]# rbd map --pool rbd myimage --id admin --keyfile /path/to/file

6.3. Showing Mapped Block Devices

To show block device images mapped to kernel modules with the rbd command, specify the showmapped option.

To do so, execute the following:

[root@rbd-client ~]# rbd showmapped

6.4. Unmapping a Block Device

To unmap a block device image with the rbd command, specify the unmap option and the device name (by convention the same as the block device image name).

To do so, execute the following:

[root@rbd-client ~]# rbd unmap /dev/rbd/{poolname}/{imagename}

For example:

[root@rbd-client ~]# rbd unmap /dev/rbd/rbd/foo