---
name: "dpm_addfs"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dpm_addfs"
---

# dpm\_addfs(3)

add a filesystem to a disk pool

## NAME

dpm\_addfs - add a filesystem to a disk pool

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "dpm\_api.h"**

**int dpm\_addfs (char \****poolname***,** **char \****server***,** **char \****fs***,** **int** *status***,** **int** *weight***)**

## DESCRIPTION

**dpm\_addfs** adds a filesystem to a disk pool.

- *poolname*

  specifies the disk pool name previously defined using **dpm\_addpool**.

- *server*

  specifies the host name of the disk server where this filesystem is mounted.

- *fs*

  specifies the mount point of the dedicated filesystem.

- *status*

  Initial status of this filesystem. It can be set to 0 or **FS\_DISABLED** or **FS\_RDONLY**.

- *weight*

  specifies the weight of the filesystem. This is used during the filesystem selection. The value must be positive. A negative value will tell the server to allocate the default weight value (1). It is recommended to use a value lower than 10.

This function requires ADMIN privilege.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **ENOENT**

  Filesystem does not exist.

- **EACCES**

  The caller does not have ADMIN privilege.

- **EFAULT**

  *poolname*, *server* or *fs* is a NULL pointer.

- **EEXIST**

  this filesystem is already part of a pool.

- **ENOMEM**

  Memory could not be allocated for storing the filesystem definition.

- **EINVAL**

  The pool is unknown or the length of *poolname* exceeds **CA\_MAXPOOLNAMELEN** or the length of *server* exceeds **CA\_MAXHOSTNAMELEN** or the length of *fs* exceeds 79.

- **SENOSHOST**

  Host unknown.

- **SEINTERNAL**

  Database error.

- **SECOMERR**

  Communication error.
