1

I have a Ceph system with 8 OSD's and 8 disks mapped 1:1.

One of the disks is giving me smart errors and I would like to replace it.

How do I know which physical disk is mapped to which OSD?

2 Answers 2

3

You can use ceph device ls (alternatively ceph device ls-by-host <host> or by daemon) to see the mapping of host, OSD and device, including block.db devices in cases you have the rocksDB/WAL on faster devices.

3
  • Just saved me several hours mapping out my OSDs; thank you!
    – avluis
    Commented May 20 at 0:58
  • Combined this with ledctl and made it dead simple.
    – avluis
    Commented May 20 at 1:06
  • 1
    Awesome! Glad it helped.
    – eblock
    Commented May 20 at 10:40
1

The command ceph-volume lvm list displays all the OSD's with the corresponding devices.

See https://docs.ceph.com/en/latest/man/8/ceph-volume/#list for more information.

List devices or logical volumes associated with Ceph. An association is determined if a device has information relating to an OSD. This is verified by querying LVM’s metadata and correlating it with devices.

The lvs associated with the OSD need to have been prepared previously by ceph-volume so that all needed tags and metadata exist.

Usage:

ceph-volume lvm list

List a particular device, reporting all metadata about it:

ceph-volume lvm list /dev/sda1

List a logical volume, along with all its metadata (vg is a volume group, and lv the logical volume name):

ceph-volume lvm list {vg/lv}

2
  • 2
    You can also use ceph device ls to see the mapping of host, OSD and device, including block.db devices in cases you have the rocksDB/WAL on faster devices.
    – eblock
    Commented Mar 3, 2023 at 9:54
  • @eblock you are totally right! If you could create an answer with this I can accept it as a solution.
    – Mr. Diba
    Commented Mar 3, 2023 at 10:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .