Skip to content

fxzxmicah/device-mapper-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

device-mapper-service

device-mapper-service provides a systemd template unit for creating device-mapper devices from table files stored in /etc/device-mapper.

The package is split into two RPMs:

  • device-mapper-service installs device-mapper@.service and owns /etc/device-mapper.
  • device-mapper-service-generator installs dm-create, a helper that writes table files and starts the matching service instance.

Table Files

Each device is described by a table file named:

/etc/device-mapper/NAME.table

Start a configured device with:

systemctl enable --now device-mapper@NAME.service

Stop it with:

systemctl disable --now device-mapper@NAME.service

If the mapped device contains a partition table, the service asks partx to add the partition devices. Devices without a partition table are valid too; in that case partx reports that no partition table can be read and the service continues.

Generating a Table

Install the generator subpackage, then run:

dm-create NAME DEV1 DEV2...

For example:

dm-create faststripe /dev/sdb /dev/sdc

dm-create creates /etc/device-mapper/faststripe.table, reloads systemd, and starts device-mapper@faststripe.service.

The stripe chunk size is controlled by CHUNK_SECTORS and defaults to 256 sectors:

CHUNK_SECTORS=512 dm-create faststripe /dev/sdb /dev/sdc

Building

The project uses Meson only to configure and install template files:

meson setup build
meson compile -C build
meson install -C build

About

Device-mapper table service

Topics

Resources

License

Stars

Watchers

Forks

Contributors