2012-11-01 22:56:04 +00:00
|
|
|
==========================
|
|
|
|
Kernel Module Operations
|
|
|
|
==========================
|
2012-05-31 22:35:33 +00:00
|
|
|
|
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-07-02 15:35:10 +00:00
|
|
|
Load the Ceph RBD Module
|
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 map a block device image to a kernel module, first load the Ceph RBD module::
|
2012-05-31 22:35:33 +00:00
|
|
|
|
|
|
|
modprobe rbd
|
|
|
|
|
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
|
|
|
|
image name, the pool name, and the user name. ::
|
2012-07-02 15:35:10 +00:00
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
sudo rbd map {image-name} --pool {pool-name} --id {user-name}
|
2012-07-02 15:35:10 +00:00
|
|
|
|
|
|
|
For example::
|
|
|
|
|
2012-11-06 17:13:54 +00:00
|
|
|
sudo rbd map foo --pool 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
|
|
|
|
2012-12-20 19:39:41 +00:00
|
|
|
sudo rbd map --pool rbd myimage --id admin --keyring /path/to/keyring
|
|
|
|
sudo rbd map --pool 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. ::
|
|
|
|
|
|
|
|
sudo 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
|
|
|
|
2012-11-01 22:56:04 +00:00
|
|
|
To unmap a block device image with the ``rbd`` command, specify the ``rm``
|
|
|
|
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/
|