File: README.md

package info (click to toggle)
libblockdev 3.3.0-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,272 kB
  • sloc: ansic: 25,314; python: 13,388; makefile: 663; sh: 503; xml: 146
file content (81 lines) | stat: -rw-r--r-- 3,026 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
### CI status

<img alt="CI status" src="https://fedorapeople.org/groups/storage_apis/statuses/libblockdev-master.svg" width="100%" height="350ex" />

### Introduction

libblockdev is a C library supporting GObject introspection for manipulation of
block devices. It has a plugin-based architecture where each technology (like
LVM, Btrfs, MD RAID, Swap,...) is implemented in a separate plugin, possibly
with multiple implementations (e.g. using LVM CLI or the new LVM DBus API).

#### Features

Following storage technologies are supported by libblockdev

 - partitions
   - MSDOS, GPT
 - filesystem operations
   - ext2, ext3, ext4, xfs, vfat, ntfs, exfat, btrfs, f2fs, nilfs2, udf
   - mounting
 - LVM
   - thin provisioning, LVM RAID, cache, LVM VDO
 - BTRFS
   - multi-device volumes, subvolumes, snapshots
 - swap
 - encryption
   - LUKS, TrueCrypt/VeraCrypt, BitLocker, FileVault2
   - integrity
   - SED OPAL
 - DM (device mapper)
 - loop devices
 - MD RAID
 - multipath
 - s390
   - DASD, zFCP
 - NVDIMM namespaces (deprecated)
 - NVMe
 - SMART

#### Architecture

The library itself is only a thin wrapper around a set of plugins, each for a
particular technology listed above. The library provides an API consisting of
sets of functions provided by its plugins. For example, there is a
symbol/function called ``bd_lvm_lvcreate`` provided by the library which is
dynamically loaded from the LVM plugin when the library's ``bd_init`` function
will be called. Initially all those functions are no-ops just printing a warning
on stderr and doing nothing. This way applications using the library won't
crash, the operations just won't be run. Of course, the library
has ``bd_is_plugin_available``, which allows applications to check if something
is provided/implemented or not.

#### Technologies behind the library

The library is written in C using the GLib library. The GLib library provides a
lot of handy utilities that may be used by the library (no need for a new
implementation of hash tables, lists, etc.) and moreover, it should be really
easy to create bindings for the library via GObject introspection that works
even with "not OOP" code. However, instead of returning links to structs
(e.g. as a return value of the ``bd_lvm_vginfo`` function) it will return
references to GObjects with attributes/properties and access methods. The reason
is again an easy way to create bindings which we get for free.

### License

The libblockdev code is licensed under LGPL 2.1 or later, see [LICENSE](LICENSE)
for full text of the license.

### Development

For developer documentation see [README.DEVEL.md](README.DEVEL.md).

API documentation is available at [https://storaged.org/libblockdev](https://storaged.org/libblockdev).

#### Branches and supported versions

The currently actively developed and supported version is 3.x on the *main* branch.
New features should target this release.

The older 2.x version available on the *2.x-branch* is still supported but new features
are not planned for this release.