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
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
sudo rbd device map {pool-name}/{image-name} --id {user-name}
|
2012-07-02 15:35:10 +00:00
|
|
|
|
|
|
|
For example::
|
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
sudo rbd device 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
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
sudo rbd device map rbd/myimage --id admin --keyring /path/to/keyring
|
|
|
|
sudo rbd device 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
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
To show block device images mapped to kernel modules with the ``rbd``,
|
|
|
|
specify ``device list`` arguments. ::
|
2012-07-03 15:46:14 +00:00
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
rbd device list
|
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
|
2017-12-28 16:53:46 +00:00
|
|
|
========================
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
To unmap a block device image with the ``rbd`` command, specify the
|
|
|
|
``device unmap`` arguments and the device name (i.e., by convention the
|
|
|
|
same as the block device image name). ::
|
|
|
|
|
|
|
|
sudo rbd device unmap /dev/rbd/{poolname}/{imagename}
|
2012-07-02 15:35:10 +00:00
|
|
|
|
|
|
|
For example::
|
2012-05-31 22:35:33 +00:00
|
|
|
|
2017-12-28 16:53:46 +00:00
|
|
|
sudo rbd device unmap /dev/rbd/rbd/foo
|
2012-11-01 22:56:04 +00:00
|
|
|
|
|
|
|
|
2016-10-24 08:46:57 +00:00
|
|
|
.. _cephx: ../../rados/operations/user-management/
|