OS Manuals

llapi_get_obd_count(3)

llapi_get_obd_count - get number of MDT/OST targets for Lustre mountpoint

LLAPI_GET_OBD_COUNT(3) Lustre Library Functions LLAPI_GET_OBD_COUNT(3)

llapi_get_obd_count - get number of MDT/OST targets for Lustre mountpoint

#include <lustre/lustreapi.h>
int llapi_get_obd_count(char *mnt, int *count, int is_mdt);

llapi_get_obd_count() returns the number of Object Storage Targets (OSTs) or Metadata Targets (MDTs), configured for the Lustre filesystem mounted at mnt.

mnt is the path to the Lustre mount point or a directory within it.

count is a pointer to an integer where the resulting target count will be stored.

is_mdt is a boolean. If non-zero, it returns the MDT count; if zero, it returns the OST count.

llapi_get_obd_count() returns 0 on success. On failure, it returns a negative errno value.

The path specified by mnt does not exist.
The path specified by mnt is not a directory.
The path specified by mnt is not on a Lustre filesystem.

llapi_get_obd_count() is part of the lustre(7) user application interface library since release 1.8.0

llapi_lmv_get_uuids(3), llapi_lov_get_uuids(3), lustreapi(7)

2026-02-24 Lustre User API

lustre 2.17.59-r1 · enterprise-packages · ingested 2026-10-02