3 ======================================================
4 ceph-bluestore-tool -- bluestore administrative tool
5 ======================================================
7 .. program:: ceph-bluestore-tool
12 | **ceph-bluestore-tool** *command*
13 [ --dev *device* ... ]
16 [ --log-file | -l *filename* ]
18 | **ceph-bluestore-tool** fsck|repair --path *osd path* [ --deep ]
19 | **ceph-bluestore-tool** show-label --dev *device* ...
20 | **ceph-bluestore-tool** prime-osd-dir --dev *device* --path *osd path*
21 | **ceph-bluestore-tool** bluefs-export --path *osd path* --out-dir *dir*
22 | **ceph-bluestore-tool** bluefs-bdev-new-wal --path *osd path* --dev-target *new-device*
23 | **ceph-bluestore-tool** bluefs-bdev-new-db --path *osd path* --dev-target *new-device*
24 | **ceph-bluestore-tool** bluefs-bdev-migrate --path *osd path* --dev-target *new-device* --devs-source *device1* [--devs-source *device2*]
25 | **ceph-bluestore-tool** free-dump|free-score --path *osd path* [ --allocator block/bluefs-wal/bluefs-db/bluefs-slow ]
31 **ceph-bluestore-tool** is a utility to perform low-level administrative
32 operations on a BlueStore instance.
41 :command:`fsck` [ --deep ]
43 run consistency check on BlueStore metadata. If *--deep* is specified, also read all object data and verify checksums.
47 Run a consistency check *and* repair any errors we can.
49 :command:`bluefs-export`
51 Export the contents of BlueFS (i.e., rocksdb files) to an output directory.
53 :command:`bluefs-bdev-sizes` --path *osd path*
55 Print the device sizes, as understood by BlueFS, to stdout.
57 :command:`bluefs-bdev-expand` --path *osd path*
59 Instruct BlueFS to check the size of its block devices and, if they have expanded, make use of the additional space.
61 :command:`bluefs-bdev-new-wal` --path *osd path* --dev-target *new-device*
63 Adds WAL device to BlueFS, fails if WAL device already exists.
65 :command:`bluefs-bdev-new-db` --path *osd path* --dev-target *new-device*
67 Adds DB device to BlueFS, fails if DB device already exists.
69 :command:`bluefs-bdev-migrate` --dev-target *new-device* --devs-source *device1* [--devs-source *device2*]
71 Moves BlueFS data from source device(s) to the target one, source devices
72 (except the main one) are removed on success. Target device can be both
73 already attached or new device. In the latter case it's added to OSD
74 replacing one of the source devices. Following replacement rules apply
75 (in the order of precedence, stop on the first match):
77 - if source list has DB volume - target device replaces it.
78 - if source list has WAL volume - target device replace it.
79 - if source list has slow volume only - operation isn't permitted, requires explicit allocation via new-db/new-wal command.
81 :command:`show-label` --dev *device* [...]
85 :command:`free-dump` --path *osd path* [ --allocator block/bluefs-wal/bluefs-db/bluefs-slow ]
87 Dump all free regions in allocator.
89 :command:`free-score` --path *osd path* [ --allocator block/bluefs-wal/bluefs-db/bluefs-slow ]
91 Give a [0-1] number that represents quality of fragmentation in allocator.
92 0 represents case when all free space is in one chunk. 1 represents worst possible fragmentation.
97 .. option:: --dev *device*
99 Add *device* to the list of devices to consider
101 .. option:: --devs-source *device*
103 Add *device* to the list of devices to consider as sources for migrate operation
105 .. option:: --dev-target *device*
107 Specify target *device* migrate operation or device to add for adding new DB/WAL.
109 .. option:: --path *osd path*
111 Specify an osd path. In most cases, the device list is inferred from the symlinks present in *osd path*. This is usually simpler than explicitly specifying the device(s) with --dev.
113 .. option:: --out-dir *dir*
115 Output directory for bluefs-export
117 .. option:: -l, --log-file *log file*
121 .. option:: --log-level *num*
123 debug log level. Default is 30 (extremely verbose), 20 is very
124 verbose, 10 is verbose, and 1 is not very verbose.
128 deep scrub/repair (read and validate object data, not just metadata)
130 .. option:: --allocator *name*
132 Useful for *free-dump* and *free-score* actions. Selects allocator(s).
137 Every BlueStore block device has a single block label at the beginning of the
138 device. You can dump the contents of the label with::
140 ceph-bluestore-tool show-label --dev *device*
142 The main device will have a lot of metadata, including information
143 that used to be stored in small files in the OSD data directory. The
144 auxiliary devices (db and wal) will only have the minimum required
145 fields (OSD UUID, size, device type, birth time).
147 OSD directory priming
148 =====================
150 You can generate the content for an OSD data directory that can start up a
151 BlueStore OSD with the *prime-osd-dir* command::
153 ceph-bluestore-tool prime-osd-dir --dev *main device* --path /var/lib/ceph/osd/ceph-*id*
159 **ceph-bluestore-tool** is part of Ceph, a massively scalable,
160 open-source, distributed storage system. Please refer to the Ceph
161 documentation at http://ceph.com/docs for more information.
167 :doc:`ceph-osd <ceph-osd>`\(8)