]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | ========================== |
2 | Kernel Module Operations | |
3 | ========================== | |
4 | ||
5 | .. index:: Ceph Block Device; kernel module | |
6 | ||
7 | .. important:: To use kernel module operations, you must have a running Ceph cluster. | |
8 | ||
9 | Get a List of Images | |
10 | ==================== | |
11 | ||
12 | To mount a block device image, first return a list of the images. :: | |
13 | ||
14 | rbd list | |
15 | ||
16 | Map a Block Device | |
17 | ================== | |
18 | ||
19 | Use ``rbd`` to map an image name to a kernel module. You must specify the | |
20 | image name, the pool name, and the user name. ``rbd`` will load RBD kernel | |
21 | module on your behalf if it's not already loaded. :: | |
22 | ||
11fdf7f2 | 23 | sudo rbd device map {pool-name}/{image-name} --id {user-name} |
7c673cae FG |
24 | |
25 | For example:: | |
26 | ||
11fdf7f2 | 27 | sudo rbd device map rbd/myimage --id admin |
7c673cae FG |
28 | |
29 | If you use `cephx`_ authentication, you must also specify a secret. It may come | |
30 | from a keyring or a file containing the secret. :: | |
31 | ||
11fdf7f2 TL |
32 | sudo rbd device map rbd/myimage --id admin --keyring /path/to/keyring |
33 | sudo rbd device map rbd/myimage --id admin --keyfile /path/to/file | |
7c673cae FG |
34 | |
35 | ||
36 | Show Mapped Block Devices | |
37 | ========================= | |
38 | ||
11fdf7f2 TL |
39 | To show block device images mapped to kernel modules with the ``rbd``, |
40 | specify ``device list`` arguments. :: | |
7c673cae | 41 | |
11fdf7f2 | 42 | rbd device list |
7c673cae FG |
43 | |
44 | ||
45 | Unmapping a Block Device | |
11fdf7f2 | 46 | ======================== |
7c673cae | 47 | |
11fdf7f2 TL |
48 | To unmap a block device image with the ``rbd`` command, specify the |
49 | ``device unmap`` arguments and the device name (i.e., by convention the | |
50 | same as the block device image name). :: | |
51 | ||
52 | sudo rbd device unmap /dev/rbd/{poolname}/{imagename} | |
7c673cae | 53 | |
7c673cae FG |
54 | For example:: |
55 | ||
11fdf7f2 | 56 | sudo rbd device unmap /dev/rbd/rbd/foo |
7c673cae FG |
57 | |
58 | ||
59 | .. _cephx: ../../rados/operations/user-management/ |