LLAPI\_GET\_OBD\_COUNT(3) Lustre Library Functions LLAPI\_GET\_OBD\_COUNT(3)

# [NAME](#NAME)

llapi\_get\_obd\_count - get number of MDT/OST targets for Lustre mountpoint

# [SYNOPSIS](#SYNOPSIS)

```
#include <lustre/lustreapi.h>
```

```
int llapi_get_obd_count(char *mnt, int *count, int is_mdt);
```

# [DESCRIPTION](#DESCRIPTION)

**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.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_get\_obd\_count()** returns 0 on success. On failure, it returns a negative errno value.

# [ERRORS](#ERRORS)

[**-ENOENT**](#ENOENT)

The path specified by *mnt* does not exist.

[**-ENOTDIR**](#ENOTDIR)

The path specified by *mnt* is not a directory.

[**-ENOTTY**](#ENOTTY)

The path specified by *mnt* is not on a Lustre filesystem.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_get\_obd\_count()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 1.8.0

# [SEE ALSO](#SEE_ALSO)

[**llapi\_lmv\_get\_uuids**(3)](/man/enterprise-packages/lustre/llapi_lmv_get_uuids.3), [**llapi\_lov\_get\_uuids**(3)](/man/enterprise-packages/lustre/llapi_lov_get_uuids.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2026-02-24 Lustre User API

---

Document: llapi_get_obd_count(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
