2012-11-01 22:56:04 +00:00
|
|
|
==========================
|
|
|
|
Kernel Module Operations
|
|
|
|
==========================
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2013-06-14 23:57:31 +00:00
|
|
|
.. index:: Ceph Block Device; kernel module
|
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
.. important:: To use kernel module operations, you must have a running Ceph cluster.
|
2012-06-19 17:10:51 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
Get a List of Images
|
|
|
|
====================
|
2012-07-03 15:46:14 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
To mount a block device image, first return a list of the images. ::
|
2012-07-03 15:46:14 +00:00
|
|
|
|
|
|
|
rbd list
|
|
|
|
|
2012-09-18 20:00:07 +00:00
|
|
|
Map a Block Device
|
|
|
|
==================
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
Use ``rbd`` to map an image name to a kernel module. You must specify the
|
2014-04-18 17:19:27 +00:00
|
|
|
image name, the pool name, and the user name. ``rbd`` will load RBD kernel
|
|
|
|
module on your behalf if it's not already loaded. ::
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2015-07-17 09:41:29 +00:00
|
|
|
sudo rbd map {pool-name}/{image-name} --id {user-name}
|
2012-07-02 15:35:10 +00:00
|
|
|
|
|
|
|
For example::
|
|
|
|
|
2015-07-17 09:41:29 +00:00
|
|
|
sudo rbd map rbd/myimage --id admin
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
If you use `cephx`_ authentication, you must also specify a secret. It may come
|
|
|
|
from a keyring or a file containing the secret. ::
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2015-07-17 09:41:29 +00:00
|
|
|
sudo rbd map rbd/myimage --id admin --keyring /path/to/keyring
|
|
|
|
sudo rbd map rbd/myimage --id admin --keyfile /path/to/file
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2012-07-03 15:46:14 +00:00
|
|
|
Show Mapped Block Devices
|
2012-09-18 20:00:07 +00:00
|
|
|
=========================
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
To show block device images mapped to kernel modules with the ``rbd`` command,
|
2012-07-03 15:46:14 +00:00
|
|
|
specify the ``showmapped`` option. ::
|
|
|
|
|
2014-04-18 17:18:29 +00:00
|
|
|
rbd showmapped
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2012-07-02 15:35:10 +00:00
|
|
|
Unmapping a Block Device
|
2012-09-18 20:00:07 +00:00
|
|
|
========================
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2014-04-18 17:18:29 +00:00
|
|
|
To unmap a block device image with the ``rbd`` command, specify the ``unmap``
|
2012-11-01 22:56:04 +00:00
|
|
|
option and the device name (i.e., by convention the same as the block device
|
|
|
|
image name). ::
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-07-02 15:55:36 +00:00
|
|
|
sudo rbd unmap /dev/rbd/{poolname}/{imagename}
|
2012-07-02 15:35:10 +00:00
|
|
|
|
|
|
|
For example::
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2012-07-02 15:55:36 +00:00
|
|
|
sudo rbd unmap /dev/rbd/rbd/foo
|
2012-11-01 22:56:04 +00:00
|
|
|
|
|
|
|
|
2012-12-03 20:22:37 +00:00
|
|
|
.. _cephx: ../../rados/operations/authentication/
|