Fixing lost objects

Use the ceph-objectstore-tool utility to list and fix lost and unfound legacy objects that are stored within a Ceph OSD.

Before you begin

  • Root-level access to the Ceph OSD node.
  • Stopping the ceph-osd daemon.

About this task

Note: This procedure applies only to legacy objects.

Procedure

  1. Verify that the appropriate OSD is down.
    systemctl status ceph-osd@OSD_NUMBER
    For example,
    [root@host01 ~]# systemctl status ceph-osd@1
  2. Log in to the OSD container.
    cephadm shell --name osd.OSD_ID
    For example,
    [root@host01 ~]# cephadm shell --name osd.0
  3. List all lost legacy objects.
    ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost --dry-run
    For example,
    [ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost --dry-run
  4. Fix the lost and unfound objects by using the ceph-objectstore-tool utility.
    Use the following procedures, depending on the circumstance.
    • Fix all lost objects.
      ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost
      For example,
      [ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost
    • Fix all lost objects within a placement group.
      ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID --op fix-lost
      For example,
      [ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op fix-lost
    • Fix a lost object by its identifier.
      ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost OBJECT_ID
      For example,
      [ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost default.region