---
name: "libvslvm"
section: "3"
platform: "linux"
package: "libvslvm-dev"
version: "20240504-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libvslvm"
---

# libvslvm(3)

Library to access the Linux Logical Volume Manager (LVM) volume system

## NAME

**libvslvm.h** – Library to access the Linux Logical Volume Manager (LVM) volume system

## SYNOPSIS

**#include \<libvslvm.h\>**

Support functions

*const* *char* *\**\

**libvslvm\_get\_version**(*void*);

*int*\

**libvslvm\_get\_access\_flags\_read\_write**(*void*);

*int*\

**libvslvm\_get\_access\_flags\_write**(*void*);

*int*\

**libvslvm\_get\_codepage**(*int \*codepage*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_set\_codepage**(*int codepage*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_check\_volume\_signature**(*const char \*filename*, *libvslvm\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libvslvm\_check\_volume\_signature\_wide**(*const wchar\_t \*filename*, *libvslvm\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libvslvm\_check\_volume\_signature\_file\_io\_handle**(*libbfio\_handle\_t \*file\_io\_handle*, *libvslvm\_error\_t \*\*error*);

Notify functions

*void*\

**libvslvm\_notify\_set\_verbose**(*int verbose*);

*int*\

**libvslvm\_notify\_set\_stream**(*FILE \*stream*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_notify\_stream\_open**(*const char \*filename*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_notify\_stream\_close**(*libvslvm\_error\_t \*\*error*);

Error functions

*void*\

**libvslvm\_error\_free**(*libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_error\_fprint**(*libvslvm\_error\_t \*error*, *FILE \*stream*);

*int*\

**libvslvm\_error\_sprint**(*libvslvm\_error\_t \*error*, *char \*string*, *size\_t size*);

*int*\

**libvslvm\_error\_backtrace\_fprint**(*libvslvm\_error\_t \*error*, *FILE \*stream*);

*int*\

**libvslvm\_error\_backtrace\_sprint**(*libvslvm\_error\_t \*error*, *char \*string*, *size\_t size*);

Handle functions

*int*\

**libvslvm\_handle\_initialize**(*libvslvm\_handle\_t \*\*handle*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_free**(*libvslvm\_handle\_t \*\*handle*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_signal\_abort**(*libvslvm\_handle\_t \*handle*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_open**(*libvslvm\_handle\_t \*handle*, *const char \*filename*, *int access\_flags*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_open\_physical\_volume\_files**(*libvslvm\_handle\_t \*handle*, *char \* const filenames\[\]*, *int number\_of\_filenames*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_close**(*libvslvm\_handle\_t \*handle*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_get\_volume\_group**(*libvslvm\_handle\_t \*handle*, *libvslvm\_volume\_group\_t \*\*volume\_group*, *libvslvm\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libvslvm\_handle\_open\_wide**(*libvslvm\_handle\_t \*handle*, *const wchar\_t \*filename*, *int access\_flags*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_open\_physical\_volume\_files\_wide**(*libvslvm\_handle\_t \*handle*, *wchar\_t \* const filenames\[\]*, *int number\_of\_filenames*, *libvslvm\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libvslvm\_handle\_open\_file\_io\_handle**(*libvslvm\_handle\_t \*handle*, *libbfio\_handle\_t \*file\_io\_handle*, *int access\_flags*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_handle\_open\_physical\_volume\_files\_file\_io\_pool**(*libvslvm\_handle\_t \*handle*, *libbfio\_pool\_t \*file\_io\_pool*, *libvslvm\_error\_t \*\*error*);

Volume group functions

*int*\

**libvslvm\_volume\_group\_free**(*libvslvm\_volume\_group\_t \*\*volume\_group*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_name\_size**(*libvslvm\_volume\_group\_t \*volume\_group*, *size\_t \*name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_name**(*libvslvm\_volume\_group\_t \*volume\_group*, *char \*name*, *size\_t name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_identifier\_size**(*libvslvm\_volume\_group\_t \*volume\_group*, *size\_t \*identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_identifier**(*libvslvm\_volume\_group\_t \*volume\_group*, *char \*identifier*, *size\_t identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_sequence\_number**(*libvslvm\_volume\_group\_t \*volume\_group*, *uint32\_t \*sequence\_number*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_extent\_size**(*libvslvm\_volume\_group\_t \*volume\_group*, *size64\_t \*extent\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_number\_of\_physical\_volumes**(*libvslvm\_volume\_group\_t \*volume\_group*, *int \*number\_of\_physical\_volumes*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_physical\_volume**(*libvslvm\_volume\_group\_t \*volume\_group*, *int volume\_index*, *libvslvm\_physical\_volume\_t \*\*physical\_volume*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_physical\_volume\_by\_name**(*libvslvm\_volume\_group\_t \*volume\_group*, *const char \*volume\_name*, *size\_t volume\_name\_length*, *libvslvm\_physical\_volume\_t \*\*physical\_volume*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_number\_of\_logical\_volumes**(*libvslvm\_volume\_group\_t \*volume\_group*, *int \*number\_of\_logical\_volumes*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_volume\_group\_get\_logical\_volume**(*libvslvm\_volume\_group\_t \*volume\_group*, *int volume\_index*, *libvslvm\_logical\_volume\_t \*\*logical\_volume*, *libvslvm\_error\_t \*\*error*);

Physical volume functions

*int*\

**libvslvm\_physical\_volume\_free**(*libvslvm\_physical\_volume\_t \*\*physical\_volume*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_name\_size**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *size\_t \*name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_name**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *char \*name*, *size\_t name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_identifier\_size**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *size\_t \*identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_identifier**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *char \*identifier*, *size\_t identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_device\_path\_size**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *size\_t \*device\_path\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_device\_path**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *char \*device\_path*, *size\_t device\_path\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_physical\_volume\_get\_size**(*libvslvm\_physical\_volume\_t \*physical\_volume*, *size64\_t \*size*, *libvslvm\_error\_t \*\*error*);

Logical volume functions

*int*\

**libvslvm\_logical\_volume\_free**(*libvslvm\_logical\_volume\_t \*\*logical\_volume*, *libvslvm\_error\_t \*\*error*);

*ssize\_t*\

**libvslvm\_logical\_volume\_read\_buffer**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *void \*buffer*, *size\_t buffer\_size*, *libvslvm\_error\_t \*\*error*);

*ssize\_t*\

**libvslvm\_logical\_volume\_read\_buffer\_at\_offset**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libvslvm\_error\_t \*\*error*);

*off64\_t*\

**libvslvm\_logical\_volume\_seek\_offset**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *off64\_t offset*, *int whence*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_offset**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *off64\_t \*offset*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_size**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *size64\_t \*size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_name\_size**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *size\_t \*name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_name**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *char \*name*, *size\_t name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_identifier\_size**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *size\_t \*identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_identifier**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *char \*identifier*, *size\_t identifier\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_number\_of\_segments**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *int \*number\_of\_segments*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_logical\_volume\_get\_segment**(*libvslvm\_logical\_volume\_t \*logical\_volume*, *int segment\_index*, *libvslvm\_segment\_t \*\*segment*, *libvslvm\_error\_t \*\*error*);

Segment functions

*int*\

**libvslvm\_segment\_free**(*libvslvm\_segment\_t \*\*segment*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_segment\_get\_offset**(*libvslvm\_segment\_t \*segment*, *off64\_t \*offset*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_segment\_get\_size**(*libvslvm\_segment\_t \*segment*, *size64\_t \*size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_segment\_get\_number\_of\_stripes**(*libvslvm\_segment\_t \*segment*, *int \*number\_of\_stripes*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_segment\_get\_stripe**(*libvslvm\_segment\_t \*segment*, *int stripe\_index*, *libvslvm\_stripe\_t \*\*stripe*, *libvslvm\_error\_t \*\*error*);

Stripe functions

*int*\

**libvslvm\_stripe\_free**(*libvslvm\_stripe\_t \*\*stripe*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_stripe\_get\_physical\_volume\_name\_size**(*libvslvm\_stripe\_t \*stripe*, *size\_t \*physical\_volume\_name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_stripe\_get\_physical\_volume\_name**(*libvslvm\_stripe\_t \*stripe*, *char \*physical\_volume\_name*, *size\_t physical\_volume\_name\_size*, *libvslvm\_error\_t \*\*error*);

*int*\

**libvslvm\_stripe\_get\_data\_area\_offset**(*libvslvm\_stripe\_t \*stripe*, *off64\_t \*data\_area\_offset*, *libvslvm\_error\_t \*\*error*);

## DESCRIPTION

The **libvslvm\_get\_version**() function is used to retrieve the library version.

## RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libvslvm.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

libvslvm can be compiled with wide character support (wchar\_t).

To compile libvslvm with wide character support use: *./configure* *--enable-wide-character-type=yes*\
  or define: *\_UNICODE*\
  or *UNICODE*\
  during compilation.

*LIBVSLVM\_WIDE\_CHARACTER\_TYPE*\
  in libvslvm/features.h can be used to determine if libvslvm was compiled with wide character support.

## BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libvslvm/issues

## AUTHOR

These man pages are generated from "libvslvm.h".

## COPYRIGHT

Copyright (C) 2014-2024, Joachim Metz \<joachim.metz@gmail.com\>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

the libvslvm.h include file
