├── .gitignore ├── .gitlab-ci.yml ├── COPYING ├── COPYING.BSD ├── COPYING.LIB ├── INSTALL ├── Makefile.in ├── README ├── TESTING ├── VERSION ├── VERSION_DM ├── WHATS_NEW ├── WHATS_NEW_DM ├── acinclude.m4 ├── aclocal.m4 ├── autoconf ├── config.guess ├── config.sub ├── install-sh └── py-compile ├── base ├── Makefile ├── data-struct │ ├── hash.c │ ├── hash.h │ ├── list.c │ ├── list.h │ ├── radix-tree-adaptive.c │ ├── radix-tree-simple.c │ ├── radix-tree.c │ └── radix-tree.h └── memory │ ├── container_of.h │ └── zalloc.h ├── conf ├── .gitignore ├── Makefile.in ├── cache-mq.profile ├── cache-smq.profile ├── command_profile_template.profile.in ├── example.conf.in ├── lvmdbusd.profile ├── lvmlocal.conf.in ├── metadata_profile_template.profile.in ├── thin-generic.profile ├── thin-performance.profile └── vdo-small.profile ├── configure ├── configure.ac ├── coverity └── coverity_model.c ├── daemons ├── Makefile.in ├── cmirrord │ ├── .gitignore │ ├── Makefile.in │ ├── clogd.c │ ├── cluster.c │ ├── cluster.h │ ├── common.h │ ├── compat.c │ ├── compat.h │ ├── functions.c │ ├── functions.h │ ├── link_mon.c │ ├── link_mon.h │ ├── local.c │ ├── local.h │ ├── logging.c │ └── logging.h ├── dmeventd │ ├── .exported_symbols │ ├── .gitignore │ ├── Makefile.in │ ├── dmeventd.c │ ├── dmeventd.h │ ├── libdevmapper-event.c │ ├── libdevmapper-event.h │ ├── libdevmapper-event.pc.in │ └── plugins │ │ ├── Makefile.in │ │ ├── lvm2 │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ ├── dmeventd_lvm.c │ │ └── dmeventd_lvm.h │ │ ├── mirror │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ └── dmeventd_mirror.c │ │ ├── raid │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ └── dmeventd_raid.c │ │ ├── snapshot │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ └── dmeventd_snapshot.c │ │ ├── thin │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ └── dmeventd_thin.c │ │ └── vdo │ │ ├── .exported_symbols │ │ ├── Makefile.in │ │ └── dmeventd_vdo.c ├── lvmdbusd │ ├── .gitignore │ ├── Makefile.in │ ├── __init__.py │ ├── automatedproperties.py │ ├── background.py │ ├── cfg.py │ ├── cmdhandler.py │ ├── fetch.py │ ├── job.py │ ├── loader.py │ ├── lv.py │ ├── lvm_shell_proxy.py.in │ ├── lvmdb.py.in │ ├── lvmdbusd.in │ ├── main.py │ ├── manager.py │ ├── objectmanager.py │ ├── path.py.in │ ├── pv.py │ ├── request.py │ ├── state.py │ ├── udevwatch.py │ ├── utils.py │ └── vg.py ├── lvmlockd │ ├── .gitignore │ ├── Makefile.in │ ├── lvmlockctl.c │ ├── lvmlockd-client.h │ ├── lvmlockd-core.c │ ├── lvmlockd-dlm.c │ ├── lvmlockd-idm.c │ ├── lvmlockd-internal.h │ └── lvmlockd-sanlock.c └── lvmpolld │ ├── .gitignore │ ├── Makefile.in │ ├── lvmpolld-cmd-utils.c │ ├── lvmpolld-cmd-utils.h │ ├── lvmpolld-common.h │ ├── lvmpolld-core.c │ ├── lvmpolld-data-utils.c │ ├── lvmpolld-data-utils.h │ ├── lvmpolld-protocol.h │ └── polling_ops.h ├── device_mapper ├── Makefile ├── all.h ├── datastruct │ └── bitset.c ├── ioctl │ ├── libdm-iface.c │ └── libdm-targets.h ├── libdm-common.c ├── libdm-common.h ├── libdm-config.c ├── libdm-deptree.c ├── libdm-file.c ├── libdm-report.c ├── libdm-string.c ├── libdm-targets.c ├── libdm-timestamp.c ├── misc │ ├── dm-ioctl.h │ ├── dm-log-userspace.h │ ├── dm-logging.h │ ├── dmlib.h │ └── kdev_t.h ├── mm │ ├── pool-debug.c │ ├── pool-fast.c │ └── pool.c ├── raid │ ├── raid_parser.c │ └── target.h ├── regex │ ├── matcher.c │ ├── parse_rx.c │ ├── parse_rx.h │ ├── ttree.c │ └── ttree.h └── vdo │ ├── status.c │ ├── target.h │ ├── vdo_limits.h │ ├── vdo_reader.c │ └── vdo_target.c ├── doc ├── .gitignore ├── Problems.mdwn ├── README.mdwn ├── caching_foreign_vgs.txt ├── example_cmdlib.c ├── index.mdwn ├── kernel │ ├── cache-policies.txt │ ├── cache.txt │ ├── crypt.txt │ ├── delay.txt │ ├── era.txt │ ├── flakey.txt │ ├── integrity.txt │ ├── io.txt │ ├── kcopyd.txt │ ├── linear.txt │ ├── log-writes.txt │ ├── log.txt │ ├── persistent-data.txt │ ├── queue-length.txt │ ├── raid.txt │ ├── service-time.txt │ ├── snapshot.txt │ ├── statistics.txt │ ├── striped.txt │ ├── switch.txt │ ├── thin-provisioning.txt │ ├── uevent.txt │ ├── verity.txt │ ├── zero.txt │ └── zoned.txt ├── local.css ├── lvm-disk-reading.txt ├── lvm2-raid.txt ├── lvm_fault_handling.txt ├── lvmetad_design.txt ├── lvmpolld_overview.txt ├── pvmove_outline.txt ├── refactoring.txt ├── release-notes │ ├── 2.02.178 │ ├── 2.03.24.mdwn │ ├── 2.03.25.mdwn │ ├── 2.03.26.mdwn │ ├── 2.03.27.mdwn │ ├── 2.03.28.mdwn │ ├── 2.03.29.mdwn │ ├── 2.03.30.mdwn │ ├── 2.03.31.mdwn │ ├── 2.03.32.mdwn │ ├── index.mdwn │ ├── legacy.mdwn │ ├── pending.mdwn │ └── template.mdwn ├── tagging.txt ├── testing.txt ├── udev_assembly.txt ├── unit-tests.txt └── vdo.md ├── ikiwiki.setup ├── include ├── .gitignore ├── Makefile.in ├── configure.h.in └── lvm-version.h.in ├── lib ├── Makefile.in ├── activate │ ├── activate.c │ ├── activate.h │ ├── dev_manager.c │ ├── dev_manager.h │ ├── fs.c │ ├── fs.h │ └── targets.h ├── cache │ ├── lvmcache.c │ └── lvmcache.h ├── cache_segtype │ └── cache.c ├── commands │ ├── cmd_enum.h │ ├── toolcontext.c │ └── toolcontext.h ├── config │ ├── config.c │ ├── config.h │ ├── config_settings.h │ └── defaults.h ├── datastruct │ ├── btree.c │ ├── btree.h │ ├── str_list.c │ └── str_list.h ├── device │ ├── bcache-utils.c │ ├── bcache.c │ ├── bcache.h │ ├── dev-cache.c │ ├── dev-cache.h │ ├── dev-dasd.c │ ├── dev-ext-udev-constants.h │ ├── dev-ext.c │ ├── dev-io.c │ ├── dev-luks.c │ ├── dev-lvm1-pool.c │ ├── dev-md.c │ ├── dev-mpath.c │ ├── dev-swap.c │ ├── dev-type.c │ ├── dev-type.h │ ├── dev_util.c │ ├── device-types.h │ ├── device.h │ ├── device_id.c │ ├── device_id.h │ ├── filesystem.c │ ├── filesystem.h │ ├── nvme.c │ ├── online.c │ ├── online.h │ └── parse_vpd.c ├── display │ ├── display.c │ └── display.h ├── error │ └── errseg.c ├── filters │ ├── filter-composite.c │ ├── filter-deviceid.c │ ├── filter-fwraid.c │ ├── filter-md.c │ ├── filter-mpath.c │ ├── filter-partitioned.c │ ├── filter-persistent.c │ ├── filter-regex.c │ ├── filter-signature.c │ ├── filter-sysfs.c │ ├── filter-type.c │ ├── filter-usable.c │ └── filter.h ├── format_text │ ├── archive.c │ ├── archiver.c │ ├── archiver.h │ ├── export.c │ ├── flags.c │ ├── format-text.c │ ├── format-text.h │ ├── import-export.h │ ├── import.c │ ├── import_vsn1.c │ ├── layout.h │ ├── text_export.h │ ├── text_import.h │ └── text_label.c ├── freeseg │ └── freeseg.c ├── integrity │ └── integrity.c ├── label │ ├── hints.c │ ├── hints.h │ ├── label.c │ └── label.h ├── locking │ ├── .exported_symbols │ ├── file_locking.c │ ├── locking.c │ ├── locking.h │ ├── locking_types.h │ ├── lvmlockd.c │ └── lvmlockd.h ├── log │ ├── log.c │ ├── log.h │ └── lvm-logging.h ├── lvmpolld │ ├── lvmpolld-client.c │ ├── lvmpolld-client.h │ └── polldaemon.h ├── metadata │ ├── cache_manip.c │ ├── integrity_manip.c │ ├── lv.c │ ├── lv.h │ ├── lv_alloc.h │ ├── lv_manip.c │ ├── merge.c │ ├── metadata-exported.h │ ├── metadata.c │ ├── metadata.h │ ├── mirror.c │ ├── pool_manip.c │ ├── pv.c │ ├── pv.h │ ├── pv_alloc.h │ ├── pv_list.c │ ├── pv_manip.c │ ├── pv_map.c │ ├── pv_map.h │ ├── raid_manip.c │ ├── segtype.c │ ├── segtype.h │ ├── snapshot_manip.c │ ├── takeover_matrix.h │ ├── thin_manip.c │ ├── vdo_manip.c │ ├── vg.c │ ├── vg.h │ └── writecache_manip.c ├── mirror │ └── mirrored.c ├── misc │ ├── crc.c │ ├── crc.h │ ├── crc_gen.c │ ├── intl.h │ ├── last-path-component.h │ ├── lib.h │ ├── lvm-exec.c │ ├── lvm-exec.h │ ├── lvm-file.c │ ├── lvm-file.h │ ├── lvm-flock.c │ ├── lvm-flock.h │ ├── lvm-globals.c │ ├── lvm-globals.h │ ├── lvm-maths.c │ ├── lvm-maths.h │ ├── lvm-percent.c │ ├── lvm-percent.h │ ├── lvm-signal.c │ ├── lvm-signal.h │ ├── lvm-string.c │ ├── lvm-string.h │ ├── lvm-wrappers.c │ ├── lvm-wrappers.h │ ├── sharedlib.c │ ├── sharedlib.h │ └── util.h ├── mm │ ├── memlock.c │ ├── memlock.h │ └── xlate.h ├── notify │ ├── lvmnotify.c │ └── lvmnotify.h ├── properties │ ├── prop_common.c │ └── prop_common.h ├── raid │ └── raid.c ├── report │ ├── columns-cmdlog.h │ ├── columns-devtypes.h │ ├── columns.h │ ├── properties.c │ ├── properties.h │ ├── report.c │ ├── report.h │ └── values.h ├── snapshot │ └── snapshot.c ├── striped │ └── striped.c ├── thin │ └── thin.c ├── unknown │ └── unknown.c ├── uuid │ ├── uuid.c │ └── uuid.h ├── vdo │ └── vdo.c ├── writecache │ └── writecache.c └── zero │ └── zero.c ├── libdaemon ├── Makefile.in ├── client │ ├── Makefile.in │ ├── config-util.c │ ├── config-util.h │ ├── daemon-client.c │ ├── daemon-client.h │ ├── daemon-io.c │ └── daemon-io.h └── server │ ├── Makefile.in │ ├── daemon-log.c │ ├── daemon-log.h │ ├── daemon-server.c │ ├── daemon-server.h │ └── daemon-stray.h ├── libdm ├── .exported_symbols ├── .exported_symbols.Base ├── .exported_symbols.DM_1_02_100 ├── .exported_symbols.DM_1_02_101 ├── .exported_symbols.DM_1_02_103 ├── .exported_symbols.DM_1_02_104 ├── .exported_symbols.DM_1_02_105 ├── .exported_symbols.DM_1_02_106 ├── .exported_symbols.DM_1_02_107 ├── .exported_symbols.DM_1_02_110 ├── .exported_symbols.DM_1_02_113 ├── .exported_symbols.DM_1_02_124 ├── .exported_symbols.DM_1_02_128 ├── .exported_symbols.DM_1_02_129 ├── .exported_symbols.DM_1_02_131 ├── .exported_symbols.DM_1_02_133 ├── .exported_symbols.DM_1_02_135 ├── .exported_symbols.DM_1_02_138 ├── .exported_symbols.DM_1_02_141 ├── .exported_symbols.DM_1_02_147 ├── .exported_symbols.DM_1_02_172 ├── .exported_symbols.DM_1_02_181 ├── .exported_symbols.DM_1_02_197 ├── .exported_symbols.DM_1_02_202 ├── .exported_symbols.DM_1_02_97 ├── .exported_symbols.DM_1_02_98 ├── .exported_symbols.DM_1_02_99 ├── Makefile.in ├── datastruct │ ├── bitset.c │ ├── hash.c │ └── list.c ├── dm-tools │ ├── .gitignore │ ├── Makefile.in │ ├── dmfilemapd.c │ ├── dmsetup.c │ └── util.h ├── ioctl │ ├── libdm-iface.c │ └── libdm-targets.h ├── libdevmapper.h ├── libdevmapper.pc.in ├── libdm-common.c ├── libdm-common.h ├── libdm-config.c ├── libdm-deptree.c ├── libdm-file.c ├── libdm-report.c ├── libdm-stats.c ├── libdm-string.c ├── libdm-targets.c ├── libdm-timestamp.c ├── make.tmpl.in ├── misc │ ├── dm-ioctl.h │ ├── dm-log-userspace.h │ ├── dm-logging.h │ ├── dmlib.h │ └── kdev_t.h ├── mm │ ├── dbg_malloc.c │ ├── pool-debug.c │ ├── pool-fast.c │ └── pool.c └── regex │ ├── matcher.c │ ├── parse_rx.c │ ├── parse_rx.h │ ├── ttree.c │ └── ttree.h ├── make.tmpl.in ├── man ├── .gitignore ├── Makefile.in ├── blkdeactivate.8_main ├── cmirrord.8_main ├── dmeventd.8_main ├── dmfilemapd.8_main ├── dmsetup.8_main ├── dmstats.8_main ├── fsadm.8_main ├── lvchange.8_des ├── lvchange.8_end ├── lvchange.8_pregen ├── lvconvert.8_des ├── lvconvert.8_end ├── lvconvert.8_pregen ├── lvcreate.8_des ├── lvcreate.8_end ├── lvcreate.8_pregen ├── lvdisplay.8_des ├── lvdisplay.8_end ├── lvdisplay.8_pregen ├── lvextend.8_des ├── lvextend.8_end ├── lvextend.8_pregen ├── lvm-fullreport.8_des ├── lvm-fullreport.8_end ├── lvm-fullreport.8_pregen ├── lvm-lvpoll.8_des ├── lvm-lvpoll.8_end ├── lvm-lvpoll.8_pregen ├── lvm.8_main ├── lvm.conf.5_main ├── lvm_import_vdo.8_main ├── lvmautoactivation.7_main ├── lvmcache.7_main ├── lvmconfig.8_des ├── lvmconfig.8_end ├── lvmconfig.8_pregen ├── lvmdbusd.8_main ├── lvmdevices.8_des ├── lvmdevices.8_end ├── lvmdevices.8_pregen ├── lvmdiskscan.8_des ├── lvmdiskscan.8_end ├── lvmdiskscan.8_pregen ├── lvmdump.8_main ├── lvmlockctl.8_main ├── lvmlockd.8_main ├── lvmpolld.8_main ├── lvmraid.7_main ├── lvmreport.7_main ├── lvmsadc.8_main ├── lvmsar.8_main ├── lvmsystemid.7_main ├── lvmthin.7_main ├── lvmvdo.7_main ├── lvreduce.8_des ├── lvreduce.8_end ├── lvreduce.8_pregen ├── lvremove.8_des ├── lvremove.8_end ├── lvremove.8_pregen ├── lvrename.8_des ├── lvrename.8_end ├── lvrename.8_pregen ├── lvresize.8_des ├── lvresize.8_end ├── lvresize.8_pregen ├── lvs.8_des ├── lvs.8_end ├── lvs.8_pregen ├── lvscan.8_des ├── lvscan.8_end ├── lvscan.8_pregen ├── pvchange.8_des ├── pvchange.8_end ├── pvchange.8_pregen ├── pvck.8_des ├── pvck.8_end ├── pvck.8_pregen ├── pvcreate.8_des ├── pvcreate.8_end ├── pvcreate.8_pregen ├── pvdisplay.8_des ├── pvdisplay.8_end ├── pvdisplay.8_pregen ├── pvmove.8_des ├── pvmove.8_end ├── pvmove.8_pregen ├── pvremove.8_des ├── pvremove.8_end ├── pvremove.8_pregen ├── pvresize.8_des ├── pvresize.8_end ├── pvresize.8_pregen ├── pvs.8_des ├── pvs.8_end ├── pvs.8_pregen ├── pvscan.8_des ├── pvscan.8_end ├── pvscan.8_pregen ├── see_also.end ├── vgcfgbackup.8_des ├── vgcfgbackup.8_end ├── vgcfgbackup.8_pregen ├── vgcfgrestore.8_des ├── vgcfgrestore.8_end ├── vgcfgrestore.8_pregen ├── vgchange.8_des ├── vgchange.8_end ├── vgchange.8_pregen ├── vgck.8_des ├── vgck.8_end ├── vgck.8_pregen ├── vgconvert.8_des ├── vgconvert.8_end ├── vgconvert.8_pregen ├── vgcreate.8_des ├── vgcreate.8_end ├── vgcreate.8_pregen ├── vgdisplay.8_des ├── vgdisplay.8_end ├── vgdisplay.8_pregen ├── vgexport.8_des ├── vgexport.8_end ├── vgexport.8_pregen ├── vgextend.8_des ├── vgextend.8_end ├── vgextend.8_pregen ├── vgimport.8_des ├── vgimport.8_end ├── vgimport.8_pregen ├── vgimportclone.8_des ├── vgimportclone.8_end ├── vgimportclone.8_pregen ├── vgimportdevices.8_des ├── vgimportdevices.8_end ├── vgimportdevices.8_pregen ├── vgmerge.8_des ├── vgmerge.8_end ├── vgmerge.8_pregen ├── vgmknodes.8_des ├── vgmknodes.8_end ├── vgmknodes.8_pregen ├── vgreduce.8_des ├── vgreduce.8_end ├── vgreduce.8_pregen ├── vgremove.8_des ├── vgremove.8_end ├── vgremove.8_pregen ├── vgrename.8_des ├── vgrename.8_end ├── vgrename.8_pregen ├── vgs.8_des ├── vgs.8_end ├── vgs.8_pregen ├── vgscan.8_des ├── vgscan.8_end ├── vgscan.8_pregen ├── vgsplit.8_des ├── vgsplit.8_end └── vgsplit.8_pregen ├── nix ├── README ├── build.sh └── default.nix ├── po ├── Makefile.in ├── de.po ├── lvm2.po └── pogen.h ├── scripts ├── .gitignore ├── Makefile.in ├── VolumeGroup.ocf ├── blk_availability_init_red_hat.in ├── blk_availability_systemd_red_hat.service.in ├── blkdeactivate.sh.in ├── cmirrord_init_red_hat.in ├── code-stats.rb ├── com.redhat.lvmdbus1.conf ├── com.redhat.lvmdbus1.service.in ├── dm_event_systemd_red_hat.service.in ├── dm_event_systemd_red_hat.socket.in ├── fsadm.sh ├── gdbinit ├── lvm-devices-import.path ├── lvm-devices-import.service ├── lvm2-pvscan.service.in ├── lvm2_cmirrord_systemd_red_hat.service.in ├── lvm2_lvmdbusd_systemd_red_hat.service.in ├── lvm2_lvmpolld_init_red_hat.in ├── lvm2_lvmpolld_systemd_red_hat.service.in ├── lvm2_lvmpolld_systemd_red_hat.socket.in ├── lvm2_monitoring_init_red_hat.in ├── lvm2_monitoring_init_rhel4 ├── lvm2_monitoring_systemd_red_hat.service.in ├── lvm2_tmpfiles_red_hat.conf.in ├── lvm2create_initrd │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── lvm2create_initrd │ ├── lvm2create_initrd.8 │ ├── lvm2create_initrd.pod │ └── lvm2udev ├── lvm_import_vdo.sh ├── lvmdump.sh.in ├── lvmlockd.service.in ├── lvmlocks.service.in ├── lvresize_fs_helper.sh ├── relpath.awk └── vgimportclone.sh ├── spec ├── build.inc ├── lvm2.spec ├── macros.inc ├── packages.inc └── source.inc ├── test ├── .gitignore ├── Makefile.in ├── api │ └── dbustest.sh ├── dbus │ ├── lvm_error_inject.py │ ├── lvmdbustest.py │ ├── testlib.py │ └── validatestate.py ├── lib │ ├── aux.sh │ ├── brick-shelltest.h │ ├── check.sh │ ├── dmsecuretest.c │ ├── flavour-ndev-cluster-lvmpolld.sh │ ├── flavour-ndev-cluster.sh │ ├── flavour-ndev-devicesfile.sh │ ├── flavour-ndev-lvmpolld.sh │ ├── flavour-ndev-vanilla.sh │ ├── flavour-udev-cluster-lvmpolld.sh │ ├── flavour-udev-cluster.sh │ ├── flavour-udev-lvmlockd-dlm.sh │ ├── flavour-udev-lvmlockd-idm.sh │ ├── flavour-udev-lvmlockd-sanlock.sh │ ├── flavour-udev-lvmlockd-test.sh │ ├── flavour-udev-lvmpolld.sh │ ├── flavour-udev-vanilla.sh │ ├── get.sh │ ├── harness.c │ ├── idm_inject_failure.c │ ├── inittest.sh │ ├── lvm-wrapper.sh │ ├── lvm_vdo_wrapper.sh │ ├── mke2fs.conf │ ├── not.c │ ├── runner.cpp │ ├── test-corosync-conf │ ├── test-dlm-conf │ ├── test-sanlock-conf │ └── utils.sh ├── shell │ ├── 000-basic.sh │ ├── aa-lvmlockd-dlm-prepare.sh │ ├── aa-lvmlockd-idm-prepare.sh │ ├── aa-lvmlockd-sanlock-prepare.sh │ ├── activate-minor.sh │ ├── activate-missing-segment.sh │ ├── activate-missing.sh │ ├── activate-partial.sh │ ├── activation-skip.sh │ ├── allow-mixed-block-sizes.sh │ ├── autoactivation-metadata.sh │ ├── backup-read-only.sh │ ├── cache-metadata2.sh │ ├── cache-no-discard.sh │ ├── cache-single-options.sh │ ├── cache-single-split.sh │ ├── cache-single-thin.sh │ ├── cache-single-types.sh │ ├── cache-single-usage.sh │ ├── cachevol-cachedevice.sh │ ├── caching-snapshot.sh │ ├── component-cache.sh │ ├── component-mirror.sh │ ├── component-raid.sh │ ├── component-thin.sh │ ├── covercmd.sh │ ├── creation-time.sh │ ├── dev-aliases.sh │ ├── devicesfile-backup.sh │ ├── devicesfile-basic.sh │ ├── devicesfile-devname.sh │ ├── devicesfile-edit.sh │ ├── devicesfile-misc.sh │ ├── devicesfile-realdevs.sh │ ├── devicesfile-refresh.sh │ ├── devicesfile-scan-lvs.sh │ ├── devicesfile-serial.sh │ ├── devicesfile-vpd-ids.sh │ ├── discards-thin.sh │ ├── dmeventd-restart.sh │ ├── dmsecuretest.sh │ ├── dmsetup-integrity-keys.sh │ ├── dmsetup-keyring.sh │ ├── dmstats-create.sh │ ├── dmstats-filemap.sh │ ├── dmstats-group-ungroup-nouserdata.sh │ ├── dmstats-group-ungroup-userdata.sh │ ├── dmstats-group.sh │ ├── dmstats-histogram.sh │ ├── dmstats-precise.sh │ ├── dmstats-report.sh │ ├── dmstats-ungroup.sh │ ├── dmstats-userdata.sh │ ├── dumpconfig.sh │ ├── duplicate-pvs-md0.sh │ ├── duplicate-pvs-md1.sh │ ├── duplicate-pvs-multipath.sh │ ├── duplicate-vgid.sh │ ├── duplicate-vgnames.sh │ ├── duplicate-vgrename.sh │ ├── error-usage.sh │ ├── exported.sh │ ├── fsadm-crypt-fsresize.sh │ ├── fsadm-crypt.sh │ ├── fsadm-renamed.sh │ ├── fsadm.sh │ ├── hints.sh │ ├── idm_fabric_failure.sh │ ├── idm_fabric_failure_half_brain.sh │ ├── idm_fabric_failure_timeout.sh │ ├── idm_ilm_failure.sh │ ├── inconsistent-metadata.sh │ ├── integrity-blocksize-2.sh │ ├── integrity-blocksize-3.sh │ ├── integrity-blocksize.sh │ ├── integrity-caching.sh │ ├── integrity-dmeventd.sh │ ├── integrity-large.sh │ ├── integrity-misc.sh │ ├── integrity-syncaction.sh │ ├── integrity.sh │ ├── large-physical-sector-size.sh │ ├── listings.sh │ ├── lock-blocking.sh │ ├── lock-parallel.sh │ ├── losetup-partscan.sh │ ├── lv-ancestry.sh │ ├── lvchange-cache-mode.sh │ ├── lvchange-cache-old.sh │ ├── lvchange-cache-syncaction-raid.sh │ ├── lvchange-cache.sh │ ├── lvchange-mirror.sh │ ├── lvchange-partial-raid10.sh │ ├── lvchange-partial.sh │ ├── lvchange-raid-transient-failures.sh │ ├── lvchange-raid.sh │ ├── lvchange-raid1-writemostly.sh │ ├── lvchange-raid10.sh │ ├── lvchange-raid456.sh │ ├── lvchange-rebuild-raid.sh │ ├── lvchange-syncaction-raid.sh │ ├── lvchange-thin.sh │ ├── lvchange-vdo.sh │ ├── lvconvert-cache-abort.sh │ ├── lvconvert-cache-chunks.sh │ ├── lvconvert-cache-raid.sh │ ├── lvconvert-cache-smq.sh │ ├── lvconvert-cache-snapshot.sh │ ├── lvconvert-cache-thin.sh │ ├── lvconvert-cache-vdo.sh │ ├── lvconvert-cache.sh │ ├── lvconvert-m-raid1-degraded.sh │ ├── lvconvert-mirror-basic-0.sh │ ├── lvconvert-mirror-basic-1.sh │ ├── lvconvert-mirror-basic-2.sh │ ├── lvconvert-mirror-basic-3.sh │ ├── lvconvert-mirror-basic.sh │ ├── lvconvert-mirror-split.sh │ ├── lvconvert-mirror-updown.sh │ ├── lvconvert-mirror.sh │ ├── lvconvert-raid-allocation.sh │ ├── lvconvert-raid-regionsize.sh │ ├── lvconvert-raid-reshape-linear_to_raid6-single-type.sh │ ├── lvconvert-raid-reshape-linear_to_striped-single-type.sh │ ├── lvconvert-raid-reshape-linear_to_striped.sh │ ├── lvconvert-raid-reshape-load.sh │ ├── lvconvert-raid-reshape-size.sh │ ├── lvconvert-raid-reshape-striped_to_linear-single-type.sh │ ├── lvconvert-raid-reshape-striped_to_linear.sh │ ├── lvconvert-raid-reshape-stripes-load-fail.sh │ ├── lvconvert-raid-reshape-stripes-load-reload.sh │ ├── lvconvert-raid-reshape-stripes-load.sh │ ├── lvconvert-raid-reshape.sh │ ├── lvconvert-raid-restripe-linear.sh │ ├── lvconvert-raid-status-validation.sh │ ├── lvconvert-raid-takeover-alloc-failure.sh │ ├── lvconvert-raid-takeover-linear_to_raid4.sh │ ├── lvconvert-raid-takeover-raid4_to_linear.sh │ ├── lvconvert-raid-takeover-thin.sh │ ├── lvconvert-raid-takeover.sh │ ├── lvconvert-raid.sh │ ├── lvconvert-raid0-striped.sh │ ├── lvconvert-raid0_to_raid10.sh │ ├── lvconvert-raid1-split-trackchanges.sh │ ├── lvconvert-raid10.sh │ ├── lvconvert-raid456.sh │ ├── lvconvert-raid5_to_raid10.sh │ ├── lvconvert-repair-cache.sh │ ├── lvconvert-repair-dmeventd.sh │ ├── lvconvert-repair-mirror.sh │ ├── lvconvert-repair-policy.sh │ ├── lvconvert-repair-raid-dmeventd.sh │ ├── lvconvert-repair-raid.sh │ ├── lvconvert-repair-raid5.sh │ ├── lvconvert-repair-replace.sh │ ├── lvconvert-repair-snapshot.sh │ ├── lvconvert-repair-thin-raid.sh │ ├── lvconvert-repair-thin.sh │ ├── lvconvert-repair-transient-dmeventd.sh │ ├── lvconvert-repair-transient.sh │ ├── lvconvert-repair.sh │ ├── lvconvert-snapshot-cache.sh │ ├── lvconvert-snapshot-mirror.sh │ ├── lvconvert-snapshot-raid.sh │ ├── lvconvert-snapshot-thin.sh │ ├── lvconvert-snapshot.sh │ ├── lvconvert-striped-raid0.sh │ ├── lvconvert-thin-external-cache.sh │ ├── lvconvert-thin-external-stack.sh │ ├── lvconvert-thin-external.sh │ ├── lvconvert-thin-from-thick.sh │ ├── lvconvert-thin-raid.sh │ ├── lvconvert-thin-vdo.sh │ ├── lvconvert-thin.sh │ ├── lvconvert-twostep.sh │ ├── lvconvert-vdo-raid.sh │ ├── lvconvert-vdo.sh │ ├── lvcreate-cache-fail.sh │ ├── lvcreate-cache-no-tools.sh │ ├── lvcreate-cache-raid.sh │ ├── lvcreate-cache-snapshot.sh │ ├── lvcreate-cache.sh │ ├── lvcreate-external-dmeventd.sh │ ├── lvcreate-large-raid.sh │ ├── lvcreate-large-raid10.sh │ ├── lvcreate-large.sh │ ├── lvcreate-mirror.sh │ ├── lvcreate-missing.sh │ ├── lvcreate-operation.sh │ ├── lvcreate-pvtags.sh │ ├── lvcreate-raid-nosync.sh │ ├── lvcreate-raid-volume_list.sh │ ├── lvcreate-raid.sh │ ├── lvcreate-raid1-read-error.sh │ ├── lvcreate-raid10.sh │ ├── lvcreate-repair.sh │ ├── lvcreate-signature-wiping.sh │ ├── lvcreate-small-snap.sh │ ├── lvcreate-striped-mirror.sh │ ├── lvcreate-thin-big.sh │ ├── lvcreate-thin-cache.sh │ ├── lvcreate-thin-external-size.sh │ ├── lvcreate-thin-external-stack.sh │ ├── lvcreate-thin-external.sh │ ├── lvcreate-thin-limits.sh │ ├── lvcreate-thin-power2.sh │ ├── lvcreate-thin-snap.sh │ ├── lvcreate-thin-vdo.sh │ ├── lvcreate-thin.sh │ ├── lvcreate-usage.sh │ ├── lvcreate-vdo-cache.sh │ ├── lvcreate-vdo.sh │ ├── lvdisplay-raid.sh │ ├── lvextend-caches-on-thindata.sh │ ├── lvextend-caches.sh │ ├── lvextend-percent-extents.sh │ ├── lvextend-raid.sh │ ├── lvextend-snapshot-dmeventd.sh │ ├── lvextend-snapshot-policy.sh │ ├── lvextend-thin-adddel.sh │ ├── lvextend-thin-cache.sh │ ├── lvextend-thin-data-dmeventd.sh │ ├── lvextend-thin-full.sh │ ├── lvextend-thin-metadata-dmeventd.sh │ ├── lvextend-thin-raid.sh │ ├── lvextend-thin.sh │ ├── lvextend-vdo-dmeventd.sh │ ├── lvextend-vdo.sh │ ├── lvm-conf-error.sh │ ├── lvm-init.sh │ ├── lvm-on-md.sh │ ├── lvmcache-exercise.sh │ ├── lvmlockd-hello-world.sh │ ├── lvmlockd-lv-types.sh │ ├── lvmlockd_failure.sh │ ├── lvremove-thindata-caches.sh │ ├── lvrename-cache-thin.sh │ ├── lvrename-vdo.sh │ ├── lvresize-btrfs.sh │ ├── lvresize-fs-crypt.sh │ ├── lvresize-fs.sh │ ├── lvresize-full.sh │ ├── lvresize-mirror.sh │ ├── lvresize-raid.sh │ ├── lvresize-raid10.sh │ ├── lvresize-rounding.sh │ ├── lvresize-thin-external-origin.sh │ ├── lvresize-thin-metadata.sh │ ├── lvresize-thin-vdo.sh │ ├── lvresize-usage.sh │ ├── lvresize-vdo.sh │ ├── lvresize-xfs.sh │ ├── lvs-cache.sh │ ├── mda-rollback.sh │ ├── mdata-strings.sh │ ├── metadata-bad-mdaheader.sh │ ├── metadata-bad-text.sh │ ├── metadata-balance.sh │ ├── metadata-full.sh │ ├── metadata-old.sh │ ├── metadata-zero-space.sh │ ├── metadata.sh │ ├── mirror-names.sh │ ├── mirror-vgreduce-removemissing.sh │ ├── missing-pv-unused.sh │ ├── missing-pv.sh │ ├── mlock-no-locking.sh │ ├── multi_hosts_lv_ex_timeout_hosta.sh │ ├── multi_hosts_lv_ex_timeout_hostb.sh │ ├── multi_hosts_lv_hosta.sh │ ├── multi_hosts_lv_hostb.sh │ ├── multi_hosts_lv_sh_timeout_hosta.sh │ ├── multi_hosts_lv_sh_timeout_hostb.sh │ ├── multi_hosts_vg_hosta.sh │ ├── multi_hosts_vg_hostb.sh │ ├── multipath-config.sh │ ├── name-mangling.sh │ ├── nomda-missing.sh │ ├── nomda-restoremissing.sh │ ├── open-file-limit.sh │ ├── orphan-ondisk.sh │ ├── outdated-pv.sh │ ├── pe-align.sh │ ├── pool-labels.sh │ ├── process-each-duplicate-pvs.sh │ ├── process-each-lv.sh │ ├── process-each-pv-nomda-all.sh │ ├── process-each-pv-nomda.sh │ ├── process-each-pv.sh │ ├── process-each-pvresize.sh │ ├── process-each-vg.sh │ ├── process-each-vgreduce.sh │ ├── profiles-cache.sh │ ├── profiles-thin.sh │ ├── profiles-vdo.sh │ ├── profiles.sh │ ├── pv-check-dev-size.sh │ ├── pv-corruption.sh │ ├── pv-duplicate-uuid.sh │ ├── pv-ext-flags.sh │ ├── pv-ext-update.sh │ ├── pv-min-size.sh │ ├── pv-range-overflow.sh │ ├── pvchange-usage.sh │ ├── pvck-dump.sh │ ├── pvck-repair.sh │ ├── pvcreate-bootloaderarea.sh │ ├── pvcreate-ff.sh │ ├── pvcreate-md-fake-hdr.sh │ ├── pvcreate-metadata0.sh │ ├── pvcreate-operation-md.sh │ ├── pvcreate-operation.sh │ ├── pvcreate-partition.sh │ ├── pvcreate-restore.sh │ ├── pvcreate-usage.sh │ ├── pvmove-abort-all.sh │ ├── pvmove-abort.sh │ ├── pvmove-all-segtypes.sh │ ├── pvmove-background.sh │ ├── pvmove-basic.sh │ ├── pvmove-cache-segtypes.sh │ ├── pvmove-lvs.sh │ ├── pvmove-open.sh │ ├── pvmove-raid-segtypes.sh │ ├── pvmove-restart.sh │ ├── pvmove-resume-1.sh │ ├── pvmove-resume-2.sh │ ├── pvmove-resume-multiseg.sh │ ├── pvmove-single.sh │ ├── pvmove-thin-segtypes.sh │ ├── pvremove-thin.sh │ ├── pvremove-usage.sh │ ├── pvremove-warnings.sh │ ├── pvresize-mdas.sh │ ├── pvscan-autoactivate.sh │ ├── pvscan-autoactivation-polling.sh │ ├── pvscan-cache.sh │ ├── pvscan-nomda-bg.sh │ ├── read-ahead.sh │ ├── relative-sign-options.sh │ ├── report-fields.sh │ ├── report-format.sh │ ├── report-headings.sh │ ├── report-hidden.sh │ ├── scan-lvs.sh │ ├── select-report.sh │ ├── select-tools-thin.sh │ ├── select-tools.sh │ ├── snapshot-autoumount-dmeventd.sh │ ├── snapshot-cluster.sh │ ├── snapshot-maxsize.sh │ ├── snapshot-merge-stack.sh │ ├── snapshot-merge-thin.sh │ ├── snapshot-merge.sh │ ├── snapshot-raid.sh │ ├── snapshot-reactivate.sh │ ├── snapshot-remove-dmsetup.sh │ ├── snapshot-rename.sh │ ├── snapshot-usage-exa.sh │ ├── snapshot-usage.sh │ ├── snapshots-of-mirrors.sh │ ├── stray-device-node.sh │ ├── stress_multi_threads_1.sh │ ├── stress_multi_threads_2.sh │ ├── stress_single_thread.sh │ ├── system_id.sh │ ├── tags.sh │ ├── test-partition.sh │ ├── thin-16g.sh │ ├── thin-autoumount-dmeventd.sh │ ├── thin-defaults.sh │ ├── thin-dmeventd-warns.sh │ ├── thin-errors.sh │ ├── thin-flags.sh │ ├── thin-foreign-dmeventd.sh │ ├── thin-foreign-repair.sh │ ├── thin-large.sh │ ├── thin-many-dmeventd.sh │ ├── thin-merge.sh │ ├── thin-overprovisioning.sh │ ├── thin-resize-match.sh │ ├── thin-restore.sh │ ├── thin-vglock.sh │ ├── thin-volume-list.sh │ ├── thin-zero-meta.sh │ ├── topology-support.sh │ ├── udev-pvscan-vgchange.sh │ ├── unknown-segment.sh │ ├── unlost-pv.sh │ ├── vdo-autoumount-dmeventd.sh │ ├── vdo-convert.sh │ ├── vdo-scsi-convert.sh │ ├── vg-check-devs-used.sh │ ├── vg-name-from-env.sh │ ├── vg-raid-takeover-1.sh │ ├── vg-raid-takeover-2.sh │ ├── vg-raid-takeover-3.sh │ ├── vg-raid-takeover-4.sh │ ├── vgcfgbackup-lvm1.sh │ ├── vgcfgbackup-usage.sh │ ├── vgchange-many.sh │ ├── vgchange-maxlv.sh │ ├── vgchange-partial.sh │ ├── vgchange-pvs-online.sh │ ├── vgchange-sysinit.sh │ ├── vgchange-usage.sh │ ├── vgck.sh │ ├── vgcreate-many-pvs.sh │ ├── vgcreate-usage.sh │ ├── vgextend-restoremissing.sh │ ├── vgextend-usage.sh │ ├── vgimportclone.sh │ ├── vgimportdevices.sh │ ├── vgmerge-operation.sh │ ├── vgmerge-usage.sh │ ├── vgreduce-removemissing-snapshot.sh │ ├── vgreduce-usage.sh │ ├── vgremove-corrupt-vg.sh │ ├── vgrename-usage.sh │ ├── vgsplit-cache.sh │ ├── vgsplit-operation.sh │ ├── vgsplit-raid.sh │ ├── vgsplit-stacked.sh │ ├── vgsplit-thin.sh │ ├── vgsplit-usage.sh │ ├── vgsplit-vdo.sh │ ├── writecache-cache-blocksize-2.sh │ ├── writecache-cache-blocksize.sh │ ├── writecache-large.sh │ ├── writecache-misc.sh │ ├── writecache-split.sh │ ├── writecache.sh │ ├── zero-usage.sh │ ├── zz-lvmlockd-dlm-remove.sh │ ├── zz-lvmlockd-idm-remove.sh │ └── zz-lvmlockd-sanlock-remove.sh └── unit │ ├── Makefile │ ├── bcache_t.c │ ├── bcache_utils_t.c │ ├── bitset_t.c │ ├── config_t.c │ ├── dmhash_t.c │ ├── dmlist_t.c │ ├── dmstatus_t.c │ ├── framework.c │ ├── framework.h │ ├── io_engine_t.c │ ├── matcher_data.h │ ├── matcher_t.c │ ├── percent_t.c │ ├── radix_tree_t.c │ ├── rt_case1.c │ ├── run.c │ ├── string_t.c │ ├── unit-test.sh │ ├── units.h │ └── vdo_t.c ├── tools ├── .exported_symbols ├── .gitignore ├── Makefile.in ├── args.h ├── cmdnames.h ├── command-lines.in ├── command.c ├── command.h ├── command_enums.h ├── commands.h ├── dumpconfig.c ├── errors.h ├── formats.c ├── license.inc ├── lv_props.h ├── lv_types.h ├── lvchange.c ├── lvconvert.c ├── lvconvert_poll.c ├── lvconvert_poll.h ├── lvcreate.c ├── lvdisplay.c ├── lvextend.c ├── lvm-static.c ├── lvm.c ├── lvm2cmd-static.c ├── lvm2cmd.c ├── lvm2cmd.h ├── lvm2cmdline.h ├── lvmcmdlib.c ├── lvmcmdline.c ├── lvmdevices.c ├── lvmdiskscan.c ├── lvpoll.c ├── lvreduce.c ├── lvremove.c ├── lvrename.c ├── lvresize.c ├── lvscan.c ├── man-generator.c ├── polldaemon.c ├── pvchange.c ├── pvck.c ├── pvcreate.c ├── pvdisplay.c ├── pvmove.c ├── pvmove_poll.c ├── pvmove_poll.h ├── pvremove.c ├── pvresize.c ├── pvscan.c ├── reporter.c ├── segtypes.c ├── stub.h ├── tags.c ├── tool.h ├── toollib.c ├── toollib.h ├── tools.h ├── vals.h ├── vgcfgbackup.c ├── vgcfgrestore.c ├── vgchange.c ├── vgck.c ├── vgcreate.c ├── vgdisplay.c ├── vgexport.c ├── vgextend.c ├── vgimport.c ├── vgimportclone.c ├── vgimportdevices.c ├── vgmerge.c ├── vgmknodes.c ├── vgreduce.c ├── vgremove.c ├── vgrename.c ├── vgscan.c └── vgsplit.c └── udev ├── .gitignore ├── 10-dm.rules.in ├── 11-dm-lvm.rules.in ├── 12-dm-permissions.rules ├── 13-dm-disk.rules.in ├── 69-dm-lvm.rules.in ├── 95-dm-notify.rules.in └── Makefile.in /INSTALL: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | 1) Generate custom makefiles. 5 | 6 | Run the 'configure' script from the top directory. 7 | 8 | If you don't want to include the LVM1 backwards-compatibility code use: 9 | ./configure --with-lvm1=none 10 | 11 | To separate the LVM1 support into a shared library loaded by lvm.conf use: 12 | ./configure --with-lvm1=shared 13 | 14 | Use ./configure --help to see other options. 15 | 16 | 2) Build and install. 17 | 18 | Run 'make' from the top directory to build everything you configured. 19 | Run 'make install' to build and install everything you configured. 20 | 21 | If you only want the device-mapper libraries and tools use 22 | 'make device-mapper' or 'make install_device-mapper'. 23 | 24 | 3) If using LVM2, create a configuration file. 25 | 26 | The tools will work fine without a configuration file being 27 | present, but you ought to review the example file in doc/example.conf. 28 | 29 | Please also refer to the WHATS_NEW file and the manual pages for the 30 | individual commands. 31 | 32 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2.03.33(2)-git (2025-05-05) 2 | -------------------------------------------------------------------------------- /VERSION_DM: -------------------------------------------------------------------------------- 1 | 1.02.207-git (2025-05-05) 2 | -------------------------------------------------------------------------------- /base/memory/container_of.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 - 2020 Red Hat, Inc. All rights reserved. 2 | // 3 | // This file is part of LVM2. 4 | // 5 | // This copyrighted material is made available to anyone wishing to use, 6 | // modify, copy, or redistribute it subject to the terms and conditions 7 | // of the GNU Lesser General Public License v.2.1. 8 | // 9 | // You should have received a copy of the GNU Lesser General Public License 10 | // along with this program; if not, write to the Free Software Foundation, 11 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | #ifndef BASE_MEMORY_CONTAINER_OF_H 14 | #define BASE_MEMORY_CONTAINER_OF_H 15 | 16 | #include // offsetof 17 | 18 | //---------------------------------------------------------------- 19 | 20 | #define container_of(v, t, head) \ 21 | ((t *)((char *)(v) - offsetof(t, head))) 22 | 23 | //---------------------------------------------------------------- 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /base/memory/zalloc.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Red Hat, Inc. All rights reserved. 2 | // 3 | // This file is part of LVM2. 4 | // 5 | // This copyrighted material is made available to anyone wishing to use, 6 | // modify, copy, or redistribute it subject to the terms and conditions 7 | // of the GNU Lesser General Public License v.2.1. 8 | // 9 | // You should have received a copy of the GNU Lesser General Public License 10 | // along with this program; if not, write to the Free Software Foundation, 11 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | #ifndef BASE_MEMORY_ZALLOC_H 14 | #define BASE_MEMORY_ZALLOC_H 15 | 16 | #include 17 | 18 | //---------------------------------------------------------------- 19 | 20 | static inline void *zalloc(size_t len) 21 | { 22 | return calloc(1, len); 23 | } 24 | 25 | //---------------------------------------------------------------- 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /conf/.gitignore: -------------------------------------------------------------------------------- 1 | command_profile_template.profile 2 | example.conf 3 | lvmlocal.conf 4 | metadata_profile_template.profile 5 | configure.h 6 | lvm-version.h 7 | -------------------------------------------------------------------------------- /conf/cache-mq.profile: -------------------------------------------------------------------------------- 1 | # Demo configuration 'mq' cache policy 2 | # 3 | # Note: This policy has been deprecated in favor of the smq policy 4 | # keyword "default" means, setting is left with kernel defaults. 5 | # 6 | 7 | allocation { 8 | cache_pool_chunk_size = 64 9 | cache_mode = "writethrough" 10 | cache_policy = "mq" 11 | cache_settings { 12 | mq { 13 | sequential_threshold = "default" # #nr_sequential_ios 14 | random_threshold = "default" # #nr_random_ios 15 | read_promote_adjustment = "default" 16 | write_promote_adjustment = "default" 17 | discard_promote_adjustment = "default" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /conf/cache-smq.profile: -------------------------------------------------------------------------------- 1 | # Demo configuration 'smq' cache policy 2 | # 3 | # The stochastic multi-queue (smq) policy addresses some of the problems 4 | # with the multiqueue (mq) policy and uses less memory. 5 | # 6 | 7 | allocation { 8 | cache_pool_chunk_size = 64 9 | cache_mode = "writethrough" 10 | cache_policy = "smq" 11 | cache_settings { 12 | # currently no settings for "smq" policy 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /conf/metadata_profile_template.profile.in: -------------------------------------------------------------------------------- 1 | # This is a metadata profile template for the LVM2 system. 2 | # 3 | # It contains all configuration settings that are customizable by metadata 4 | # profiles. To create a new metadata profile, select the settings you want 5 | # to customize and add them in a new file named .profile. 6 | # Then install the new profile in a directory as defined by config/profile_dir 7 | # setting found in @DEFAULT_SYS_DIR@/lvm.conf file. 8 | # 9 | # Metadata profiles can be referenced by using the --metadataprofile LVM2 10 | # command line option. 11 | # 12 | # Refer to 'man lvm.conf' for further information about profiles and 13 | # general configuration file layout. 14 | # 15 | allocation { 16 | thin_pool_zero=1 17 | thin_pool_discards="passdown" 18 | thin_pool_chunk_size_policy="generic" 19 | # thin_pool_chunk_size=128 20 | } 21 | activation { 22 | thin_pool_autoextend_threshold=100 23 | thin_pool_autoextend_percent=20 24 | } 25 | -------------------------------------------------------------------------------- /conf/thin-generic.profile: -------------------------------------------------------------------------------- 1 | allocation { 2 | thin_pool_chunk_size_policy = "generic" 3 | thin_pool_zero = 1 4 | } 5 | -------------------------------------------------------------------------------- /conf/thin-performance.profile: -------------------------------------------------------------------------------- 1 | allocation { 2 | thin_pool_chunk_size_policy = "performance" 3 | thin_pool_zero = 0 4 | } 5 | -------------------------------------------------------------------------------- /conf/vdo-small.profile: -------------------------------------------------------------------------------- 1 | # Demo configuration for 'VDO' using less memory. 2 | # ~lvmconfig --type full | grep vdo 3 | 4 | allocation { 5 | vdo_use_compression=1 6 | vdo_use_deduplication=1 7 | vdo_minimum_io_size=4096 8 | vdo_block_map_cache_size_mb=128 9 | vdo_block_map_period=16380 10 | vdo_use_sparse_index=0 11 | vdo_index_memory_size_mb=256 12 | vdo_slab_size_mb=2048 13 | vdo_ack_threads=1 14 | vdo_bio_threads=1 15 | vdo_bio_rotation=64 16 | vdo_cpu_threads=2 17 | vdo_hash_zone_threads=1 18 | vdo_logical_threads=1 19 | vdo_physical_threads=1 20 | vdo_max_discard=1 21 | } 22 | -------------------------------------------------------------------------------- /daemons/cmirrord/.gitignore: -------------------------------------------------------------------------------- 1 | cmirrord 2 | -------------------------------------------------------------------------------- /daemons/cmirrord/compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. 3 | * 4 | * This copyrighted material is made available to anyone wishing to use, 5 | * modify, copy, or redistribute it subject to the terms and conditions 6 | * of the GNU Lesser General Public License v.2.1. 7 | */ 8 | #ifndef _LVM_CLOG_COMPAT_H 9 | #define _LVM_CLOG_COMPAT_H 10 | 11 | #include 12 | 13 | /* 14 | * The intermachine communication structure version are: 15 | * 0: Unused 16 | * 1: Never in the wild 17 | * 2: RHEL 5.2 18 | * 3: RHEL 5.3 19 | * 4: RHEL 5.4, RHEL 5.5 20 | * 5: RHEL 6, Current Upstream Format 21 | */ 22 | #define CLOG_TFR_VERSION 5 23 | 24 | struct clog_request; 25 | 26 | int clog_request_to_network(struct clog_request *rq); 27 | int clog_request_from_network(void *data, size_t data_len); 28 | 29 | #endif /* _LVM_CLOG_COMPAT_H */ 30 | -------------------------------------------------------------------------------- /daemons/cmirrord/link_mon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. 3 | * 4 | * This copyrighted material is made available to anyone wishing to use, 5 | * modify, copy, or redistribute it subject to the terms and conditions 6 | * of the GNU Lesser General Public License v.2.1. 7 | * 8 | * You should have received a copy of the GNU Lesser General Public License 9 | * along with this program; if not, write to the Free Software Foundation, 10 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 11 | */ 12 | #ifndef _LVM_CLOG_LINK_MON_H 13 | #define _LVM_CLOG_LINK_MON_H 14 | 15 | int links_register(int fd, const char *name, int (*callback)(void *data), void *data); 16 | int links_unregister(int fd); 17 | int links_monitor(void); 18 | int links_issue_callbacks(void); 19 | 20 | #endif /* _LVM_CLOG_LINK_MON_H */ 21 | -------------------------------------------------------------------------------- /daemons/cmirrord/local.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. 3 | * 4 | * This copyrighted material is made available to anyone wishing to use, 5 | * modify, copy, or redistribute it subject to the terms and conditions 6 | * of the GNU Lesser General Public License v.2.1. 7 | * 8 | * You should have received a copy of the GNU Lesser General Public License 9 | * along with this program; if not, write to the Free Software Foundation, 10 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 11 | */ 12 | #ifndef _LVM_CLOG_LOCAL_H 13 | #define _LVM_CLOG_LOCAL_H 14 | 15 | struct dm_ulog_request; 16 | 17 | int init_local(void); 18 | void cleanup_local(void); 19 | 20 | int kernel_send(struct dm_ulog_request *rq); 21 | 22 | #endif /* _LVM_CLOG_LOCAL_H */ 23 | -------------------------------------------------------------------------------- /daemons/dmeventd/.exported_symbols: -------------------------------------------------------------------------------- 1 | init_fifos 2 | fini_fifos 3 | daemon_talk 4 | dm_event_get_version 5 | -------------------------------------------------------------------------------- /daemons/dmeventd/.gitignore: -------------------------------------------------------------------------------- 1 | dmeventd 2 | -------------------------------------------------------------------------------- /daemons/dmeventd/libdevmapper-event.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: devmapper-event 7 | Description: device-mapper event library 8 | Version: @DM_LIB_PATCHLEVEL@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -ldevmapper-event 11 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | # Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. 4 | # 5 | # This file is part of LVM2. 6 | # 7 | # This copyrighted material is made available to anyone wishing to use, 8 | # modify, copy, or redistribute it subject to the terms and conditions 9 | # of the GNU General Public License v.2. 10 | # 11 | # You should have received a copy of the GNU General Public License 12 | # along with this program; if not, write to the Free Software Foundation, 13 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | 15 | srcdir = @srcdir@ 16 | top_srcdir = @top_srcdir@ 17 | top_builddir = @top_builddir@ 18 | 19 | SUBDIRS += lvm2 snapshot raid thin mirror vdo 20 | 21 | include $(top_builddir)/make.tmpl 22 | 23 | snapshot: lvm2 24 | mirror: lvm2 25 | raid: lvm2 26 | thin: lvm2 27 | vdo: lvm2 28 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/lvm2/.exported_symbols: -------------------------------------------------------------------------------- 1 | dmeventd_lvm2_init 2 | dmeventd_lvm2_exit 3 | dmeventd_lvm2_lock 4 | dmeventd_lvm2_unlock 5 | dmeventd_lvm2_pool 6 | dmeventd_lvm2_run 7 | dmeventd_lvm2_command 8 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/lvm2/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2010-2014 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | srcdir = @srcdir@ 15 | top_srcdir = @top_srcdir@ 16 | top_builddir = @top_builddir@ 17 | 18 | CLDFLAGS += -L$(top_builddir)/tools 19 | LIBS += $(DMEVENT_LIBS) $(PTHREAD_LIBS) @LVM2CMD_LIB@ 20 | 21 | SOURCES = dmeventd_lvm.c 22 | 23 | LIB_SHARED = libdevmapper-event-lvm2.$(LIB_SUFFIX) 24 | LIB_VERSION = $(LIB_VERSION_LVM) 25 | 26 | include $(top_builddir)/make.tmpl 27 | 28 | install_lvm2: install_lib_shared 29 | 30 | install: install_lvm2 31 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/mirror/.exported_symbols: -------------------------------------------------------------------------------- 1 | process_event 2 | register_device 3 | unregister_device 4 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/mirror/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | # Copyright (C) 2004-2005, 2008-2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This file is part of LVM2. 6 | # 7 | # This copyrighted material is made available to anyone wishing to use, 8 | # modify, copy, or redistribute it subject to the terms and conditions 9 | # of the GNU General Public License v.2. 10 | # 11 | # You should have received a copy of the GNU General Public License 12 | # along with this program; if not, write to the Free Software Foundation, 13 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | 15 | srcdir = @srcdir@ 16 | top_srcdir = @top_srcdir@ 17 | top_builddir = @top_builddir@ 18 | 19 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 20 | LIBS += -ldevmapper-event-lvm2 21 | 22 | SOURCES = dmeventd_mirror.c 23 | 24 | LIB_NAME = libdevmapper-event-lvm2mirror 25 | LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX) 26 | LIB_VERSION = $(LIB_VERSION_LVM) 27 | 28 | include $(top_builddir)/make.tmpl 29 | 30 | install_lvm2: install_dm_plugin 31 | 32 | install: install_lvm2 33 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/raid/.exported_symbols: -------------------------------------------------------------------------------- 1 | process_event 2 | register_device 3 | unregister_device 4 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/raid/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011-2014 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | srcdir = @srcdir@ 15 | top_srcdir = @top_srcdir@ 16 | top_builddir = @top_builddir@ 17 | 18 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 19 | LIBS += -ldevmapper-event-lvm2 20 | 21 | SOURCES = dmeventd_raid.c 22 | 23 | LIB_NAME = libdevmapper-event-lvm2raid 24 | LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX) 25 | LIB_VERSION = $(LIB_VERSION_LVM) 26 | 27 | include $(top_builddir)/make.tmpl 28 | 29 | install_lvm2: install_dm_plugin 30 | 31 | install: install_lvm2 32 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/snapshot/.exported_symbols: -------------------------------------------------------------------------------- 1 | process_event 2 | register_device 3 | unregister_device 4 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/snapshot/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | # Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This file is part of the LVM2. 6 | # 7 | # This copyrighted material is made available to anyone wishing to use, 8 | # modify, copy, or redistribute it subject to the terms and conditions 9 | # of the GNU General Public License v.2. 10 | # 11 | # You should have received a copy of the GNU General Public License 12 | # along with this program; if not, write to the Free Software Foundation, 13 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | 15 | srcdir = @srcdir@ 16 | top_srcdir = @top_srcdir@ 17 | top_builddir = @top_builddir@ 18 | 19 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 20 | LIBS += -ldevmapper-event-lvm2 21 | 22 | SOURCES = dmeventd_snapshot.c 23 | 24 | LIB_SHARED = libdevmapper-event-lvm2snapshot.$(LIB_SUFFIX) 25 | LIB_VERSION = $(LIB_VERSION_LVM) 26 | 27 | include $(top_builddir)/make.tmpl 28 | 29 | install_lvm2: install_dm_plugin 30 | 31 | install: install_lvm2 32 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/thin/.exported_symbols: -------------------------------------------------------------------------------- 1 | process_event 2 | register_device 3 | unregister_device 4 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/thin/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011-2014 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | srcdir = @srcdir@ 15 | top_srcdir = @top_srcdir@ 16 | top_builddir = @top_builddir@ 17 | 18 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 19 | LIBS += -ldevmapper-event-lvm2 20 | 21 | SOURCES = dmeventd_thin.c 22 | 23 | LIB_NAME = libdevmapper-event-lvm2thin 24 | LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX) 25 | LIB_VERSION = $(LIB_VERSION_LVM) 26 | 27 | include $(top_builddir)/make.tmpl 28 | 29 | install_lvm2: install_dm_plugin 30 | 31 | install: install_lvm2 32 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/vdo/.exported_symbols: -------------------------------------------------------------------------------- 1 | process_event 2 | register_device 3 | unregister_device 4 | -------------------------------------------------------------------------------- /daemons/dmeventd/plugins/vdo/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | srcdir = @srcdir@ 15 | top_srcdir = @top_srcdir@ 16 | top_builddir = @top_builddir@ 17 | 18 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 19 | LIBS += -ldevmapper-event-lvm2 20 | 21 | SOURCES = dmeventd_vdo.c 22 | 23 | LIB_NAME = libdevmapper-event-lvm2vdo 24 | LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX) 25 | LIB_VERSION = $(LIB_VERSION_LVM) 26 | 27 | include $(top_builddir)/make.tmpl 28 | 29 | install_lvm2: install_dm_plugin 30 | 31 | install: install_lvm2 32 | -------------------------------------------------------------------------------- /daemons/lvmdbusd/.gitignore: -------------------------------------------------------------------------------- 1 | path.py 2 | lvmdbusd 3 | lvmdb.py 4 | lvm_shell_proxy.py 5 | -------------------------------------------------------------------------------- /daemons/lvmdbusd/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. 2 | # 3 | # This copyrighted material is made available to anyone wishing to use, 4 | # modify, copy, or redistribute it subject to the terms and conditions 5 | # of the GNU General Public License v.2. 6 | # 7 | # You should have received a copy of the GNU General Public License 8 | # along with this program. If not, see . 9 | 10 | from .main import main 11 | -------------------------------------------------------------------------------- /daemons/lvmdbusd/lvmdbusd.in: -------------------------------------------------------------------------------- 1 | #!@PYTHON3@ 2 | 3 | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program. If not, see . 11 | 12 | import sys 13 | from lvmdbusd import main 14 | 15 | if __name__ == '__main__': 16 | sys.exit(main()) 17 | -------------------------------------------------------------------------------- /daemons/lvmdbusd/path.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. 2 | # 3 | # This copyrighted material is made available to anyone wishing to use, 4 | # modify, copy, or redistribute it subject to the terms and conditions 5 | # of the GNU General Public License v.2. 6 | # 7 | # You should have received a copy of the GNU General Public License 8 | # along with this program. If not, see . 9 | 10 | LVM_BINARY = "@LVM_PATH@" 11 | -------------------------------------------------------------------------------- /daemons/lvmdbusd/state.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. 2 | # 3 | # This copyrighted material is made available to anyone wishing to use, 4 | # modify, copy, or redistribute it subject to the terms and conditions 5 | # of the GNU General Public License v.2. 6 | # 7 | # You should have received a copy of the GNU General Public License 8 | # along with this program. If not, see . 9 | 10 | from abc import ABCMeta, abstractmethod 11 | 12 | 13 | class State(object, metaclass=ABCMeta): 14 | @abstractmethod 15 | def lvm_id(self): 16 | pass 17 | 18 | @abstractmethod 19 | def identifiers(self): 20 | pass 21 | 22 | @abstractmethod 23 | def create_dbus_object(self, path): 24 | pass 25 | 26 | def __str__(self): 27 | return '*****\n' + str(self.__dict__) + '\n******\n' 28 | -------------------------------------------------------------------------------- /daemons/lvmlockd/.gitignore: -------------------------------------------------------------------------------- 1 | lvmlockctl 2 | lvmlockd 3 | -------------------------------------------------------------------------------- /daemons/lvmpolld/.gitignore: -------------------------------------------------------------------------------- 1 | lvmpolld 2 | -------------------------------------------------------------------------------- /daemons/lvmpolld/lvmpolld-cmd-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Red Hat, Inc. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_LVMPOLLD_CMD_UTILS_H 16 | #define _LVM_LVMPOLLD_CMD_UTILS_H 17 | 18 | #include "lvmpolld-data-utils.h" 19 | 20 | const char **cmdargv_ctr(const struct lvmpolld_lv *pdlv, const char *lvm_binary, unsigned abort, unsigned handle_missing_pvs); 21 | const char **cmdenvp_ctr(const struct lvmpolld_lv *pdlv); 22 | 23 | const char *polling_op(enum poll_type); 24 | 25 | #endif /* _LVM_LVMPOLLD_CMD_UTILS_H */ 26 | -------------------------------------------------------------------------------- /daemons/lvmpolld/lvmpolld-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2015 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | /* 16 | * This file must be included first by every lvmpolld source file. 17 | */ 18 | #ifndef _LVM_LVMPOLLD_COMMON_H 19 | #define _LVM_LVMPOLLD_COMMON_H 20 | 21 | #include "tools/tool.h" 22 | 23 | #include "lvmpolld-cmd-utils.h" 24 | #include "daemons/lvmpolld/lvmpolld-protocol.h" 25 | 26 | #include 27 | #include 28 | 29 | #endif /* _LVM_LVMPOLLD_COMMON_H */ 30 | -------------------------------------------------------------------------------- /daemons/lvmpolld/polling_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2015 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_TOOL_POLLING_OPS_H 16 | #define _LVM_TOOL_POLLING_OPS_H 17 | 18 | /* this file is also part of lvmpolld protocol */ 19 | 20 | #define PVMOVE_POLL "pvmove" 21 | #define CONVERT_POLL "convert" 22 | #define MERGE_POLL "merge" 23 | #define MERGE_THIN_POLL "merge_thin" 24 | 25 | #endif /* _LVM_TOOL_POLLING_OPS_H */ 26 | -------------------------------------------------------------------------------- /device_mapper/misc/dmlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | /* 17 | * This file must be included first by every device-mapper library source file. 18 | */ 19 | #ifndef _DM_LIB_H 20 | #define _DM_LIB_H 21 | 22 | // FIXME: get rid of this whole file 23 | 24 | #include "device_mapper/all.h" 25 | #include "lib/misc/util.h" 26 | #include "dm-logging.h" 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /device_mapper/misc/kdev_t.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LIBDM_KDEV_H 16 | #define _LIBDM_KDEV_H 17 | 18 | #define MAJOR(dev) ((dev & 0xfff00) >> 8) 19 | #define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00)) 20 | #define MKDEV(ma,mi) (((dev_t)mi & 0xff) | ((dev_t)ma << 8) | (((dev_t)mi & ~0xff) << 12)) 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /device_mapper/raid/target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of the device-mapper userspace tools. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef DEVICE_MAPPER_RAID_TARGET_H 16 | #define DEVICE_MAPPER_RAID_TARGET_H 17 | 18 | #include 19 | 20 | int dm_raid_count_failed_devices(const char *dev_path, uint32_t *nr_failed); 21 | int dm_raid_clear_failed_devices(const char *dev_path, uint32_t *nr_failed); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /device_mapper/regex/ttree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of the device-mapper userspace tools. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _DM_TTREE_H 17 | #define _DM_TTREE_H 18 | 19 | #include "device_mapper/misc/dmlib.h" 20 | 21 | struct ttree; 22 | 23 | struct ttree *ttree_create(struct dm_pool *mem, unsigned int klen); 24 | 25 | void *ttree_lookup(struct ttree *tt, unsigned *key); 26 | int ttree_insert(struct ttree *tt, unsigned *key, void *data); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | example.conf 2 | -------------------------------------------------------------------------------- /doc/Problems.mdwn: -------------------------------------------------------------------------------- 1 | # Common problems 2 | 3 | ## Duplicate PVs in the system 4 | 5 | LVM tries to detect the common sources of duplicates, mdadm RAID and multipath, 6 | there are cases where duplicate PV appears on the system. 7 | 8 | There are two solutions to this problem: 9 | 10 | * Setting a *global_filter* configuration option. 11 | * Using of *devices_file* (See [lvmdevices(8)](https://man7.org/linux/man-pages/man8/lvmdevices.8.html)) 12 | 13 | ## Device Filtering 14 | 15 | *filter* and *global_filter* are meant to be used in two ways: 16 | 17 | * as an allow list, listing patterns for devices which will be accepted 18 | * `a|/dev/sdX|`, and rejecting the rest `r|.*|`, 19 | * as a reject list, listing only patterns for devices which will be rejected 20 | * `r|/dev/sdX|`, 21 | 22 | Even though there are situations where it works, mixing reject and accept 23 | patterns is not recommended. 24 | 25 | -------------------------------------------------------------------------------- /doc/README.mdwn: -------------------------------------------------------------------------------- 1 | LVM2 Wiki Documentation 2 | ======================= 3 | 4 | If you are looking for information about LVM2 visit the [[Index]] page, 5 | 6 | There are only some notes about writing stuff under *./doc* here: 7 | 8 | * If possible use [[MarkDown]] for formatting, use *.md* (or *.mdwn*) suffix. 9 | * For linking between files, use [[IkiWiki]] syntax `[[FileName]]` or 10 | `[[FileName#Anchor]]`, or `[[link text|FileName]]` 11 | 12 | Markdown 13 | -------- 14 | 15 | * Use `` to keep notes, which will not be rendered. 16 | * Use `[[TODO]]` for anything what needs attention. This will be accessible 17 | through the linked [[TODO]] page. 18 | 19 | IkiWiki 20 | ------- 21 | 22 | * Install ikiwiki: 23 | 24 | yum install ikiwiki 25 | 26 | * To generate the content, run following in the LVM2 top directory: 27 | 28 | ikiwiki --setup ikiwiki.setup 29 | 30 | Internal Stuff: 31 | --------------- 32 | 33 | * [[TODO]] Can we have a section which is hidden by default? Like this one? 34 | * [[TODO]] Add basic IkiWiki and MarkDown How To. 35 | -------------------------------------------------------------------------------- /doc/kernel/delay.txt: -------------------------------------------------------------------------------- 1 | dm-delay 2 | ======== 3 | 4 | Device-Mapper's "delay" target delays reads and/or writes 5 | and maps them to different devices. 6 | 7 | Parameters: 8 | [ ] 9 | 10 | With separate write parameters, the first set is only used for reads. 11 | Offsets are specified in sectors. 12 | Delays are specified in milliseconds. 13 | 14 | Example scripts 15 | =============== 16 | [[ 17 | #!/bin/sh 18 | # Create device delaying rw operation for 500ms 19 | echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed 20 | ]] 21 | 22 | [[ 23 | #!/bin/sh 24 | # Create device delaying only write operation for 500ms and 25 | # splitting reads and writes to different devices $1 $2 26 | echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed 27 | ]] 28 | -------------------------------------------------------------------------------- /doc/local.css: -------------------------------------------------------------------------------- 1 | .page { 2 | max-width: 1280px; 3 | margin: auto; 4 | } 5 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.25.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.25 - Feature and Bug Fix Release"]] 3 | 4 | Version 2.03.25 5 | =============== 6 | 7 | * Add `vgimportdevices --rootvg [--auto]` adding devices from root VG to devices file. 8 | * Add `lvm-devices-import.{path,service}` service using the above to initialize devices file. 9 | * Handle pruning ids from devices file when lvremove is called and a PV is on top of the LV. 10 | * Change device cache data structures and caching to speed up operations with many LVs. 11 | * Fix infinite loop in lvm shell completion causing out of memory issue (2.03.24). 12 | * Allow forced change of locktype from none. 13 | * Handle OPTIONS defined in /etc/sysconfig/lvmlockd. 14 | * And as usually some clean up, static analysis fixes, etc. 15 | 16 | 17 | [[!tag]] 18 | [[!meta date="Fri Jul 12 12:49:07 2024 +0200"]] 19 | 20 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.26.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.26 - Feature and Bug Fix Release"]] 3 | 4 | Version 2.03.26 5 | =============== 6 | 7 | * Add `--integritysettings` option to manipulate dm-integrity settings. 8 | * Add `--refresh` with `vgscan --mknodes`. 9 | * Improve documentation for `--refresh` option. 10 | * Use `log/report_command_log=1` config setting by default for JSON output format. 11 | * Fix `vgmknodes --refresh` to wait for udev before checking `/dev` content. 12 | * Fix internal error reported by pvmove on a VG with single PV. 13 | * Fix unreleased memory pools on RAID lvextend. 14 | * And as usually some clean up, static analysis fixes, etc. 15 | 16 | 17 | [[!tag]] 18 | [[!meta date="Fri Aug 23 16:02:00 2024 +0200"]] 19 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.28.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.28 - Bug Fix Release"]] 3 | 4 | Version 2.03.28 5 | =============== 6 | 7 | Few bugfixes and a lot of speed improvements mainly for many LVs. 8 | 9 | * Introduce setting config/validate_metadata = full | none. 10 | * Restore fs resize call for lvresize -r on the same size LV (2.03.17). 11 | * Correct off-by-one devicesfile backup counting. 12 | * Fall back to direct zeroing if BLKZEROOUT fails during new LV initialization. 13 | 14 | 15 | [[!tag]] 16 | 20 | 21 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.29.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.29 - Bug Fix Release"]] 3 | 4 | Version 2.03.29 5 | =============== 6 | 7 | Mostly bugfix release, few interesting changes: 8 | 9 | * **Fix renaming of raid sub LVs when converting a volume to raid (2.03.28)**. 10 | * **Fix segfault/VG write error for raid LV `lvextend -i|--stripes -I|--stripesize`**. 11 | * Add configure --enable/disable-sd-notify to control lvmlockd build with sd-notify. 12 | * Allow test mode when lvmlockd is built without dlm support. 13 | * Add a note about RAID + integrity synchronization to lvmraid(7) man page. 14 | * Add a function for running lvconvert --repair on RAID LVs to lvmdbusd. 15 | * Improve option section of man pages for listing commands ({pv,lv,vg}{s,display}). 16 | * And some cleanup mostly in test code. 17 | 18 | 19 | [[!tag]] 20 | 24 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.30.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.30 - Bug Fix Release"]] 3 | 4 | Version 2.03.30 5 | =============== 6 | 7 | Small bugfix release: 8 | 9 | * **NEW** Create `/dev/disk/by-diskseq/` symlink for public DM devices. 10 | * Lvresize reports origin vdo volume cannot be resized. 11 | * Support setting `reserved_memory|stack` using `--config` on cmdline. 12 | * Fix support for disabling memory locking (2.03.27). 13 | * Do not extend an LV if FS resize unsupported and `--fs resize` used. 14 | * Prevent leftover temporary device when converting in use volume to a pool. 15 | * lvconvert detects volume in use early when converting it to a pool. 16 | * Handle NVMe with quirk changed WWID not matching WWID in devices file. 17 | 18 | 19 | [[!tag]] 20 | 24 | 25 | -------------------------------------------------------------------------------- /doc/release-notes/2.03.32.mdwn: -------------------------------------------------------------------------------- 1 | 2 | [[!meta title="Version 2.03.32 - Bug Fix Release"]] 3 | 4 | Version 2.03.32 5 | =============== 6 | 7 | Mostly bugfix release: 8 | 9 | * Add support for using regex in selection criteria for string lists. 10 | * Accept thin pool data LV as cachable LV. 11 | * Accept `--autobackup` option in pvresize. 12 | * Allow using zram block devices (likely for testing). 13 | * Lvconvert vdopool conversion propperly validates acceptable LVs. 14 | * Fix lvresize when resizing COW snapshots already covering origin. 15 | * Fix lvmdbusd read of executed lvm commands output. 16 | * Fix construction of DM UUID for cachevol `_cdata` and `_cmeta` devices. 17 | * Ignore PV claims from old metadata when then PV belongs to a new VG. 18 | * Fix integrity metadata rounding. 19 | * Fix string list selection when using `[ || ...]`. 20 | 21 | 22 | [[!tag]] 23 | 27 | -------------------------------------------------------------------------------- /doc/release-notes/index.mdwn: -------------------------------------------------------------------------------- 1 | # LVM Releases 2 | 3 | This list is incomplete, only releases with a release-note are included. 4 | 5 | For releases of legacy branch *2.02* see [[legacy]]. 6 | 7 | Too see what's cooking see [[pending]]. 8 | 9 | [[!inline pages="release-notes/2.03.* and !*/template and !*/Discussion and !tagged(draft) and !tagged(pending)" rootpage="release-notes"]] 10 | -------------------------------------------------------------------------------- /doc/release-notes/legacy.mdwn: -------------------------------------------------------------------------------- 1 | # Legacy 2.02 Releases 2 | 3 | This list is incomplete, only releases with a release-note are included. 4 | 5 | For releases of stable branch 2.03 see [[index]]. 6 | 7 | [[!inline pages="release-notes/2.02.* and !*/template and !*/Discussion and !tagged(draft) and !tagged(pending)" rootpage="release-notes"]] 8 | 9 | -------------------------------------------------------------------------------- /doc/release-notes/pending.mdwn: -------------------------------------------------------------------------------- 1 | # Pending Release 2 | 3 | [[!inline pages="release-notes/* and !*/template and !*/Discussion and tagged(pending)" rootpage="release-notes"]] 4 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | *.h 2 | .symlinks 3 | .symlinks_created 4 | -------------------------------------------------------------------------------- /include/lvm-version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_VERSION_H 17 | /** 18 | * The LVM version number 19 | * 20 | * LVM_MAJOR.LVM_MINOR.LVM_PATCHLEVEL(LVM_LIBAPI)[-LVM_RELEASE] 21 | */ 22 | 23 | #define LVM_VERSION @LVM_VERSION@ 24 | #define LVM_MAJOR @LVM_MAJOR@ 25 | #define LVM_MINOR @LVM_MINOR@ 26 | #define LVM_PATCHLEVEL @LVM_PATCHLEVEL@ 27 | #define LVM_LIBAPI @LVM_LIBAPI@ 28 | #define LVM_RELEASE @LVM_RELEASE@ 29 | #define LVM_RELEASE_DATE @LVM_RELEASE_DATE@ 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/commands/cmd_enum.h: -------------------------------------------------------------------------------- 1 | #ifndef _CMD_ENUM_H 2 | #define _CMD_ENUM_H 3 | 4 | /* 5 | * include/cmds.h is generated by the Makefile. For each command definition 6 | * in command-lines.in, cmds.h contains: 7 | * cmd(foo_CMD, foo) 8 | * 9 | * This header adds each of the foo_CMD's into an enum, so there's 10 | * a unique integer identifier for each command definition. 11 | */ 12 | 13 | enum { 14 | #define cmd(a, b) a , 15 | #include "include/cmds.h" 16 | #undef cmd 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /lib/datastruct/btree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_BTREE_H 17 | #define _LVM_BTREE_H 18 | 19 | #include 20 | 21 | struct btree; 22 | struct dm_pool; 23 | 24 | struct btree *btree_create(struct dm_pool *mem); 25 | 26 | void *btree_lookup(const struct btree *t, uint32_t k); 27 | int btree_insert(struct btree *t, uint32_t k, void *data); 28 | 29 | struct btree_iter; 30 | void *btree_get_data(const struct btree_iter *it); 31 | 32 | struct btree_iter *btree_first(const struct btree *t); 33 | struct btree_iter *btree_next(const struct btree_iter *it); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /lib/device/dev-luks.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "lib/misc/lib.h" 16 | #include "lib/device/dev-type.h" 17 | 18 | #define LUKS_SIGNATURE "LUKS\xba\xbe" 19 | #define LUKS_SIGNATURE_SIZE 6 20 | 21 | int dev_is_luks(struct cmd_context *cmd, struct device *dev, uint64_t *offset_found, int full) 22 | { 23 | char buf[LUKS_SIGNATURE_SIZE]; 24 | int ret = -1; 25 | 26 | if (offset_found) 27 | *offset_found = 0; 28 | 29 | if (!dev_read_bytes(dev, 0, LUKS_SIGNATURE_SIZE, buf)) 30 | goto_out; 31 | 32 | ret = memcmp(buf, LUKS_SIGNATURE, LUKS_SIGNATURE_SIZE) ? 0 : 1; 33 | 34 | out: 35 | return ret; 36 | } 37 | -------------------------------------------------------------------------------- /lib/format_text/text_import.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_TEXT_IMPORT_H 17 | #define _LVM_TEXT_IMPORT_H 18 | 19 | #include 20 | 21 | struct dm_hash_table; 22 | struct lv_segment; 23 | struct dm_config_node; 24 | struct dm_config_value; 25 | 26 | int text_import_areas(struct lv_segment *seg, const struct dm_config_node *sn, 27 | const struct dm_config_value *cv, uint64_t status); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/locking/.exported_symbols: -------------------------------------------------------------------------------- 1 | locking_init 2 | locking_end 3 | lock_resource 4 | query_resource 5 | reset_locking 6 | -------------------------------------------------------------------------------- /lib/misc/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_CRC_H 17 | #define _LVM_CRC_H 18 | 19 | #include 20 | 21 | #define INITIAL_CRC 0xf597a6cf 22 | 23 | uint32_t calc_crc(uint32_t initial, const uint8_t *buf, uint32_t size); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /lib/misc/intl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_INTL_H 17 | #define _LVM_INTL_H 18 | 19 | #ifdef INTL_PACKAGE 20 | # include 21 | # define _(String) dgettext(INTL_PACKAGE, (String)) 22 | #else 23 | # define _(String) (String) 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/misc/last-path-component.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | /* 16 | * Return the address of the last file name component of NAME. 17 | * If NAME ends in a slash, return the empty string. 18 | */ 19 | 20 | #include 21 | 22 | static inline const char *last_path_component(char const *name) 23 | { 24 | char const *slash = strrchr(name, '/'); 25 | 26 | return (slash) ? slash + 1 : name; 27 | } 28 | -------------------------------------------------------------------------------- /lib/misc/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | /* 17 | * This file must be included first by every library source file. 18 | */ 19 | #ifndef _LVM_LIB_H 20 | #define _LVM_LIB_H 21 | 22 | #include "device_mapper/all.h" 23 | #include "base/memory/zalloc.h" 24 | #include "lib/misc/intl.h" 25 | #include "lib/misc/util.h" 26 | 27 | #ifdef DM 28 | # include "libdm/misc/dm-logging.h" 29 | #else 30 | # include "lib/log/lvm-logging.h" 31 | # include "lib/misc/lvm-globals.h" 32 | # include "lib/misc/lvm-wrappers.h" 33 | # include "lib/misc/lvm-maths.h" 34 | #endif 35 | 36 | #include 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/misc/lvm-flock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_FLOCK_H 16 | #define _LVM_FLOCK_H 17 | 18 | #include 19 | 20 | struct cmd_context; 21 | 22 | void init_flock(struct cmd_context *cmd); 23 | int lock_file(const char *file, uint32_t flags); 24 | void release_flocks(int unlock); 25 | 26 | #endif /* _LVM_FLOCK_H */ 27 | -------------------------------------------------------------------------------- /lib/misc/lvm-maths.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "lib/misc/lib.h" 16 | 17 | /* Greatest common divisor */ 18 | unsigned long gcd(unsigned long n1, unsigned long n2) 19 | { 20 | unsigned long remainder; 21 | 22 | do { 23 | remainder = n1 % n2; 24 | n1 = n2; 25 | n2 = remainder; 26 | } while (n2); 27 | 28 | return n1; 29 | } 30 | 31 | /* Least common multiple */ 32 | unsigned long lcm(unsigned long n1, unsigned long n2) 33 | { 34 | if (!n1 || !n2) 35 | return 0; 36 | 37 | return (n1 * n2) / gcd(n1, n2); 38 | } 39 | -------------------------------------------------------------------------------- /lib/misc/lvm-maths.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_MATH_H 16 | #define _LVM_MATH_H 17 | 18 | /* Greatest common divisor */ 19 | unsigned long gcd(unsigned long n1, unsigned long n2); 20 | 21 | /* Least common multiple */ 22 | unsigned long lcm(unsigned long n1, unsigned long n2); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/misc/lvm-percent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "lib/misc/lib.h" 16 | #include "lib/misc/lvm-percent.h" 17 | 18 | uint32_t percent_of_extents(uint32_t percents, uint32_t count, int roundup) 19 | { 20 | return (uint32_t)(((uint64_t)percents * (uint64_t)count + 21 | ((roundup) ? 99 : 0)) / 100); 22 | } 23 | -------------------------------------------------------------------------------- /lib/misc/lvm-percent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_PERCENT_H 16 | #define _LVM_PERCENT_H 17 | #include 18 | 19 | typedef enum { 20 | SIGN_NONE = 0, 21 | SIGN_PLUS = 1, 22 | SIGN_MINUS = 2 23 | } sign_t; 24 | 25 | typedef enum { 26 | PERCENT_NONE = 0, 27 | PERCENT_VG, 28 | PERCENT_FREE, 29 | PERCENT_LV, 30 | PERCENT_PVS, 31 | PERCENT_ORIGIN 32 | } percent_type_t; 33 | 34 | #define LVM_PERCENT_MERGE_FAILED DM_PERCENT_FAILED 35 | 36 | uint32_t percent_of_extents(uint32_t percents, uint32_t count, int roundup); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/misc/lvm-signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_SIGNAL_H 17 | #define _LVM_SIGNAL_H 18 | 19 | #include 20 | #include 21 | 22 | void remove_ctrl_c_handler(void); 23 | void install_ctrl_c_handler(void); 24 | int init_signals(int suppress_messages); 25 | 26 | void sigint_allow(void); 27 | int sigint_caught(void); 28 | void sigint_restore(void); 29 | void sigint_clear(void); 30 | 31 | void block_signals(uint32_t flags); 32 | void unblock_signals(void); 33 | 34 | int interruptible_usleep(useconds_t usec); 35 | #endif 36 | -------------------------------------------------------------------------------- /lib/misc/sharedlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_SHAREDLIB_H 17 | #define _LVM_SHAREDLIB_H 18 | 19 | #include "lib/config/config.h" 20 | #include 21 | 22 | void get_shared_library_path(struct cmd_context *cmd, const char *libname, 23 | char *path, size_t path_len); 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/notify/lvmnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Red Hat, Inc. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | */ 10 | 11 | #ifndef _LVMNOTIFY_H 12 | #define _LVMNOTIFY_H 13 | 14 | struct cmd_context; 15 | 16 | int lvmnotify_is_supported(void); 17 | void lvmnotify_send(struct cmd_context *cmd); 18 | void set_vg_notify(struct cmd_context *cmd); 19 | void set_lv_notify(struct cmd_context *cmd); 20 | void set_pv_notify(struct cmd_context *cmd); 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /libdaemon/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | srcdir = @srcdir@ 15 | top_srcdir = @top_srcdir@ 16 | top_builddir = @top_builddir@ 17 | 18 | .PHONY: client server 19 | 20 | SUBDIRS += client 21 | 22 | ifeq (@BUILD_LVMPOLLD@,yes) 23 | SUBDIRS += server 24 | server: client 25 | endif 26 | 27 | ifeq ($(MAKECMDGOALS),distclean) 28 | SUBDIRS = client server 29 | endif 30 | 31 | include $(top_builddir)/make.tmpl 32 | -------------------------------------------------------------------------------- /libdaemon/client/Makefile.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011 Red Hat, Inc. All rights reserved. 2 | # 3 | # This file is part of the device-mapper userspace tools. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU Lesser General Public License v.2.1. 8 | # 9 | # You should have received a copy of the GNU Lesser General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | srcdir = @srcdir@ 14 | top_srcdir = @top_srcdir@ 15 | top_builddir = @top_builddir@ 16 | 17 | LIB_STATIC = libdaemonclient.a 18 | SOURCES = daemon-io.c config-util.c daemon-client.c 19 | 20 | include $(top_builddir)/make.tmpl 21 | -------------------------------------------------------------------------------- /libdaemon/client/daemon-io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2012 Red Hat, Inc. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_DAEMON_IO_H 16 | #define _LVM_DAEMON_IO_H 17 | 18 | #include "libdaemon/client/config-util.h" 19 | 20 | /* TODO function names */ 21 | 22 | int buffer_read(int fd, struct buffer *buffer); 23 | int buffer_write(int fd, const struct buffer *buffer); 24 | 25 | #endif /* _LVM_DAEMON_IO_H */ 26 | -------------------------------------------------------------------------------- /libdaemon/server/Makefile.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011 Red Hat, Inc. All rights reserved. 2 | # 3 | # This file is part of the device-mapper userspace tools. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU Lesser General Public License v.2.1. 8 | # 9 | # You should have received a copy of the GNU Lesser General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | srcdir = @srcdir@ 14 | top_srcdir = @top_srcdir@ 15 | top_builddir = @top_builddir@ 16 | 17 | LIB_STATIC = libdaemonserver.a 18 | SOURCES = daemon-server.c daemon-log.c 19 | 20 | include $(top_builddir)/make.tmpl 21 | -------------------------------------------------------------------------------- /libdm/.exported_symbols: -------------------------------------------------------------------------------- 1 | dm_bounds_check_debug 2 | dm_dump_memory_debug 3 | dm_free_aux 4 | dm_log 5 | dm_log_with_errno 6 | dm_malloc_aux 7 | dm_malloc_aux_debug 8 | dm_realloc_aux 9 | dm_strdup_aux 10 | dm_task_get_info_with_deferred_remove 11 | dm_zalloc_aux 12 | dm_zalloc_aux_debug 13 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_100: -------------------------------------------------------------------------------- 1 | dm_config_value_get_format_flags 2 | dm_config_value_set_format_flags 3 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_101: -------------------------------------------------------------------------------- 1 | dm_report_value_cache_get 2 | dm_report_value_cache_set 3 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_103: -------------------------------------------------------------------------------- 1 | dm_bounds_check_wrapper 2 | dm_dump_memory_wrapper 3 | dm_free_wrapper 4 | dm_malloc_wrapper 5 | dm_realloc_wrapper 6 | dm_strdup_wrapper 7 | dm_zalloc_wrapper 8 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_105: -------------------------------------------------------------------------------- 1 | dm_report_is_empty 2 | dm_stats_get_area_offset 3 | dm_stats_get_current_area_offset 4 | dm_timestamp_copy 5 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_106: -------------------------------------------------------------------------------- 1 | dm_message_supports_precise_timestamps 2 | dm_stats_create_region 3 | dm_stats_driver_supports_precise 4 | dm_stats_get_current_region_precise_timestamps 5 | dm_stats_get_region_precise_timestamps 6 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_107: -------------------------------------------------------------------------------- 1 | dm_histogram_bounds_destroy 2 | dm_histogram_bounds_from_string 3 | dm_histogram_bounds_from_uint64 4 | dm_histogram_get_bin_count 5 | dm_histogram_get_bin_lower 6 | dm_histogram_get_bin_percent 7 | dm_histogram_get_bin_upper 8 | dm_histogram_get_bin_width 9 | dm_histogram_get_nr_bins 10 | dm_histogram_get_sum 11 | dm_histogram_to_string 12 | dm_stats_create_region 13 | dm_stats_driver_supports_histogram 14 | dm_stats_get_histogram 15 | dm_stats_get_region_nr_histogram_bins 16 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_110: -------------------------------------------------------------------------------- 1 | dm_hold_control_dev 2 | dm_report_compact_given_fields 3 | dm_tree_node_size_changed 4 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_113: -------------------------------------------------------------------------------- 1 | dm_get_status_mirror 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_124: -------------------------------------------------------------------------------- 1 | dm_udev_wait_immediate 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_128: -------------------------------------------------------------------------------- 1 | dm_report_group_create 2 | dm_report_group_destroy 3 | dm_report_group_pop 4 | dm_report_group_push 5 | dm_report_set_selection 6 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_129: -------------------------------------------------------------------------------- 1 | dm_bitset_parse_list 2 | dm_stats_create_group 3 | dm_stats_current_object_type 4 | dm_stats_delete_group 5 | dm_stats_get_alias 6 | dm_stats_get_counter 7 | dm_stats_get_group_descriptor 8 | dm_stats_get_group_id 9 | dm_stats_get_metric 10 | dm_stats_get_nr_groups 11 | dm_stats_group_present 12 | dm_stats_object_type 13 | dm_stats_set_alias 14 | dm_stats_walk_init 15 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_131: -------------------------------------------------------------------------------- 1 | dm_stats_create_regions_from_fd 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_133: -------------------------------------------------------------------------------- 1 | dm_report_destroy_rows 2 | dm_report_group_output_and_pop_all 3 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_135: -------------------------------------------------------------------------------- 1 | dm_config_parse_without_dup_node_check 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_138: -------------------------------------------------------------------------------- 1 | dm_bitset_parse_list 2 | dm_bit_get_last 3 | dm_bit_get_prev 4 | dm_filemapd_mode_from_string 5 | dm_stats_bind_from_fd 6 | dm_stats_start_filemapd 7 | dm_stats_update_regions_from_fd 8 | dm_tree_node_add_cache_target 9 | dm_tree_node_add_raid_target_with_params_v2 10 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_141: -------------------------------------------------------------------------------- 1 | dm_percent_to_round_float 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_147: -------------------------------------------------------------------------------- 1 | dm_malloc_aligned_wrapper 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_172: -------------------------------------------------------------------------------- 1 | dm_tree_node_add_thin_pool_target_v1 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_181: -------------------------------------------------------------------------------- 1 | dm_task_ima_measurement 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_197: -------------------------------------------------------------------------------- 1 | dm_task_run 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_202: -------------------------------------------------------------------------------- 1 | dm_config_parse_only_section 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_97: -------------------------------------------------------------------------------- 1 | dm_task_get_info 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_98: -------------------------------------------------------------------------------- 1 | dm_task_get_errno 2 | -------------------------------------------------------------------------------- /libdm/.exported_symbols.DM_1_02_99: -------------------------------------------------------------------------------- 1 | dm_tree_node_set_thin_pool_read_only 2 | -------------------------------------------------------------------------------- /libdm/dm-tools/.gitignore: -------------------------------------------------------------------------------- 1 | dmsetup 2 | dmfilemapd 3 | -------------------------------------------------------------------------------- /libdm/libdevmapper.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: devmapper 7 | Description: device-mapper library 8 | Version: @DM_LIB_PATCHLEVEL@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -ldevmapper 11 | Requires.private: @SELINUX_PC@ @UDEV_PC@ 12 | Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@ 13 | -------------------------------------------------------------------------------- /libdm/misc/dm-logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _DM_LOGGING_H 17 | #define _DM_LOGGING_H 18 | 19 | #include "libdm/libdevmapper.h" 20 | 21 | extern dm_log_with_errno_fn dm_log_with_errno; 22 | 23 | #define LOG_MESG(l, f, ln, e, x...) \ 24 | dm_log_with_errno(l, f, ln, e, ## x) 25 | 26 | #define LOG_LINE(l, x...) LOG_MESG(l, __FILE__, __LINE__, 0, ## x) 27 | #define LOG_LINE_WITH_ERRNO(l, e, x...) LOG_MESG(l, __FILE__, __LINE__, e, ## x) 28 | 29 | /* Debug messages may have a type instead of an errno */ 30 | #define LOG_LINE_WITH_CLASS(l, c, x...) LOG_MESG(l, __FILE__, __LINE__, c, ## x) 31 | 32 | #include "lib/log/log.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libdm/misc/kdev_t.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LIBDM_KDEV_H 16 | #define _LIBDM_KDEV_H 17 | 18 | #define MAJOR(dev) (((unsigned)dev & 0xfff00) >> 8) 19 | #define MINOR(dev) (((unsigned)dev & 0xff) | (((unsigned)dev >> 12) & 0xfff00)) 20 | #define MKDEV(ma,mi) (((dev_t)mi & 0xff) | ((dev_t)ma << 8) | (((dev_t)mi & ~0xff) << 12)) 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libdm/regex/ttree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of the device-mapper userspace tools. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _DM_TTREE_H 17 | #define _DM_TTREE_H 18 | 19 | struct ttree; 20 | struct dm_pool; 21 | 22 | struct ttree *ttree_create(struct dm_pool *mem, unsigned int klen); 23 | 24 | void *ttree_lookup(struct ttree *tt, unsigned *key); 25 | int ttree_insert(struct ttree *tt, unsigned *key, void *data); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /man/.gitignore: -------------------------------------------------------------------------------- 1 | *.gen 2 | man-generator 3 | -------------------------------------------------------------------------------- /man/lvchange.8_des: -------------------------------------------------------------------------------- 1 | lvchange changes LV attributes in the VG, changes LV activation in the 2 | kernel, and includes other utilities for LV maintenance. 3 | -------------------------------------------------------------------------------- /man/lvchange.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Change LV permission to read-only: 5 | .br 6 | .B lvchange -pr vg00/lvol1 7 | -------------------------------------------------------------------------------- /man/lvdisplay.8_des: -------------------------------------------------------------------------------- 1 | lvdisplay shows the attributes of LVs, like size, read/write status, 2 | snapshot information, etc. 3 | .P 4 | \fBlvs\fP(8) is a preferred alternative that shows the same information 5 | and more, using a more compact and configurable output format. 6 | -------------------------------------------------------------------------------- /man/lvdisplay.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvdisplay.8_end -------------------------------------------------------------------------------- /man/lvextend.8_des: -------------------------------------------------------------------------------- 1 | lvextend extends the size of an LV. This requires allocating logical 2 | extents from the VG's free physical extents. If the extension adds a new 3 | LV segment, the new segment will use the existing segment type of the LV. 4 | .P 5 | Extending a copy-on-write snapshot LV adds space for COW blocks. 6 | .P 7 | Use \fBlvconvert\fP(8) to change the number of data images in a RAID or 8 | mirrored LV. 9 | .P 10 | In the usage section below, \fB--size\fP \fISize\fP can be replaced 11 | with \fB--extents\fP \fINumber\fP. See both descriptions 12 | the options section. 13 | -------------------------------------------------------------------------------- /man/lvextend.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Extend the size of an LV by 54MiB, using a specific PV. 5 | .br 6 | .B lvextend -L +54 vg01/lvol10 /dev/sdk3 7 | .P 8 | Extend the size of an LV by the amount of free 9 | space on PV /dev/sdk3. This is equivalent to specifying 10 | "-l +100%PVS" on the command line. 11 | .br 12 | .B lvextend vg01/lvol01 /dev/sdk3 13 | .P 14 | Extend an LV by 16MiB using specific physical extents. 15 | .br 16 | .B lvextend -L+16m vg01/lvol01 /dev/sda:8-9 /dev/sdb:8-9 17 | .P 18 | Extend an LV to use all remaining free space in volume group 19 | and all resize its filesystem with 20 | .BR fsadm (8). 21 | .br 22 | .B lvextend -l+100%FREE -r vg01/lvol01 23 | -------------------------------------------------------------------------------- /man/lvm-fullreport.8_des: -------------------------------------------------------------------------------- 1 | lvm fullreport produces formatted output about PVs, PV segments, VGs, LVs 2 | and LV segments. The information is all gathered together for each VG 3 | (under a per-VG lock) so it is consistent. Information gathered from 4 | separate calls to \fBvgs\fP, \fBpvs\fP, and \fBlvs\fP can be inconsistent 5 | if information changes between commands. 6 | -------------------------------------------------------------------------------- /man/lvm-fullreport.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvm-fullreport.8_end -------------------------------------------------------------------------------- /man/lvm-lvpoll.8_des: -------------------------------------------------------------------------------- 1 | lvm lvpoll is an internal command used by \fBlvmpolld\fP(8) to monitor and 2 | complete \fBlvconvert\fP(8) and \fBpvmove\fP(8) operations. lvpoll itself 3 | does not initiate these operations and should not normally need to be run 4 | directly. 5 | -------------------------------------------------------------------------------- /man/lvm-lvpoll.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | To find the name of the pvmove LV that was created by an original 5 | \fBpvmove /dev/name\fP command, use the command: 6 | .br 7 | \fBlvs -a -S move_pv=/dev/name\fP. 8 | . 9 | .SH EXAMPLES 10 | . 11 | Continue polling a pvmove operation. 12 | .br 13 | .B lvm lvpoll --polloperation pvmove vg00/pvmove0 14 | .P 15 | Abort a pvmove operation. 16 | .br 17 | .B lvm lvpoll --polloperation pvmove --abort vg00/pvmove0 18 | .P 19 | Continue polling a mirror conversion. 20 | .br 21 | .B lvm lvpoll --polloperation convert vg00/lvmirror 22 | .P 23 | Continue mirror repair. 24 | .br 25 | .B lvm lvpoll --polloperation convert vg/damaged_mirror --handlemissingpvs 26 | .P 27 | Continue snapshot merge. 28 | .br 29 | .B lvm lvpoll --polloperation merge vg/snapshot_old 30 | .P 31 | Continue thin snapshot merge. 32 | .br 33 | .B lvm lvpoll --polloperation merge_thin vg/thin_snapshot 34 | -------------------------------------------------------------------------------- /man/lvmconfig.8_des: -------------------------------------------------------------------------------- 1 | lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons, 2 | to be phased out) produce formatted output from the LVM configuration tree. 3 | The sources of the configuration data include \fBlvm.conf\fP(5) and command 4 | line settings from --config. 5 | -------------------------------------------------------------------------------- /man/lvmconfig.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvmconfig.8_end -------------------------------------------------------------------------------- /man/lvmdbusd.8_main: -------------------------------------------------------------------------------- 1 | .TH LVMDBUSD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*- 2 | . 3 | .SH NAME 4 | . 5 | lvmdbusd \(em LVM D-Bus daemon 6 | . 7 | .SH SYNOPSIS 8 | . 9 | .na 10 | .B lvmdbusd 11 | .RB [ --debug ] 12 | .RB [ --udev ] 13 | .ad 14 | . 15 | .SH DESCRIPTION 16 | . 17 | lvmdbusd is a service which provides a D-Bus API 18 | to the logical volume manager (LVM). 19 | Run 20 | .BR lvmdbusd (8) 21 | as root. 22 | . 23 | .SH OPTIONS 24 | . 25 | .TP 8 26 | .B --debug 27 | Enable debug statements 28 | . 29 | .TP 30 | .B --udev 31 | Use udev events to trigger updates 32 | . 33 | .SH SEE ALSO 34 | . 35 | .nh 36 | .na 37 | .BR lvm (8), 38 | .P 39 | .BR dbus-send (1) 40 | -------------------------------------------------------------------------------- /man/lvmdevices.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvmdevices.8_end -------------------------------------------------------------------------------- /man/lvmdiskscan.8_des: -------------------------------------------------------------------------------- 1 | lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of 2 | other block devices in the system looking for LVM PVs. The size reported 3 | is the real device size. Define a filter in \fBlvm.conf\fP(5) to restrict 4 | the scan to avoid a CD ROM, for example. 5 | .P 6 | This command is deprecated, use \fBpvs\fP instead. 7 | -------------------------------------------------------------------------------- /man/lvmdiskscan.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvmdiskscan.8_end -------------------------------------------------------------------------------- /man/lvmsadc.8_main: -------------------------------------------------------------------------------- 1 | .TH "LVMSADC" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*- 2 | . 3 | .SH NAME 4 | . 5 | lvmsadc \(em LVM system activity data collector 6 | . 7 | .SH SYNOPSIS 8 | . 9 | .B lvmsadc 10 | . 11 | .SH DESCRIPTION 12 | . 13 | lvmsadc is not supported under LVM2. The device-mapper statistics 14 | facility provides similar performance metrics using the \fBdmstats(8)\fP 15 | command. 16 | . 17 | .SH SEE ALSO 18 | . 19 | .BR dmstats (8), 20 | .BR lvm (8) 21 | -------------------------------------------------------------------------------- /man/lvmsar.8_main: -------------------------------------------------------------------------------- 1 | .TH "LVMSAR" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*- 2 | . 3 | .SH NAME 4 | . 5 | lvmsar \(em LVM system activity reporter 6 | . 7 | .SH SYNOPSIS 8 | . 9 | .B lvmsar 10 | . 11 | .SH DESCRIPTION 12 | . 13 | lvmsar is not supported under LVM2. The device-mapper statistics 14 | facility provides similar performance metrics using the \fBdmstats(8)\fP 15 | command. 16 | . 17 | .SH SEE ALSO 18 | . 19 | .BR dmstats (8), 20 | .BR lvm (8) 21 | -------------------------------------------------------------------------------- /man/lvreduce.8_des: -------------------------------------------------------------------------------- 1 | lvreduce reduces the size of an LV. The freed logical extents are returned 2 | to the VG to be used by other LVs. A copy-on-write snapshot LV can also 3 | be reduced if less space is needed to hold COW blocks. Use 4 | \fBlvconvert\fP(8) to change the number of data images in a RAID or 5 | mirrored LV. 6 | .P 7 | Be careful when reducing an LV's size, because data in the reduced area is 8 | lost. Ensure that any file system on the LV is resized \fBbefore\fP 9 | running lvreduce so that the removed extents are not in use by the file 10 | system. 11 | .P 12 | Sizes will be rounded if necessary. For example, the LV size must be an 13 | exact number of extents, and the size of a striped segment must be a 14 | multiple of the number of stripes. 15 | .P 16 | In the usage section below, \fB--size\fP \fISize\fP can be replaced 17 | with \fB--extents\fP \fINumber\fP. See both descriptions 18 | the options section. 19 | -------------------------------------------------------------------------------- /man/lvreduce.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Reduce the size of an LV by 3 logical extents: 5 | .br 6 | .B lvreduce -l -3 vg00/lvol1 7 | -------------------------------------------------------------------------------- /man/lvremove.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Remove an active LV without asking for confirmation. 5 | .br 6 | .B lvremove -f vg00/lvol1 7 | .P 8 | Remove all LVs the specified VG. 9 | .br 10 | .B lvremove vg00 11 | -------------------------------------------------------------------------------- /man/lvrename.8_des: -------------------------------------------------------------------------------- 1 | lvrename renames an existing LV or a historical LV (see \fBlvremove\fP for 2 | historical LV information.) 3 | -------------------------------------------------------------------------------- /man/lvrename.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Rename "lvold" to "lvnew": 5 | .br 6 | .B lvrename /dev/vg02/lvold vg02/lvnew 7 | .P 8 | An alternate syntax to rename "lvold" to "lvnew": 9 | .br 10 | .B lvrename vg02 lvold lvnew 11 | -------------------------------------------------------------------------------- /man/lvresize.8_des: -------------------------------------------------------------------------------- 1 | lvresize resizes an LV in the same way as lvextend and lvreduce. See 2 | \fBlvextend\fP(8) and \fBlvreduce\fP(8) for more information. 3 | .P 4 | In the usage section below, \fB--size\fP \fISize\fP can be replaced 5 | with \fB--extents\fP \fINumber\fP. See both descriptions 6 | the options section. 7 | -------------------------------------------------------------------------------- /man/lvresize.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Extend an LV by 16MB using specific physical extents. 5 | .br 6 | .B lvresize -L+16M vg1/lv1 /dev/sda:0-1 /dev/sdb:0-1 7 | .P 8 | Resize an LV to use 50% of the size volume group. 9 | .br 10 | .B lvresize -l50%VG vg1/lv1 11 | -------------------------------------------------------------------------------- /man/lvs.8_des: -------------------------------------------------------------------------------- 1 | lvs produces formatted output about LVs. 2 | -------------------------------------------------------------------------------- /man/lvscan.8_des: -------------------------------------------------------------------------------- 1 | lvscan scans all VGs or all supported LVM block devices in the system for 2 | LVs. The output consists of one line for each LV indicating whether or not 3 | it is active, a snapshot or origin, the size of the device and its 4 | allocation policy. Use \fBlvs\fP(8) or \fBlvdisplay\fP(8) to obtain more 5 | comprehensive information about LVs. 6 | -------------------------------------------------------------------------------- /man/lvscan.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/lvscan.8_end -------------------------------------------------------------------------------- /man/pvchange.8_des: -------------------------------------------------------------------------------- 1 | pvchange changes PV attributes in the VG. 2 | .P 3 | For options listed in parentheses, any one is required, after which the 4 | others are optional. 5 | -------------------------------------------------------------------------------- /man/pvchange.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Disallow the allocation of physical extents on a PV (e.g. because of 5 | disk errors, or because it will be removed after freeing it). 6 | .br 7 | .B pvchange -x n /dev/sdk1 8 | -------------------------------------------------------------------------------- /man/pvck.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | If the partition table is corrupted or lost on /dev/sda, and you suspect 5 | there was an LVM partition at approximately 100 MiB, then this 6 | area of the disk can be scanned using the \fB--labelsector\fP 7 | parameter with a value of 204800 (100 * 1024 * 1024 / 512 = 204800). 8 | .br 9 | .B pvck --labelsector 204800 /dev/sda 10 | -------------------------------------------------------------------------------- /man/pvcreate.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Initialize a partition and a full device. 5 | .br 6 | .B pvcreate /dev/sdc4 /dev/sde 7 | .P 8 | If a device is a 4 KiB sector drive that compensates for windows 9 | partitioning (sector 7 is the lowest aligned logical block, the 4 KiB 10 | sectors start at LBA -1, and consequently sector 63 is aligned on a 4 KiB 11 | boundary) manually account for this when initializing for use by LVM. 12 | .br 13 | .B pvcreate --dataalignmentoffset 7s /dev/sdb 14 | -------------------------------------------------------------------------------- /man/pvdisplay.8_des: -------------------------------------------------------------------------------- 1 | pvdisplay shows the attributes of PVs, like size, physical extent size, 2 | space used for the VG descriptor area, etc. 3 | .P 4 | \fBpvs\fP(8) is a preferred alternative that shows the same information 5 | and more, using a more compact and configurable output format. 6 | -------------------------------------------------------------------------------- /man/pvdisplay.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/pvdisplay.8_end -------------------------------------------------------------------------------- /man/pvmove.8_des: -------------------------------------------------------------------------------- 1 | pvmove moves the allocated physical extents (PEs) on a source PV to one or 2 | more destination PVs. You can optionally specify a source LV in which 3 | case only extents used by that LV will be moved to free (or specified) 4 | extents on the destination PV. If no destination PV is specified, the 5 | normal allocation rules for the VG are used. 6 | .P 7 | If pvmove is interrupted for any reason (e.g. the machine crashes) then 8 | run pvmove again without any PV arguments to restart any operations that 9 | were in progress from the last checkpoint. Alternatively, use the abort 10 | option at any time to abort the operation. The resulting location of LVs 11 | after an abort depends on whether the atomic option was used. 12 | .P 13 | More than one pvmove can run concurrently if they are moving data from 14 | different source PVs, but additional pvmoves will ignore any LVs already 15 | in the process of being changed, so some data might not get moved. 16 | -------------------------------------------------------------------------------- /man/pvremove.8_des: -------------------------------------------------------------------------------- 1 | pvremove wipes the label on a device so that LVM will no longer recognise 2 | it as a PV. 3 | .P 4 | A PV cannot be removed from a VG while it is used by an active LV. 5 | .P 6 | Repeat the force option (\fB-ff\fP) to forcibly remove a PV belonging to 7 | an existing VG. Normally, \fBvgreduce\fP(8) should be used instead. 8 | -------------------------------------------------------------------------------- /man/pvremove.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/pvremove.8_end -------------------------------------------------------------------------------- /man/pvresize.8_des: -------------------------------------------------------------------------------- 1 | pvresize resizes a PV. The PV may already be in a VG and may have active 2 | LVs allocated on it. 3 | -------------------------------------------------------------------------------- /man/pvresize.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | pvresize will refuse to shrink a PV if it has allocated extents beyond the 5 | new end. 6 | . 7 | .SH EXAMPLES 8 | . 9 | Expand a PV after enlarging the partition. 10 | .br 11 | .B pvresize /dev/sda1 12 | .P 13 | Shrink a PV prior to shrinking the partition (ensure that the PV size is 14 | appropriate for the intended new partition size). 15 | .br 16 | .B pvresize --setphysicalvolumesize 40G /dev/sda1 17 | -------------------------------------------------------------------------------- /man/pvs.8_des: -------------------------------------------------------------------------------- 1 | pvs produces formatted output about PVs. 2 | -------------------------------------------------------------------------------- /man/pvs.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | The pv_attr bits are: 5 | . 6 | .IP 1 3 7 | (\fBd\fP)uplicate, (\fBa\fP)llocatable, (\fBu\fP)sed 8 | . 9 | .IP 2 10 | e(\fBx\fP)ported 11 | . 12 | .IP 3 13 | (\fBm\fP)issing 14 | -------------------------------------------------------------------------------- /man/pvscan.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/pvscan.8_end -------------------------------------------------------------------------------- /man/vgcfgbackup.8_des: -------------------------------------------------------------------------------- 1 | vgcfgbackup creates back up files containing metadata of VGs. 2 | If no VGs are named, back up files are created for all VGs. See 3 | .BR vgcfgrestore (8) 4 | for information on using the back up files. 5 | .P 6 | In a default installation, each VG is backed up into a separate file 7 | bearing the name of the VG in the directory 8 | \fI#DEFAULT_BACKUP_DIR#\fP. 9 | .P 10 | To use an alternative back up file, use \fB-f\fP. In this case, when 11 | backing up multiple VGs, the file name is treated as a template, with %s 12 | replaced by the VG name. 13 | .P 14 | NB. This DOES NOT back up the data content of LVs. 15 | .P 16 | It may also be useful to regularly back up the files in 17 | \fI#DEFAULT_SYS_DIR#\fP. 18 | -------------------------------------------------------------------------------- /man/vgcfgbackup.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgcfgbackup.8_end -------------------------------------------------------------------------------- /man/vgcfgrestore.8_des: -------------------------------------------------------------------------------- 1 | vgcfgrestore restores the metadata of a VG from a text back up file 2 | produced by 3 | .BR vgcfgbackup (8). 4 | This writes VG metadata onto the devices specified in back up file. 5 | .P 6 | A back up file can be specified with \fB--file\fP. If no backup file is 7 | specified, the most recent one is used. Use \fB--list\fP for a list of 8 | the available back up and archive files of a VG. 9 | .P 10 | WARNING: When a VG contains thin pools, changes to thin metadata cannot be 11 | reverted, and data loss may occur if thin metadata has changed. The force 12 | option is required to restore in this case. 13 | -------------------------------------------------------------------------------- /man/vgcfgrestore.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | To replace PVs, \fBvgdisplay --partial --verbose\fP will show the 5 | UUIDs and sizes of any PVs that are no longer present. If a PV in the VG 6 | is lost and you wish to substitute another of the same size, use 7 | \fBpvcreate --restorefile filename --uuid uuid\fP (plus additional 8 | arguments as appropriate) to initialise it with the same UUID as the 9 | missing PV. Repeat for all other missing PVs in the VG. Then use 10 | \fBvgcfgrestore --file filename\fP to restore the VG's metadata. 11 | -------------------------------------------------------------------------------- /man/vgchange.8_des: -------------------------------------------------------------------------------- 1 | vgchange changes VG attributes, changes LV activation in the kernel, and 2 | includes other utilities for VG maintenance. 3 | -------------------------------------------------------------------------------- /man/vgchange.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | If vgchange recognizes COW snapshot LVs that were dropped because they ran 5 | out of space, it displays a message informing the administrator that the 6 | snapshots should be removed. 7 | . 8 | .SH EXAMPLES 9 | . 10 | Activate all LVs in all VGs on all existing devices. 11 | .br 12 | .B vgchange -a y 13 | .P 14 | Change the maximum number of LVs for an inactive VG. 15 | .br 16 | .B vgchange -l 128 vg00 17 | -------------------------------------------------------------------------------- /man/vgck.8_des: -------------------------------------------------------------------------------- 1 | vgck checks LVM metadata for consistency. 2 | -------------------------------------------------------------------------------- /man/vgck.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgck.8_end -------------------------------------------------------------------------------- /man/vgconvert.8_des: -------------------------------------------------------------------------------- 1 | vgconvert is no longer a part of LVM. It was removed along with 2 | support for the LVM1 format. Use an older version of LVM to 3 | convert VGs from the LVM1 format to LVM2. 4 | -------------------------------------------------------------------------------- /man/vgconvert.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgconvert.8_end -------------------------------------------------------------------------------- /man/vgcreate.8_des: -------------------------------------------------------------------------------- 1 | vgcreate creates a new VG on block devices. If the devices were not 2 | previously initialized as PVs with \fBpvcreate\fP(8), vgcreate will 3 | initialize them, making them PVs. The pvcreate options for initializing 4 | devices are also available with vgcreate. 5 | .P 6 | When vgcreate uses an existing PV, that PV's existing values for metadata 7 | size, PE start, etc, are used, even if different values are specified in 8 | the vgcreate command. To change these values, first use pvremove on the 9 | device. 10 | -------------------------------------------------------------------------------- /man/vgcreate.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Create a VG with two PVs, using the default physical extent size. 5 | .br 6 | .B vgcreate myvg /dev/sdk1 /dev/sdl1 7 | -------------------------------------------------------------------------------- /man/vgdisplay.8_des: -------------------------------------------------------------------------------- 1 | vgdisplay shows the attributes of VGs, and the associated PVs and LVs. 2 | .P 3 | \fBvgs\fP(8) is a preferred alternative that shows the same information 4 | and more, using a more compact and configurable output format. 5 | -------------------------------------------------------------------------------- /man/vgdisplay.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgdisplay.8_end -------------------------------------------------------------------------------- /man/vgexport.8_des: -------------------------------------------------------------------------------- 1 | vgexport changes a VG into the exported state, which ensures that the VG 2 | and its disks are not being used, and cannot be used until the VG is 3 | imported by \fBvgimport\fP(8). Putting a VG into an unusable, offline 4 | state can be useful when doing things like moving a VG's disks to another 5 | system. Exporting a VG provides some protection from its LVs being 6 | accidentally used, or being used by an automated system before it's ready. 7 | .P 8 | A VG cannot be exported until all of its LVs are inactive. 9 | .P 10 | LVM commands will ignore an exported VG or report an error if a command 11 | tries to use it. 12 | .P 13 | For an exported VG, the vgs command will display \"x\" in the third VG 14 | attribute, and the pvs command will display \"x\" in the second PV 15 | attribute. Both vgs and pvs will display \"exported\" from the export 16 | report field. 17 | .P 18 | vgexport clears the VG system ID, and vgimport sets the VG system ID to 19 | match the host running vgimport (if the host has a system ID). 20 | -------------------------------------------------------------------------------- /man/vgexport.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgexport.8_end -------------------------------------------------------------------------------- /man/vgextend.8_des: -------------------------------------------------------------------------------- 1 | vgextend adds one or more PVs to a VG. This increases the space available 2 | for LVs in the VG. 3 | .P 4 | Also, PVs that have gone missing and then returned, e.g. due to a 5 | transient device failure, can be added back to the VG without 6 | re-initializing them (see --restoremissing). 7 | .P 8 | If the specified PVs have not yet been initialized with pvcreate, vgextend 9 | will initialize them. In this case pvcreate options can be used, e.g. 10 | --labelsector, --metadatasize, --metadataignore, 11 | --pvmetadatacopies, --dataalignment, --dataalignmentoffset. 12 | -------------------------------------------------------------------------------- /man/vgextend.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Add two PVs to a VG. 5 | .br 6 | .B vgextend vg00 /dev/sda4 /dev/sdn1 7 | -------------------------------------------------------------------------------- /man/vgimport.8_des: -------------------------------------------------------------------------------- 1 | vgimport makes exported VGs known to the system again, perhaps after 2 | moving the PVs from a different system. 3 | .P 4 | vgexport clears the VG system ID, and vgimport sets the VG system ID to 5 | match the host running vgimport (if the host has a system ID). 6 | -------------------------------------------------------------------------------- /man/vgimport.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgimport.8_end -------------------------------------------------------------------------------- /man/vgimportclone.8_des: -------------------------------------------------------------------------------- 1 | vgimportclone imports a VG from duplicated PVs, e.g. created by a hardware 2 | snapshot of existing PVs. 3 | .P 4 | A duplicated VG cannot used until it is made to coexist with the original 5 | VG. vgimportclone renames the VG associated with the specified PVs and 6 | changes the associated VG and PV UUIDs. 7 | -------------------------------------------------------------------------------- /man/vgimportclone.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | An original VG "vg00" has PVs "/dev/sda" and "/dev/sdb". 5 | The corresponding PVs from a hardware snapshot are 6 | "/dev/sdc" and "/dev/sdd". 7 | Rename the VG associated with "/dev/sdc" and "/dev/sdd" 8 | from "vg00" to "vg00_snap" (and change associated UUIDs). 9 | .br 10 | .B vgimportclone --basevgname vg00_snap /dev/sdc /dev/sdd 11 | -------------------------------------------------------------------------------- /man/vgimportdevices.8_des: -------------------------------------------------------------------------------- 1 | vgimportdevices adds PVs from a VG to the devices file. This is similar 2 | to using lvmdevices --adddev to add each PV to the devices file 3 | individually. vgimportdevices will also update the VG metadata to include 4 | the device IDs of each PV. vgimportdevices will create a new devices file 5 | if none exists. 6 | .P 7 | When a devices file is used, the regex filter is ignored, except in the case 8 | of vgimportdevices which will apply the regex filter when looking for the VGs 9 | to import to the devices file. Use vgimportdevices -a to import all VGs on a 10 | system to the devices file. 11 | -------------------------------------------------------------------------------- /man/vgimportdevices.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgimportdevices.8_end -------------------------------------------------------------------------------- /man/vgmerge.8_des: -------------------------------------------------------------------------------- 1 | vgmerge merges two existing VGs. The inactive source VG is merged into the 2 | destination VG if physical extent sizes are equal and PV and LV summaries 3 | of both VGs fit into the destination VG's limits. 4 | -------------------------------------------------------------------------------- /man/vgmerge.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Merge an inactive VG named "vg00" into the active or inactive VG named 5 | "databases", giving verbose runtime information. 6 | .br 7 | .B vgmerge -v databases vg00 8 | -------------------------------------------------------------------------------- /man/vgmknodes.8_des: -------------------------------------------------------------------------------- 1 | vgmknodes checks the LVM device nodes in /dev that are needed for active 2 | LVs and creates any that are missing and removes unused ones. 3 | .P 4 | This command should not usually be needed if all the system components are 5 | interoperating correctly. 6 | .P 7 | See also the notes at the end of this manual page for using vgmknodes 8 | together with udev. 9 | -------------------------------------------------------------------------------- /man/vgmknodes.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | When using \fBudev\fP(7) to manage the /dev content, 5 | it is also highly recommended to use the \fB--refresh\fP option. 6 | This way, the necessary udev events are 7 | generated too and associated udev rules are properly applied. 8 | If the \fB--refresh\fP option is not used in this case, 9 | then LVM recreates the /dev content directly and 10 | udev will not have proper records about affected symlinks and nodes. Also, 11 | any node permissions defined by udev rules are not applied. This, in turn, 12 | may cause problems for other system components that rely on reading the udev 13 | database to get the list of /dev symlinks and nodes and which rely on the 14 | permissions based on udev rules. 15 | -------------------------------------------------------------------------------- /man/vgreduce.8_des: -------------------------------------------------------------------------------- 1 | vgreduce removes one or more unused PVs from a VG. 2 | -------------------------------------------------------------------------------- /man/vgreduce.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgreduce.8_end -------------------------------------------------------------------------------- /man/vgremove.8_des: -------------------------------------------------------------------------------- 1 | vgremove removes one or more VGs. If LVs exist in the VG, a prompt is used 2 | to confirm LV removal. 3 | .P 4 | If one or more PVs in the VG are lost, consider 5 | \fBvgreduce --removemissing\fP to make the VG 6 | metadata consistent again. 7 | .P 8 | Repeat the force option (\fB-ff\fP) to forcibly remove LVs in the VG 9 | without confirmation. 10 | -------------------------------------------------------------------------------- /man/vgremove.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgremove.8_end -------------------------------------------------------------------------------- /man/vgrename.8_des: -------------------------------------------------------------------------------- 1 | vgrename renames a VG. 2 | .P 3 | All VGs visible to a system need to have different names, otherwise many 4 | LVM commands will refuse to run or give warning messages. VGs with the 5 | same name can occur when disks are moved between machines, or filters are 6 | changed. If a newly connected disk has a VG with the same name as the VG 7 | containing the root filesystem, the machine may not boot correctly. When 8 | two VGs have the same name, the VG UUID can be used in place of the source 9 | VG name. 10 | -------------------------------------------------------------------------------- /man/vgrename.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH EXAMPLES 3 | . 4 | Rename VG "vg02" to "myvg": 5 | .br 6 | .B vgrename "vg02" "myvg" 7 | .P 8 | Rename the VG with the specified UUID to "myvg". 9 | .br 10 | .B vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 myvg 11 | -------------------------------------------------------------------------------- /man/vgs.8_des: -------------------------------------------------------------------------------- 1 | vgs produces formatted output about VGs. 2 | -------------------------------------------------------------------------------- /man/vgs.8_end: -------------------------------------------------------------------------------- 1 | . 2 | .SH NOTES 3 | . 4 | The vg_attr bits are: 5 | . 6 | .IP 1 3 7 | Permissions: (\fBw\fP)riteable, (\fBr\fP)ead-only 8 | . 9 | .IP 2 10 | Resi(\fBz\fP)eable 11 | . 12 | .IP 3 13 | E(\fBx\fP)ported 14 | . 15 | .IP 4 16 | (\fBp\fP)artial: one or more physical volumes belonging to the volume group 17 | are missing from the system 18 | . 19 | .IP 5 20 | Allocation policy: (\fBc\fP)ontiguous, c(\fBl\fP)ing, 21 | (\fBn\fP)ormal, (\fBa\fP)nywhere 22 | . 23 | .IP 6 24 | (\fBc\fP)lustered, (\fBs\fP)hared 25 | -------------------------------------------------------------------------------- /man/vgscan.8_des: -------------------------------------------------------------------------------- 1 | vgscan scans all supported LVM block devices in the system for VGs. 2 | -------------------------------------------------------------------------------- /man/vgscan.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgscan.8_end -------------------------------------------------------------------------------- /man/vgsplit.8_des: -------------------------------------------------------------------------------- 1 | vgsplit moves one or more PVs from a source VG (the first VG arg) to a 2 | destination VG (the second VG arg). The PV(s) to move are named after the 3 | source and destination VGs, or an LV is named, in which case the PVs 4 | underlying the LV are moved. 5 | .P 6 | If the destination VG does not exist, a new VG is created (command options 7 | can be used to specify properties of the new VG, also see 8 | \fBvgcreate\fP(8)). 9 | .P 10 | LVs cannot be split between VGs; each LV must be entirely on the PVs in 11 | the source or destination VG. 12 | .P 13 | vgsplit can only move complete PVs. (See \fBpvmove\fP(8) for moving part 14 | of a PV.) 15 | -------------------------------------------------------------------------------- /man/vgsplit.8_end: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/man/vgsplit.8_end -------------------------------------------------------------------------------- /nix/README: -------------------------------------------------------------------------------- 1 | This directory contains nix integration for building and testing LVM2 in various 2 | virtual machine configurations. The *.nix files are written in the nix 3 | declarative language (see http://nixos.org/nix). 4 | 5 | There are two basic use-cases for this integration. First, a hydra instance (see 6 | http://divine.fi.muni.cz/hydra/project/lvm2 and 7 | http://divine.fi.muni.cz/~xrockai/lvm-testmatrix.html) builds and tests LVM in 8 | all the configurations described in default.nix after every push to the git 9 | repository. Second, any nix-enabled system can very closely reproduce any of 10 | those test scenarios using the "build.sh" script and an appropriate checkout of 11 | "nixpkgs" (cf. http://nixos.org/nixpkgs). 12 | 13 | (The rest of this document is TODO.) 14 | -------------------------------------------------------------------------------- /nix/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | rm -f result 4 | rm -f divine-snapshot.tar.gz 5 | rm -rf lvm-snapshot 6 | mkdir lvm-snapshot 7 | git ls-tree -r HEAD --name-only | xargs cp --parents --target-directory=lvm-snapshot 8 | tar cvzf lvm-snapshot.tar.gz lvm-snapshot 9 | nix-build nix/ \ 10 | --arg lvm2Src "`pwd`/lvm-snapshot.tar.gz" \ 11 | --arg lvm2Nix `pwd` -A "$@" 12 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | # Dummy test file 2 | msgid "" 3 | msgstr "" 4 | "PO-Revision-Date: 2004-02-13 20:35+0000\n" 5 | "Last-Translator: Nobody \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=ISO-8859-15\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | 11 | -------------------------------------------------------------------------------- /po/pogen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU General Public License v.2. 9 | * 10 | * You should have received a copy of the GNU General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | /* 16 | * Macros to change log messages into a format that xgettext can handle. 17 | * 18 | * Note that different PRI* definitions lead to different strings for 19 | * different architectures. 20 | */ 21 | 22 | #define print_log(level, dm_errno, file, line, format, args...) print_log(format, args) 23 | #define dm_log(level, file, line, format, args...) dm_log(format, args) 24 | #define dm_log_with_errno(level, dm_errno, file, line, format, args...) \ 25 | dm_log(level, file, line, format, args) 26 | 27 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | blkdeactivate.sh 2 | blk_availability_init_red_hat 3 | blk_availability_systemd_red_hat.service 4 | clvmd_init_red_hat 5 | cmirrord_init_red_hat 6 | com.redhat.lvmdbus1.service 7 | dm_event_systemd_red_hat.service 8 | dm_event_systemd_red_hat.socket 9 | lvm2-pvscan.service 10 | lvm2_activation_generator_systemd_red_hat 11 | lvm2_cluster_activation_red_hat.sh 12 | lvm2_cluster_activation_systemd_red_hat.service 13 | lvm2_clvmd_systemd_red_hat.service 14 | lvm2_cmirrord_systemd_red_hat.service 15 | lvm2_lvmdbusd_systemd_red_hat.service 16 | lvm2_lvmetad_init_red_hat 17 | lvm2_lvmetad_systemd_red_hat.service 18 | lvm2_lvmetad_systemd_red_hat.socket 19 | lvm2_lvmlockd_systemd_red_hat.service 20 | lvm2_lvmlocking_systemd_red_hat.service 21 | lvm2_lvmpolld_init_red_hat 22 | lvm2_lvmpolld_systemd_red_hat.service 23 | lvm2_lvmpolld_systemd_red_hat.socket 24 | lvm2_monitoring_init_red_hat 25 | lvm2_monitoring_systemd_red_hat.service 26 | lvm2_pvscan_systemd_red_hat@.service 27 | lvm2_tmpfiles_red_hat.conf 28 | lvmdump.sh 29 | lvmlockd.service 30 | lvmlocks.service 31 | -------------------------------------------------------------------------------- /scripts/blk_availability_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Availability of block devices 3 | Before=shutdown.target 4 | After=iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service 5 | DefaultDependencies=no 6 | Conflicts=shutdown.target 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=/usr/bin/true 11 | ExecStop=@SBINDIR@/blkdeactivate -u -l wholevg -m disablequeueing -r wait 12 | RemainAfterExit=yes 13 | 14 | [Install] 15 | WantedBy=sysinit.target 16 | -------------------------------------------------------------------------------- /scripts/com.redhat.lvmdbus1.conf: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /scripts/com.redhat.lvmdbus1.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=com.redhat.lvmdbus1 3 | Exec=@SBINDIR@/lvmdbusd --udev 4 | User=root 5 | SystemdService=lvm2-lvmdbusd.service 6 | -------------------------------------------------------------------------------- /scripts/dm_event_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Device-mapper event daemon 3 | Documentation=man:dmeventd(8) 4 | Requires=dm-event.socket 5 | After=dm-event.socket 6 | Before=local-fs-pre.target shutdown.target 7 | Conflicts=shutdown.target 8 | DefaultDependencies=no 9 | 10 | [Service] 11 | Type=simple 12 | ExecStart=@SBINDIR@/dmeventd -f 13 | Environment=SD_ACTIVATION=1 14 | PIDFile=@DMEVENTD_PIDFILE@ 15 | OOMScoreAdjust=-1000 16 | -------------------------------------------------------------------------------- /scripts/dm_event_systemd_red_hat.socket.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Device-mapper event daemon FIFOs 3 | Documentation=man:dmeventd(8) 4 | DefaultDependencies=no 5 | 6 | [Socket] 7 | ListenFIFO=@DEFAULT_DM_RUN_DIR@/dmeventd-server 8 | ListenFIFO=@DEFAULT_DM_RUN_DIR@/dmeventd-client 9 | SocketMode=0600 10 | RemoveOnStop=true 11 | 12 | [Install] 13 | WantedBy=sockets.target 14 | -------------------------------------------------------------------------------- /scripts/lvm-devices-import.path: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=lvm-devices-import to create system.devices 3 | ConditionPathExists=!/etc/lvm/devices/system.devices 4 | 5 | # /run/lvm/lvm-devices-import created by vgchange -aay 6 | 7 | [Path] 8 | PathExists=/run/lvm/lvm-devices-import 9 | Unit=lvm-devices-import.service 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /scripts/lvm-devices-import.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Create lvm system.devices 3 | ConditionPathExists=!/etc/lvm/devices/system.devices 4 | 5 | [Service] 6 | Type=oneshot 7 | RemainAfterExit=no 8 | ExecStart=/usr/sbin/vgimportdevices --rootvg --auto 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | 13 | -------------------------------------------------------------------------------- /scripts/lvm2-pvscan.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM event activation on device %i 3 | Documentation=man:pvscan(8) 4 | DefaultDependencies=no 5 | StartLimitIntervalSec=0 6 | BindsTo=dev-block-%i.device 7 | Before=shutdown.target 8 | Conflicts=shutdown.target 9 | 10 | [Service] 11 | Type=oneshot 12 | RemainAfterExit=yes 13 | ExecStart=@SBINDIR@/lvm pvscan --cache --activate ay --autoactivation event %i 14 | ExecStop=@SBINDIR@/lvm pvscan --cache %i 15 | -------------------------------------------------------------------------------- /scripts/lvm2_cmirrord_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Clustered LVM mirror log daemon 3 | Documentation=man:cmirrord(8) 4 | Requires=corosync.service 5 | After=corosync.service 6 | Before=remote-fs-pre.target shutdown.target 7 | DefaultDependencies=no 8 | Conflicts=shutdown.target 9 | 10 | [Service] 11 | Type=forking 12 | ExecStart=@USRSBINDIR@/cmirrord 13 | PIDFile=@CMIRRORD_PIDFILE@ 14 | Restart=on-abort 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /scripts/lvm2_lvmdbusd_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM2 D-Bus service 3 | Documentation=man:lvmdbusd(8) 4 | 5 | [Service] 6 | Type=dbus 7 | BusName=com.redhat.lvmdbus1 8 | ExecStart=@SBINDIR@/lvmdbusd 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /scripts/lvm2_lvmpolld_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM2 poll daemon 3 | Documentation=man:lvmpolld(8) 4 | Requires=lvm2-lvmpolld.socket 5 | Before=shutdown.target 6 | After=lvm2-lvmpolld.socket 7 | DefaultDependencies=no 8 | Conflicts=shutdown.target 9 | 10 | [Service] 11 | Type=simple 12 | NonBlocking=true 13 | ExecStart=@SBINDIR@/lvmpolld -t 60 -f 14 | Environment=SD_ACTIVATION=1 15 | PIDFile=@LVMPOLLD_PIDFILE@ 16 | -------------------------------------------------------------------------------- /scripts/lvm2_lvmpolld_systemd_red_hat.socket.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM2 poll daemon socket 3 | Documentation=man:lvmpolld(8) 4 | DefaultDependencies=no 5 | Conflicts=shutdown.target 6 | 7 | [Socket] 8 | ListenStream=@DEFAULT_RUN_DIR@/lvmpolld.socket 9 | SocketMode=0600 10 | RemoveOnStop=true 11 | 12 | [Install] 13 | WantedBy=sysinit.target 14 | -------------------------------------------------------------------------------- /scripts/lvm2_monitoring_systemd_red_hat.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling 3 | Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8) 4 | Requires=dm-event.socket 5 | After=dm-event.socket dm-event.service 6 | Before=local-fs-pre.target shutdown.target 7 | DefaultDependencies=no 8 | Conflicts=shutdown.target 9 | 10 | [Service] 11 | Type=oneshot 12 | Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 13 | ExecStart=@SBINDIR@/lvm vgchange --monitor y 14 | ExecStop=@SBINDIR@/lvm vgchange --monitor n 15 | RemainAfterExit=yes 16 | 17 | [Install] 18 | WantedBy=sysinit.target 19 | -------------------------------------------------------------------------------- /scripts/lvm2_tmpfiles_red_hat.conf.in: -------------------------------------------------------------------------------- 1 | d @DEFAULT_LOCK_DIR@ 0700 root root - 2 | d @DEFAULT_RUN_DIR@ 0700 root root - 3 | -------------------------------------------------------------------------------- /scripts/lvm2create_initrd/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | !lvm2create_initrd.8 3 | -------------------------------------------------------------------------------- /scripts/lvm2create_initrd/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo "Nothing to do for make all" 3 | 4 | manpage: 5 | pod2man --center="create LVM2 initrd" --name='lvm2create_initrd' --section=8 -r 'lvm2create_initrd' ./lvm2create_initrd.pod > lvm2create_initrd.8 6 | 7 | -------------------------------------------------------------------------------- /scripts/lvm2create_initrd/lvm2udev: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # $Id$ 4 | 5 | # simple startup script to create lvm2 devices if /dev is a mountpoint, there 6 | # are active dm- devices, and an executable /sbin/vgscan. 7 | 8 | # this script is licensed under GPLv2. 9 | # See http://www.gnu.org/licenses/gpl.html 10 | 11 | case $1 in 12 | start) 13 | # is /dev a mountpoint? 14 | mountpoint -q /dev 15 | DEVMNTPOINT=$? 16 | 17 | # check to see if there are active dm entries under /sys 18 | ls /sys/block/dm-*/dev 1>/dev/null 2>&1 19 | ACTIVEDMDEVS=$? 20 | 21 | # mknodes if conditions are right 22 | if [ $DEVMNTPOINT -eq 0 -a $ACTIVEDMDEVS -eq 0 -a -x /sbin/vgscan ]; then 23 | /sbin/vgscan --mknodes --ignorelockingfailure 24 | fi 25 | ;; 26 | stop) 27 | exit 0 28 | ;; 29 | *) 30 | echo "usage:" 31 | echo " $0 start|stop" 32 | ;; 33 | esac 34 | -------------------------------------------------------------------------------- /scripts/lvmlockd.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM lock daemon 3 | Documentation=man:lvmlockd(8) 4 | 5 | [Service] 6 | Type=notify 7 | EnvironmentFile=-/etc/sysconfig/lvmlockd 8 | ExecStart=@SBINDIR@/lvmlockd --foreground $OPTIONS 9 | PIDFile=@LVMLOCKD_PIDFILE@ 10 | SendSIGKILL=no 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | -------------------------------------------------------------------------------- /scripts/lvmlocks.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LVM locking start and stop 3 | Documentation=man:lvmlockd(8) 4 | After=lvmlockd.service sanlock.service dlm.service 5 | 6 | [Service] 7 | Type=oneshot 8 | RemainAfterExit=yes 9 | 10 | # start lockspaces and wait for them to finish starting 11 | ExecStart=@SBINDIR@/lvm vgchange --lock-start --lock-opt auto 12 | 13 | # stop lockspaces and wait for them to finish stopping 14 | ExecStop=@SBINDIR@/lvmlockctl --stop-lockspaces --wait 1 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | .bin-dir-stamp 2 | bin 3 | init.sh 4 | results/ 5 | -------------------------------------------------------------------------------- /test/dbus/validatestate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program. If not, see . 11 | # 12 | # Simply connects to the dbus service and calls Refresh and ensures that the 13 | # value returned is zero 14 | 15 | import testlib 16 | import dbus 17 | from dbus.mainloop.glib import DBusGMainLoop 18 | import sys 19 | import os 20 | 21 | 22 | if __name__ == "__main__": 23 | 24 | use_session = os.getenv('LVMD_BUSD_USE_SESSION', False) 25 | 26 | if use_session: 27 | bus = dbus.SessionBus(mainloop=DBusGMainLoop()) 28 | else: 29 | bus = dbus.SystemBus(mainloop=DBusGMainLoop()) 30 | 31 | mgr_proxy = testlib.ClientProxy(bus, testlib.MANAGER_OBJ) 32 | sys.exit(mgr_proxy.Manager.Refresh()) 33 | -------------------------------------------------------------------------------- /test/lib/flavour-ndev-cluster-lvmpolld.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=3 2 | export LVM_TEST_LVMPOLLD=1 3 | -------------------------------------------------------------------------------- /test/lib/flavour-ndev-cluster.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=3 2 | -------------------------------------------------------------------------------- /test/lib/flavour-ndev-devicesfile.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_DEVICES_FILE=1 3 | -------------------------------------------------------------------------------- /test/lib/flavour-ndev-lvmpolld.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | -------------------------------------------------------------------------------- /test/lib/flavour-ndev-vanilla.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-cluster-lvmpolld.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=3 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_DEVDIR=/dev 4 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-cluster.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=3 2 | export LVM_TEST_DEVDIR=/dev 3 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-lvmlockd-dlm.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_LVMLOCKD=1 4 | export LVM_TEST_LVMLOCKD_TEST=1 5 | export LVM_TEST_LOCK_TYPE_DLM=1 6 | export LVM_TEST_DEVDIR=/dev 7 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-lvmlockd-idm.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_LVMLOCKD=1 4 | export LVM_TEST_LOCK_TYPE_IDM=1 5 | export LVM_TEST_DEVDIR=/dev 6 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-lvmlockd-sanlock.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_LVMLOCKD=1 4 | export LVM_TEST_LOCK_TYPE_SANLOCK=1 5 | export LVM_TEST_DEVDIR=/dev 6 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-lvmlockd-test.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_LVMLOCKD=1 4 | export LVM_TEST_LVMLOCKD_TEST=1 5 | export LVM_TEST_DEVDIR=/dev 6 | 7 | # FIXME:dct: add option to allow --test with sanlock 8 | export LVM_TEST_LVMLOCKD_TEST_DLM=1 9 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-lvmpolld.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_LVMPOLLD=1 3 | export LVM_TEST_DEVDIR=/dev 4 | -------------------------------------------------------------------------------- /test/lib/flavour-udev-vanilla.sh: -------------------------------------------------------------------------------- 1 | export LVM_TEST_LOCKING=1 2 | export LVM_TEST_DEVDIR=/dev 3 | -------------------------------------------------------------------------------- /test/lib/mke2fs.conf: -------------------------------------------------------------------------------- 1 | [defaults] 2 | base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr 3 | enable_periodic_fsck = 1 4 | blocksize = 4096 5 | inode_size = 256 6 | inode_ratio = 16384 7 | 8 | [fs_types] 9 | ext3 = { 10 | features = has_journal 11 | } 12 | ext4 = { 13 | features = has_journal,extent,huge_file,flex_bg,dir_nlink,extra_isize 14 | inode_size = 256 15 | } 16 | ext4dev = { 17 | features = has_journal,extent,huge_file,flex_bg,dir_nlink,extra_isize 18 | inode_size = 256 19 | options = test_fs=1 20 | } 21 | small = { 22 | blocksize = 1024 23 | inode_size = 128 24 | inode_ratio = 4096 25 | } 26 | floppy = { 27 | blocksize = 1024 28 | inode_size = 128 29 | inode_ratio = 8192 30 | } 31 | news = { 32 | inode_ratio = 4096 33 | } 34 | largefile = { 35 | inode_ratio = 1048576 36 | blocksize = -1 37 | } 38 | largefile4 = { 39 | inode_ratio = 4194304 40 | blocksize = -1 41 | } 42 | hurd = { 43 | blocksize = 4096 44 | inode_size = 128 45 | } 46 | -------------------------------------------------------------------------------- /test/lib/test-corosync-conf: -------------------------------------------------------------------------------- 1 | # created by lvm test suite 2 | totem { 3 | version: 2 4 | secauth: off 5 | cluster_name: test 6 | interface { 7 | ingnumber: 0 8 | bindnetaddr: 127.0.0.1 9 | mcastaddr: 239.255.255.100 10 | mcastport: 5405 11 | ttl: 1 12 | } 13 | } 14 | nodelist { 15 | node { 16 | ring0_addr: @LOCAL_NODE@ 17 | nodeid: 1 18 | } 19 | } 20 | quorum { 21 | provider: corosync_votequorum 22 | expected_votes: 1 23 | two_node: 0 24 | } 25 | logging { 26 | to_syslog: yes 27 | } 28 | 29 | -------------------------------------------------------------------------------- /test/lib/test-dlm-conf: -------------------------------------------------------------------------------- 1 | # created by lvm test suite 2 | log_debug=1 3 | enable_fencing=0 4 | 5 | -------------------------------------------------------------------------------- /test/lib/test-sanlock-conf: -------------------------------------------------------------------------------- 1 | # created by lvm test suite 2 | use_watchdog=0 3 | -------------------------------------------------------------------------------- /test/shell/aa-lvmlockd-dlm-prepare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Set up things to run tests with dlm' 14 | 15 | SKIP_WITH_LVMPOLLD=1 16 | 17 | . lib/inittest 18 | 19 | [ -z "$LVM_TEST_LOCK_TYPE_DLM" ] && skip; 20 | 21 | aux prepare_dlm 22 | aux prepare_lvmlockd 23 | 24 | -------------------------------------------------------------------------------- /test/shell/aa-lvmlockd-idm-prepare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2021 Seagate. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Set up things to run tests with idm' 14 | 15 | SKIP_WITH_LVMPOLLD=1 16 | 17 | . lib/inittest 18 | 19 | [ -z "$LVM_TEST_LOCK_TYPE_IDM" ] && skip; 20 | 21 | aux prepare_idm 22 | aux prepare_lvmlockd 23 | -------------------------------------------------------------------------------- /test/shell/activate-minor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | # Just skip this test if minor is already in use... 19 | dmsetup info | tee info 20 | grep -E "^Major, minor: *[0-9]+, 123" info && skip 21 | 22 | aux prepare_vg 2 23 | lvcreate -a n --zero n -l 1 -n foo $vg 24 | lvchange $vg/foo -My --major=255 --minor=123 25 | lvchange $vg/foo -a y 26 | dmsetup info $vg-foo | tee info 27 | grep -E "^Major, minor: *[0-9]+, 123" info 28 | 29 | vgremove -ff $vg 30 | -------------------------------------------------------------------------------- /test/shell/activate-missing-segment.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Test activation behaviour with devices missing. 14 | # - snapshots and their origins are only activated together; if one fails, both 15 | # fail 16 | # - partial mirrors are not activated (but maybe they should? maybe we should 17 | # instead lvconvert --repair them?) 18 | # - linear LVs with bits missing are not activated 19 | 20 | 21 | SKIP_WITH_LVMPOLLD=1 22 | 23 | . lib/inittest 24 | 25 | aux prepare_vg 2 26 | 27 | lvcreate -l100%FREE -n span $vg 28 | vgchange -a n $vg 29 | 30 | aux disable_dev "$dev1" 31 | not vgchange -a y $vg 32 | vgchange -a y --partial $vg 33 | check active $vg span 34 | 35 | vgremove -ff $vg 36 | -------------------------------------------------------------------------------- /test/shell/activate-partial.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 3 19 | 20 | lvcreate -aey --type mirror -m 1 -l 1 --nosync -n mirror $vg 21 | lvchange -a n $vg/mirror 22 | aux disable_dev "$dev1" 23 | 24 | not vgreduce --removemissing $vg 25 | not lvchange -v -aey $vg/mirror 26 | lvchange -v --partial -aey $vg/mirror 27 | not lvchange -v --refresh $vg/mirror 28 | lvchange -v --refresh --partial $vg/mirror 29 | 30 | # also check that vgchange works 31 | vgchange -a n --partial $vg 32 | vgchange -aey --partial $vg 33 | 34 | # check vgremove 35 | vgremove -ff $vg 36 | -------------------------------------------------------------------------------- /test/shell/activation-skip.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | # Test skip activation flag -k|--setactivationskip 19 | 20 | aux prepare_vg 21 | 22 | lvcreate -an --zero n -l 1 -n $lv1 $vg 23 | lvcreate -ky -K -l1 -n $lv2 $vg 24 | get lv_field $vg/$lv2 lv_attr | grep -- "-wi-a----k" 25 | 26 | lvchange -ay -K $vg 27 | check active $vg $lv1 28 | lvchange -an $vg 29 | 30 | lvchange -ay --setactivationskip y $vg/$lv1 31 | check inactive $vg $lv1 32 | 33 | get lv_field $vg/$lv1 lv_attr | grep -- "-wi------k" 34 | 35 | lvchange -ay -K $vg 36 | check active $vg $lv1 37 | 38 | vgremove -ff $vg 39 | -------------------------------------------------------------------------------- /test/shell/component-thin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Exercise activation of thin component devices 14 | 15 | 16 | SKIP_WITH_LVMPOLLD=1 17 | 18 | . lib/inittest 19 | 20 | aux have_thin 1 0 0 || skip 21 | 22 | aux prepare_vg 5 80 23 | 24 | lvcreate -T -L2 -V20 $vg/pool -n $lv1 25 | 26 | lvs -a 27 | 28 | lvchange -an $vg 29 | 30 | for i in pool_tdata pool_tmeta 31 | do 32 | lvchange -ay -y $vg/$i 33 | # check usable is there 34 | test -e "$DM_DEV_DIR/$vg/$i" 35 | done 36 | 37 | lvs -a 38 | 39 | # When component LVs are active, thin-pool cannot be activated 40 | not lvcreate -V20 $vg/pool 41 | 42 | # Rremoval of thin volumes should not need to activate thin-pool. 43 | vgremove -f $vg 44 | -------------------------------------------------------------------------------- /test/shell/creation-time.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2019 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Check we can read metadata with out-of-range creation time 14 | 15 | # Due to a bug in 32-bit version lvm2 <2.02.169 produced metadata 16 | # contained invalid number for creation_time 17 | 18 | SKIP_WITH_LVMPOLLD=1 19 | 20 | . lib/inittest 21 | 22 | aux prepare_vg 1 23 | 24 | lvcreate -an -L1 -n $lv1 $vg 25 | 26 | vgcfgbackup -f back $vg 27 | 28 | sed -e 's/creation_time = \(.*\)$/creation_time = 12029933779523993599/g' back >backnew 29 | 30 | vgcfgrestore -f backnew $vg |& tee err 31 | 32 | # Check the time was spotted 33 | grep Invalid err 34 | 35 | vgcfgbackup -f back $vg |& tee err 36 | 37 | # Check the time is not a problem anymore 38 | not grep Invalid err 39 | 40 | vgremove -ff $vg 41 | -------------------------------------------------------------------------------- /test/shell/dmstats-create.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | # basic dmstats create commands 25 | 26 | dmstats create "$dev1" 27 | dmstats create --start 0 --len 1 "$dev1" 28 | dmstats create --segments "$dev1" 29 | dmstats create --precise "$dev1" 30 | dmstats create --bounds 10ms,20ms,30ms "$dev1" 31 | -------------------------------------------------------------------------------- /test/shell/dmstats-group.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | GROUP_NAME="group0" 25 | 26 | # Create a region and make it part of a group with an alias 27 | dmstats create "$dev1" 28 | dmstats group --alias "$GROUP_NAME" --regions 0 "$dev1" 29 | dmstats list -ostats_name |& tee out 30 | grep "$GROUP_NAME" out 31 | 32 | # Remove the group and its regions 33 | dmstats delete --groupid 0 "$dev1" 34 | 35 | -------------------------------------------------------------------------------- /test/shell/dmstats-histogram.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | HIST_BOUNDS="10ms,20ms,30ms" 25 | 26 | # Create a region with a histogram and verify it in the list output 27 | dmstats create --bounds "$HIST_BOUNDS" "$dev1" 28 | dmstats list -ostats_name,hist_bounds |& tee out 29 | grep "$HIST_BOUNDS" out 30 | 31 | -------------------------------------------------------------------------------- /test/shell/dmstats-precise.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | # Create a region with precise_timestamps and verify it in the list output 25 | dmstats create --precise "$dev1" 26 | dmstats list -oprecise |& tee out 27 | grep "1" out 28 | 29 | -------------------------------------------------------------------------------- /test/shell/dmstats-report.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | # prepare a stats region with a histogram 25 | dmstats create --bounds 10ms,20ms,30ms "$dev1" 26 | 27 | # basic dmstats report commands 28 | dmstats report 29 | dmstats report --count 1 30 | dmstats report --histogram 31 | -------------------------------------------------------------------------------- /test/shell/dmstats-ungroup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | GROUP_NAME="group0" 25 | 26 | # Create a region and make it part of a group with an alias 27 | dmstats create "$dev1" 28 | dmstats group --alias "$GROUP_NAME" --regions 0 "$dev1" 29 | dmstats list -ostats_name |& tee out 30 | grep "$GROUP_NAME" out 31 | 32 | # Ungroup the regions then remove them 33 | dmstats ungroup --groupid 0 "$dev1" 34 | dmstats delete --allregions "$dev1" 35 | 36 | -------------------------------------------------------------------------------- /test/shell/dmstats-userdata.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | # Don't attempt to test stats with driver < 4.33.00 19 | aux driver_at_least 4 33 || skip 20 | 21 | # ensure we can create devices (uses dmsetup, etc) 22 | aux prepare_devs 1 23 | 24 | USERDATA="aword" 25 | 26 | # Create dmstats region with userdata and verify it is reported 27 | # in list output 28 | dmstats create --userdata "$USERDATA" "$dev1" 29 | dmstats list -ouserdata |& tee out 30 | grep "$USERDATA" out 31 | 32 | -------------------------------------------------------------------------------- /test/shell/duplicate-pvs-md1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2012-2021 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # . different PV/VG's that happen to have the same PVID 14 | # . a single PV/VG cloned to another device 15 | # . dm wrapper around a PV 16 | # . a single PV/VG cloned plus a dm wrapper (two separate dups of a PV) 17 | 18 | 19 | # Reuse same test just use raid level 1 20 | export MD_LEVEL=1 21 | . ./shell/duplicate-pvs-md0.sh 22 | -------------------------------------------------------------------------------- /test/shell/duplicate-vgid.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008-2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | 9 | SKIP_WITH_LVMLOCKD=1 10 | SKIP_WITH_LVMPOLLD=1 11 | 12 | . lib/inittest 13 | 14 | aux prepare_devs 2 15 | 16 | vgcreate $vg1 "$dev1" 17 | vgchange --setautoactivation n $vg1 18 | UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs) 19 | lvcreate -l1 -an -n $lv1 $vg1 20 | dd if="$dev1" of="$dev2" bs=1M count=1 21 | aux disable_dev "$dev1" 22 | vgrename $vg1 $vg2 23 | pvchange -u "$dev2" 24 | aux enable_dev "$dev1" 25 | 26 | vgs -o+uuid |tee out 27 | grep $vg1 out | tee out1 28 | grep $UUID1 out1 29 | grep $vg2 out | tee out2 30 | grep $UUID1 out2 31 | 32 | vgs $vg1 33 | vgs $vg2 34 | lvs $vg1/$lv1 35 | lvs $vg2/$lv1 36 | 37 | lvremove $vg1/$lv1 38 | lvremove $vg2/$lv1 39 | 40 | lvcreate -l1 -an -n $lv2 $vg1 41 | lvcreate -l1 -an -n $lv3 $vg2 42 | 43 | vgchange -u $vg2 44 | 45 | vgs -o uuid $vg1 |tee out 46 | grep $UUID1 out 47 | 48 | vgs -o uuid $vg2 |tee out 49 | not grep $UUID1 out 50 | 51 | vgremove -ff $vg1 52 | vgremove -ff $vg2 53 | -------------------------------------------------------------------------------- /test/shell/lvchange-partial-raid10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux have_raid 1 3 2 || skip 19 | 20 | aux prepare_vg 4 21 | 22 | # rhbz 889358 23 | # Should be able to activate when RAID10 24 | # has failed devs in different mirror sets. 25 | lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg 26 | aux wait_for_sync $vg $lv1 27 | lvchange -an $vg/$lv1 28 | aux disable_dev "$dev1" "$dev3" 29 | lvchange -ay --partial $vg/$lv1 30 | lvchange -an $vg/$lv1 31 | 32 | aux enable_dev "$dev1" 33 | 34 | vgremove -ff $vg 35 | -------------------------------------------------------------------------------- /test/shell/lvchange-raid10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | TEST_RAID=raid10 14 | 15 | . shell/lvchange-raid.sh 16 | 17 | aux have_raid 1 5 2 || skip 18 | 19 | run_types raid10 -m 1 -i 2 "$dev1" "$dev2" "$dev3" "$dev4" 20 | 21 | vgremove -ff $vg 22 | -------------------------------------------------------------------------------- /test/shell/lvchange-raid456.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | TEST_RAID=raid456 14 | 15 | . shell/lvchange-raid.sh 16 | 17 | aux raid456_replace_works || skip 18 | aux have_raid 1 5 2 || skip 19 | 20 | aux have_raid4 && run_types raid4 -i 2 "$dev1" "$dev2" "$dev3" "$dev4" 21 | run_types raid5 -i 2 "$dev1" "$dev2" "$dev3" "$dev4" 22 | run_types raid6 -i 3 "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" 23 | 24 | vgremove -ff $vg 25 | -------------------------------------------------------------------------------- /test/shell/lvconvert-cache-smq.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Exercise conversion of cache and cache pool 14 | 15 | 16 | SKIP_WITH_LVMPOLLD=1 17 | 18 | . lib/inittest 19 | 20 | aux have_cache 1 8 0 || skip 21 | 22 | aux prepare_vg 5 80 23 | 24 | lvcreate --type cache-pool -an -v -L 2 -n cpool $vg 25 | 26 | lvcreate -H --cachepolicy smq -L 4 -n corigin --cachepool $vg/cpool 27 | 28 | check lv_field $vg/corigin cache_policy "smq" 29 | 30 | lvconvert --splitcache $vg/corigin 31 | 32 | lvs -o+cache_policy -a $vg 33 | 34 | vgremove -f $vg 35 | -------------------------------------------------------------------------------- /test/shell/lvconvert-mirror-basic-0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMLOCKD=1 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . ./shell/lvconvert-mirror-basic.sh 17 | 18 | test_many 0 19 | 20 | vgremove -ff $vg 21 | -------------------------------------------------------------------------------- /test/shell/lvconvert-mirror-basic-1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | . ./shell/lvconvert-mirror-basic.sh 14 | 15 | test_many 1 16 | 17 | vgremove -ff $vg 18 | -------------------------------------------------------------------------------- /test/shell/lvconvert-mirror-basic-2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMLOCKD=1 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . ./shell/lvconvert-mirror-basic.sh 17 | 18 | test_many 2 19 | 20 | vgremove -ff $vg 21 | -------------------------------------------------------------------------------- /test/shell/lvconvert-mirror-basic-3.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMLOCKD=1 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . ./shell/lvconvert-mirror-basic.sh 17 | 18 | test_many 3 19 | 20 | vgremove -ff $vg 21 | -------------------------------------------------------------------------------- /test/shell/lvconvert-raid0-striped.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux have_raid 1 7 0 || skip 19 | 20 | aux prepare_vg 3 16 21 | 22 | lvcreate -aey --type raid0 -i 3 -l3 -n $lv $vg 23 | lvconvert -y --type striped $vg/$lv 24 | check lv_field $vg/$lv segtype "striped" 25 | vgremove -ff $vg 26 | -------------------------------------------------------------------------------- /test/shell/lvconvert-raid0_to_raid10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2017 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | # rhbz1514500 19 | 20 | aux have_raid 1 12 0 || skip 21 | 22 | # 8 PVs needed for RAID10 testing (4-stripes/2-mirror) 23 | aux prepare_vg 8 64 24 | 25 | lvcreate -y --type raid0 -R32k -i 4 -n $lv1 -L 64M $vg 26 | lvcreate -y -i4 -l4 -n $lv2 $vg 27 | lvextend -y -l +4 $vg/$lv1 28 | lvconvert -y -R512K --ty raid10 $vg/$lv1 29 | 30 | vgremove -ff $vg 31 | -------------------------------------------------------------------------------- /test/shell/lvconvert-repair-dmeventd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | which mkfs.ext2 || skip 19 | aux mirror_recovery_works || skip 20 | 21 | aux prepare_dmeventd 22 | aux prepare_vg 5 23 | 24 | lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg 25 | lvchange --monitor y $vg/4way 26 | aux disable_dev "$dev2" "$dev4" 27 | mkfs.ext2 "$DM_DEV_DIR/$vg/4way" 28 | sleep 10 # FIXME: need a "poll" utility, akin to "check" 29 | aux enable_dev "$dev2" "$dev4" 30 | 31 | # Required to repair metadata 32 | vgck --updatemetadata $vg 33 | # Show the work dmeventd 34 | # cat debug.log_DMEVENTD_* 35 | 36 | check mirror $vg 4way 37 | check mirror_legs $vg 4way 2 38 | 39 | vgremove -ff $vg 40 | -------------------------------------------------------------------------------- /test/shell/lvconvert-repair-raid-dmeventd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | which mkfs.ext3 || skip 19 | aux have_raid 1 3 0 || skip 20 | 21 | aux lvmconf \ 22 | 'activation/raid_fault_policy = "allocate"' 23 | 24 | aux prepare_dmeventd 25 | aux prepare_vg 5 26 | 27 | lvcreate -aey --type raid1 -m 3 --ignoremonitoring -L 1 -n 4way $vg 28 | lvchange --monitor y $vg/4way 29 | lvs -a -o all,lv_modules $vg 30 | lvdisplay --maps $vg 31 | aux wait_for_sync $vg 4way 32 | aux disable_dev "$dev2" "$dev4" 33 | mkfs.ext3 "$DM_DEV_DIR/$vg/4way" 34 | sleep 5 # FIXME: need a "poll" utility, akin to "check" 35 | aux enable_dev "$dev2" "$dev4" 36 | 37 | dmsetup table 38 | dmsetup status 39 | dmsetup info -c 40 | vgremove -vvvv -ff $vg 41 | -------------------------------------------------------------------------------- /test/shell/lvconvert-repair-snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2011 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 5 19 | aux lvmconf 'allocation/maximise_cling = 0' \ 20 | 'allocation/mirror_logs_require_separate_pvs = 1' 21 | 22 | lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 2M -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0 23 | lvcreate -s $vg/4way -L 2M -n snap 24 | 25 | aux disable_dev "$dev2" "$dev4" 26 | echo n | lvconvert --repair $vg/4way 2>&1 | tee 4way.out 27 | lvs -a -o +devices $vg | not grep unknown 28 | vgreduce --removemissing $vg 29 | aux enable_dev "$dev2" "$dev4" 30 | lvs -a -o +devices $vg 31 | check mirror $vg 4way "$dev5" 32 | 33 | vgchange -an $vg 34 | vgremove -ff $vg 35 | -------------------------------------------------------------------------------- /test/shell/lvconvert-repair-transient-dmeventd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2011 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_dmeventd 19 | aux mirror_recovery_works || skip 20 | aux prepare_vg 5 21 | 22 | lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg 23 | lvchange --monitor y $vg/4way 24 | aux disable_dev "$dev2" "$dev4" 25 | mkfs.ext3 "$DM_DEV_DIR/$vg/4way" 26 | aux enable_dev "$dev2" "$dev4" 27 | sleep 3 28 | lvs -a -o +devices $vg | tee out 29 | not grep unknown out 30 | check mirror $vg 4way 31 | check mirror_legs $vg 4way 2 32 | lvs -a -o +devices $vg | tee out 33 | not grep mimage_1 out 34 | lvs -a -o +devices $vg | tee out 35 | not grep mimage_3 out 36 | 37 | vgremove -f $vg 38 | -------------------------------------------------------------------------------- /test/shell/lvconvert-repair-transient.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux mirror_recovery_works || skip 19 | aux prepare_vg 5 20 | 21 | # ordinary mirrors 22 | 23 | lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg 24 | aux wait_for_sync $vg 4way 25 | aux disable_dev --error --silent "$dev2" "$dev4" 26 | mkfs.ext3 "$DM_DEV_DIR/$vg/4way" & 27 | sleep 1 28 | dmsetup status 29 | echo n | lvconvert --repair $vg/4way 2>&1 | tee 4way.out 30 | aux enable_dev --silent "$dev2" "$dev4" 31 | 32 | lvs -a -o +devices $vg | tee out 33 | not grep unknown out 34 | vgreduce --removemissing $vg 35 | check mirror $vg 4way 36 | lvchange -a n $vg/4way 37 | wait 38 | 39 | vgremove -f $vg 40 | -------------------------------------------------------------------------------- /test/shell/lvconvert-striped-raid0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux have_raid 1 7 0 || skip 19 | 20 | aux prepare_vg 3 16 21 | 22 | lvcreate -aey --type striped -i 3 -l3 -n $lv $vg 23 | lvconvert -y --type raid0_meta $vg/$lv 24 | check lv_field $vg/$lv segtype "raid0_meta" 25 | vgremove -ff $vg 26 | -------------------------------------------------------------------------------- /test/shell/lvcreate-cache-fail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Exercise creation of cache and cache pool volumes and failure path 14 | # https://bugzilla.redhat.com/1355923 15 | 16 | 17 | SKIP_WITH_LVMPOLLD=1 18 | 19 | . lib/inittest 20 | 21 | aux have_cache 1 3 0 || skip 22 | 23 | #aux prepare_pvs 1 4707950 24 | #vgcreate $SHARED $vg "$dev1" 25 | #lvcreate -L4T -n $lv1 $vg 26 | #lvcreate -H -L500G -n cache $vg/$lv1 27 | #fail lvcreate -H -l 127999 -n cache $vg/$lv1 28 | 29 | aux prepare_vg 1 20 30 | lvcreate -L10 -n $lv1 $vg 31 | fail lvcreate -H -L2 -n cache $vg/$lv1 32 | 33 | lvs -a $vg 34 | vgs $vg 35 | lvdisplay $vg 36 | 37 | #dmsetup table 38 | #dmsetup status 39 | #time dmsetup suspend ${vg}-${lv1} 40 | #time dmsetup resume ${vg}-${lv1} 41 | 42 | vgremove -ff $vg 43 | -------------------------------------------------------------------------------- /test/shell/lvcreate-missing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 2 19 | 20 | aux disable_dev "$dev1" 21 | 22 | not lvcreate -n "foo" $vg -l 1 23 | 24 | aux enable_dev "$dev1" 25 | 26 | vgremove -ff $vg 27 | -------------------------------------------------------------------------------- /test/shell/lvcreate-raid1-read-error.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 3 | # 4 | # This copyrighted material is made available to anyone wishing to use, 5 | # modify, copy, or redistribute it subject to the terms and conditions 6 | # of the GNU General Public License v.2. 7 | # 8 | # You should have received a copy of the GNU General Public License 9 | # along with this program; if not, write to the Free Software Foundation, 10 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 11 | 12 | SKIP_WITH_LVMLOCKD=1 13 | SKIP_WITH_LVMPOLLD=1 14 | 15 | . lib/inittest 16 | 17 | aux have_raid 1 3 0 || skip 18 | 19 | # Test for MD raid1 kernel bug causing read 20 | # errors on failing first leg sectors. 21 | 22 | # Create VG with 2 PVs 23 | aux prepare_vg 2 2 24 | 25 | # Create 2-legged raid1 LV 26 | lvcreate --yes --type raid1 --mirrors 1 --extents 1 --name $lv $vg 27 | aux wait_for_sync $vg $lv 28 | 29 | aux error_dev "$dev1" 20:500 30 | 31 | dd if="$DM_DEV_DIR/$vg/$lv" iflag=direct,fullblock of=/dev/zero bs=128K count=1 32 | 33 | vgremove --force $vg 34 | -------------------------------------------------------------------------------- /test/shell/lvm-init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # 14 | # tests lvm initialization, and especially negative tests of error paths 15 | # 16 | 17 | 18 | SKIP_WITH_LVMPOLLD=1 19 | 20 | . lib/inittest 21 | 22 | aux prepare_devs 5 23 | 24 | # invalid units 25 | not pvs --config 'global { units = "<" }' 26 | -------------------------------------------------------------------------------- /test/shell/lvmlockd-hello-world.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Hello world for vgcreate $SHARED with lvmlockd and sanlock' 14 | 15 | SKIP_WITH_LVMPOLLD=1 16 | 17 | . lib/inittest 18 | 19 | [ -z "$LVM_TEST_LVMLOCKD" ] && skip 20 | 21 | aux prepare_pvs 1 22 | 23 | vgcreate $SHARED $vg "$dev1" 24 | 25 | vgs -o+locktype,lockargs $vg 26 | 27 | vgremove $vg 28 | -------------------------------------------------------------------------------- /test/shell/lvmlockd_failure.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2020~2021 Seagate, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMPOLLD=1 14 | 15 | . lib/inittest 16 | 17 | [ -z "$LVM_TEST_FAILURE" ] && skip 18 | 19 | aux prepare_vg 3 20 | 21 | # Create new logic volume 22 | lvcreate -a ey --zero n -l 1 -n $lv1 $vg 23 | 24 | # FIXME - test shall NOT kill random processes in the system! 25 | # Emulate lvmlockd abnormally exiting 26 | killall -9 lvmlockd 27 | 28 | systemctl start lvm2-lvmlockd 29 | 30 | vgchange --lock-start $vg 31 | 32 | lvchange -a n $vg/$lv1 33 | lvchange -a sy $vg/$lv1 34 | 35 | lvcreate -a ey --zero n -l 1 -n $lv2 $vg 36 | lvchange -a n $vg/$lv2 37 | 38 | vgremove -ff $vg 39 | -------------------------------------------------------------------------------- /test/shell/lvresize-raid10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux have_raid 1 3 0 || skip 19 | 20 | aux prepare_vg 5 21 | 22 | for deactivate in true false; do 23 | # Extend RAID10 (2-stripes, 2-mirror) 24 | lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg 25 | 26 | test $deactivate && lvchange -an $vg/$lv1 27 | 28 | lvresize -l +2 $vg/$lv1 29 | 30 | #check raid_images_contiguous $vg $lv1 31 | 32 | # Reduce RAID10 (2-stripes, 2-mirror) 33 | NOT_RESIZE= 34 | aux have_raid 1 9 0 || NOT_RESIZE=not # missing shrink support 35 | $NOT_RESIZE lvresize --fs ignore -y -l -2 $vg/$lv1 36 | 37 | #check raid_images_contiguous $vg $lv1 38 | 39 | lvremove -ff $vg 40 | done 41 | -------------------------------------------------------------------------------- /test/shell/lvresize-thin-vdo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2024 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} 17 | 18 | . lib/inittest 19 | 20 | aux have_thin 1 10 0 || skip 21 | aux have_vdo 6 2 0 || skip 22 | 23 | aux prepare_vg 1 7000 24 | 25 | lvcreate --type thin -V10G -L5G --pooldatavdo y --name $lv1 $vg/pool 26 | 27 | check lv_field $vg/pool_tdata size "5.00g" 28 | lvresize -L+1G $vg/pool 29 | check lv_field $vg/pool_tdata size "6.00g" 30 | check lv_field $vg/pool size "6.00g" 31 | 32 | vgremove -f $vg 33 | -------------------------------------------------------------------------------- /test/shell/mda-rollback.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_devs 3 19 | 20 | vgcreate $SHARED --metadatasize 128k $vg1 "$dev1" "$dev2" "$dev3" 21 | 22 | vgreduce $vg1 "$dev1" 23 | dd if="$dev1" of=badmda bs=256K count=1 24 | vgextend $vg1 "$dev1" 25 | 26 | dd if=badmda of="$dev1" bs=256K count=1 27 | 28 | # the vg_read in vgck (and other commands) will repair the metadata 29 | vgck $vg1 30 | 31 | # dev1 is part of vg1 (as witnessed by metadata on dev2 and dev3), but its mda 32 | # was corrupt (written over by a backup from time dev1 was an orphan) 33 | check pv_field "$dev1" vg_name $vg1 34 | -------------------------------------------------------------------------------- /test/shell/orphan-ondisk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 2 19 | vgreduce $vg "$dev1" 2>&1 | not grep -i 'parse error' 20 | -------------------------------------------------------------------------------- /test/shell/process-each-pv-nomda.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Test process_each_pv with zero mda' 14 | 15 | SKIP_WITH_LVMPOLLD=1 16 | 17 | . lib/inittest 18 | 19 | aux prepare_devs 2 20 | 21 | pvcreate "$dev1" --metadatacopies 0 22 | pvcreate "$dev2" 23 | 24 | vgcreate $SHARED $vg1 "$dev1" "$dev2" 25 | 26 | pvdisplay -a -C | tee err 27 | grep "$dev1" err 28 | grep "$dev2" err 29 | 30 | vgremove $vg1 31 | -------------------------------------------------------------------------------- /test/shell/pv-min-size.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2011 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | # use small default size - 512KB 19 | aux lvmconf 'devices/pv_min_size = 512' 20 | 21 | aux prepare_pvs 1 8 22 | 23 | check pv_field "$dev1" pv_name "$dev1" 24 | 25 | # increase min size beyond created PV size 10MB 26 | aux lvmconf 'devices/pv_min_size = 10240' 27 | 28 | # and test device is not visible 29 | not check pv_field "$dev1" pv_name "$dev1" 30 | 31 | # set too low value erroneous value 32 | aux lvmconf 'devices/pv_min_size = -100' 33 | 34 | # check the incorrect value is printed 35 | pvs "$dev1" 2>&1 | grep -- -100 36 | -------------------------------------------------------------------------------- /test/shell/pvcreate-ff.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMLOCKD=1 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_devs 2 19 | pvcreate "$dev1" 20 | vgcreate foo "$dev1" 21 | pvcreate -ff -y "$dev1" 22 | vgs 23 | vgcreate foo "$dev1" 24 | -------------------------------------------------------------------------------- /test/shell/pvcreate-metadata0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # 14 | # Testcase for bugzilla #450651 15 | # also checks that vgremove properly removes all lv devices in the right order 16 | # 17 | # 'Test pvcreate without metadata on all pvs' 18 | 19 | 20 | SKIP_WITH_LVMPOLLD=1 21 | 22 | . lib/inittest 23 | 24 | aux prepare_devs 2 128 25 | 26 | #lv_snap=$lv2 27 | pvcreate "$dev1" 28 | pvcreate --metadatacopies 0 "$dev2" 29 | 30 | # "check lv snapshot" 31 | vgcreate $SHARED $vg "$dev1" "$dev2" 32 | lvcreate -aey -n $lv -l 60%FREE $vg 33 | lvcreate -s -n $lv2 -l 10%FREE $vg/$lv 34 | vgremove -f $vg 35 | -------------------------------------------------------------------------------- /test/shell/pvmove-background.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Check pvmove behavior when it's progress and machine is rebooted 14 | 15 | SKIP_WITH_LVMLOCKD=1 16 | 17 | . lib/inittest 18 | 19 | aux prepare_vg 3 20 | 21 | for mode in "--atomic" "" 22 | do 23 | lvcreate -aey -l1 -n $lv1 $vg "$dev1" 24 | 25 | lvs -o +devices | tee out 26 | grep "$dev1" out 27 | 28 | LVM_TEST_TAG="kill_me_$PREFIX" pvmove $mode -i 1 -b "$dev1" "$dev2" 29 | sleep 5 # arbitrary... 30 | lvs -o +devices | tee out 31 | not grep "pvmove" out 32 | lvs -o +devices | tee out 33 | grep "$dev2" out 34 | 35 | lvremove -ff $vg 36 | done 37 | -------------------------------------------------------------------------------- /test/shell/pvmove-lvs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description="ensure pvmove works with lvs" 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | aux throttle_dm_mirror || skip 19 | 20 | aux prepare_vg 5 180 21 | 22 | lvcreate -aey -L30 -n $lv1 $vg "$dev1" 23 | lvextend -L+30 $vg/$lv1 "$dev2" 24 | lvextend -L+30 $vg/$lv1 "$dev1" 25 | lvextend -L+30 $vg/$lv1 "$dev2" 26 | lvextend -L+30 $vg/$lv1 "$dev1" 27 | 28 | pvmove -b "$dev1" "$dev5" 2>&1 | tee out 29 | 30 | #lvchange -an $vg/$lv1 31 | lvs -a $vg 32 | 33 | pvmove --abort 34 | 35 | lvremove -ff $vg 36 | -------------------------------------------------------------------------------- /test/shell/pvmove-single.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2024 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description="ensure pvmove works on single PV" 14 | SKIP_WITH_LVMLOCKD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 1 19 | 20 | lvcreate -aey -l16 -n $lv1 $vg 21 | lvcreate -aey -l16 -n $lv2 $vg 22 | 23 | lvs -ao+seg_pe_ranges $vg 24 | 25 | pvmove -i0 --alloc anywhere "$dev1:12-19" "$dev1" 26 | 27 | lvs -ao+seg_pe_ranges,seg_size_pe $vg 28 | 29 | # both LVs should have now 2 segments 12extents + 4extents 30 | lvs --noheadings -oseg_size_pe $vg > out 31 | test 2 -eq "$(grep 12 out | wc -l)" 32 | test 2 -eq "$(grep 4 out | wc -l)" 33 | 34 | lvremove -ff $vg 35 | -------------------------------------------------------------------------------- /test/shell/pvremove-thin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Checks we are not reading our own devices 14 | # https://bugzilla.redhat.com/show_bug.cgi?id=1064374 15 | 16 | 17 | SKIP_WITH_LVMPOLLD=1 18 | 19 | . lib/inittest 20 | 21 | aux prepare_vg 22 | 23 | aux have_thin 1 8 0 || skip 24 | 25 | aux extend_filter_LVMTEST 26 | 27 | lvcreate -L10 -V10 -n $lv1 -T $vg/pool1 28 | 29 | aux extend_devices "$DM_DEV_DIR/$vg/$lv1" 30 | aux lvmconf "devices/scan_lvs = 1" 31 | 32 | pvcreate "$DM_DEV_DIR/$vg/$lv1" 33 | pvremove "$DM_DEV_DIR/$vg/$lv1" 34 | 35 | vgremove -ff $vg 36 | -------------------------------------------------------------------------------- /test/shell/pvremove-warnings.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_devs 2 19 | pvcreate "$dev1" "$dev2" 20 | pvremove "$dev1" "$dev2" 2>&1 | tee pvremove.txt 21 | not grep "No physical" pvremove.txt 22 | 23 | pvcreate "$dev1" "$dev2" 24 | vgcreate $SHARED bla "$dev1" "$dev2" 25 | pvremove -ff -y "$dev1" "$dev2" 2>&1 | tee pvremove.txt 26 | not grep "device missing" pvremove.txt 27 | -------------------------------------------------------------------------------- /test/shell/report-hidden.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2016 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | SKIP_WITH_LVMLOCKD=1 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 1 19 | lvcreate --type mirror -m1 -l1 --alloc anywhere -n $lv1 $vg 20 | 21 | aux lvmconf 'log/prefix=""' 22 | 23 | aux lvmconf "report/mark_hidden_devices = 0" 24 | lvs --noheadings -a -o name $vg > out 25 | grep "^${lv1}_mimage_0" out 26 | not grep "^\[${lv1}_mimage_0\]" out 27 | 28 | aux lvmconf "report/mark_hidden_devices = 1" 29 | lvs --noheadings -a -o name $vg > out 30 | grep "^\[${lv1}_mimage_0\]" out 31 | not grep "^${lv1}_mimage_0" out 32 | 33 | vgremove -ff $vg 34 | -------------------------------------------------------------------------------- /test/shell/snapshot-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Testing renaming snapshots in cluster 14 | # https://bugzilla.redhat.com/show_bug.cgi?id=1136925 15 | 16 | 17 | SKIP_WITH_LVMPOLLD=1 18 | 19 | . lib/inittest 20 | 21 | aux prepare_vg 1 22 | 23 | lvcreate -aey -L1 -n $lv1 $vg 24 | lvcreate -s -L1 -n $lv2 $vg/$lv1 25 | lvrename $vg/$lv2 $vg/$lv3 26 | lvremove -f $vg/$lv1 27 | 28 | vgremove -f $vg 29 | -------------------------------------------------------------------------------- /test/shell/snapshot-maxsize.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Testing calculation of snapshot space 14 | # https://bugzilla.redhat.com/show_bug.cgi?id=1035871 15 | 16 | 17 | SKIP_WITH_LVMPOLLD=1 18 | 19 | . lib/inittest 20 | 21 | aux prepare_pvs 1 22 | get_devs 23 | 24 | vgcreate $SHARED -s 4K "$vg" "${DEVICES[@]}" 25 | 26 | lvcreate -aey -L1 -n $lv1 $vg 27 | # Snapshot should be large enough to handle any writes 28 | lvcreate -L2 -s $vg/$lv1 -n $lv2 29 | 30 | dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 oflag=direct 31 | 32 | # Snapshot must not be 'I'nvalid here 33 | check lv_attr_bit state $vg/$lv2 "a" 34 | 35 | vgremove -f $vg 36 | -------------------------------------------------------------------------------- /test/shell/snapshot-rename.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # Testing renaming snapshots (had problem in cluster) 14 | # https://bugzilla.redhat.com/show_bug.cgi?id=1136925 15 | 16 | 17 | SKIP_WITH_LVMPOLLD=1 18 | 19 | . lib/inittest 20 | 21 | aux prepare_vg 1 22 | 23 | lvcreate -aey -L1 -n $lv1 $vg 24 | lvcreate -s -L1 -n $lv2 $vg/$lv1 25 | lvrename $vg/$lv2 $vg/$lv3 26 | lvremove -f $vg/$lv1 27 | 28 | vgremove -f $vg 29 | -------------------------------------------------------------------------------- /test/shell/stray-device-node.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2014 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_devs 3 19 | get_devs 20 | 21 | # Avoid manipulation with real /dev dir 22 | test "$DM_DEV_DIR" = "/dev" && skip "Skipping stray test on real /dev dir" 23 | 24 | cp -r "$dev1" "$DM_DEV_DIR/stray" 25 | 26 | vgcreate $SHARED "$vg" "${DEVICES[@]}" 27 | lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg 28 | aux disable_dev "$dev1" 29 | # FIXME: 30 | # for the .cache use case we need to run pvscan 31 | # to keep clvmd in sync. 32 | pvscan 33 | vgreduce --removemissing --force $vg 34 | aux enable_dev "$dev1" 35 | 36 | rm -f "$DM_DEV_DIR/stray" 37 | -------------------------------------------------------------------------------- /test/shell/test-partition.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # 14 | # Testcase for bugzilla #621173 15 | # exercises partition table scanning code path 16 | # 17 | 18 | 19 | 20 | SKIP_WITH_LVMPOLLD=1 21 | 22 | LVM_TEST_CONFIG_DEVICES="types = [\"device-mapper\", 142]" 23 | 24 | . lib/inittest 25 | 26 | which sfdisk || skip 27 | 28 | aux prepare_pvs 1 30 29 | 30 | pvs "$dev1" 31 | 32 | # create small partition table 33 | echo "1 2" | sfdisk --force "$dev1" 34 | 35 | not pvs "$dev1" 36 | -------------------------------------------------------------------------------- /test/shell/thin-defaults.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # test defaults entered through lvm.conf 14 | 15 | 16 | SKIP_WITH_LVMPOLLD=1 17 | 18 | export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} 19 | 20 | . lib/inittest 21 | 22 | # 23 | # Main 24 | # 25 | aux have_thin 1 0 0 || skip 26 | 27 | aux prepare_vg 2 28 | 29 | lvcreate -T -L8M $vg/pool0 30 | 31 | aux lvmconf "allocation/thin_pool_chunk_size = 128" \ 32 | "allocation/thin_pool_discards = \"ignore\"" \ 33 | "allocation/thin_pool_zero = 0" 34 | 35 | lvcreate -T -L8M $vg/pool1 36 | 37 | check lv_field $vg/pool1 chunksize "128.00k" 38 | check lv_field $vg/pool1 discards "ignore" 39 | check lv_field $vg/pool1 zero "" 40 | 41 | vgremove -f $vg 42 | -------------------------------------------------------------------------------- /test/shell/thin-restore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | # test restore operation of thin pool metadata 14 | 15 | 16 | SKIP_WITH_LVMPOLLD=1 17 | 18 | export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} 19 | 20 | . lib/inittest 21 | 22 | # 23 | # Main 24 | # 25 | aux have_thin 1 0 0 || skip 26 | 27 | aux prepare_vg 2 28 | 29 | lvcreate -T -L8M $vg/pool -V10M -n $lv1 30 | 31 | vgcfgbackup -f backup $vg 32 | 33 | # use of --force is mandatory 34 | not vgcfgrestore -f backup $vg 35 | 36 | vgcfgrestore -y -f backup --force $vg 37 | 38 | check lv_field $vg/pool transaction_id 1 39 | 40 | vgremove -f $vg 41 | -------------------------------------------------------------------------------- /test/shell/vg-raid-takeover-4.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2023 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Test VG takeover with raid LVs' 14 | 15 | CONTINUE_ELSEWHERE=y 16 | PREPARE_DEVS=4 17 | 18 | . ./shell/vg-raid-takeover-1.sh 19 | 20 | # unhide_dev 21 | # the device reappears before the LVs are repaired 22 | # and before the missing dev is removed from the vg 23 | 24 | aux unhide_dev "$dev1" 25 | 26 | pvs -o+missing 27 | vgs -o+systemid,partial $vg 28 | lvs -a -o+devices $vg 29 | 30 | vgextend --restoremissing $vg "$dev1" 31 | 32 | 33 | test_check_mount 34 | 35 | 36 | vgchange -an $vg 37 | vgremove -f $vg 38 | -------------------------------------------------------------------------------- /test/shell/vgcfgbackup-lvm1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008-2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_pvs 4 19 | get_devs 20 | 21 | if test -n "$LVM_TEST_LVM1" ; then 22 | 23 | pvcreate --metadatacopies 0 "$dev4" 24 | 25 | # No automatic backup 26 | aux lvmconf "backup/backup = 0" 27 | 28 | # vgcfgbackup correctly stores metadata LVM1 with missing PVs 29 | 30 | pvcreate -M1 "${DEVICES[@]}" 31 | vgcreate $SHARED -M1 "$vg" "${DEVICES[@]}" 32 | lvcreate -l1 -n $lv1 $vg "$dev1" 33 | pvremove -ff -y "$dev2" 34 | not lvcreate -l1 -n $lv1 $vg "$dev3" 35 | lvchange -an $vg 36 | vgcfgbackup -f "backup.$$" $vg 37 | 38 | fi 39 | -------------------------------------------------------------------------------- /test/shell/vgchange-maxlv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_dmeventd 19 | aux prepare_pvs 3 20 | get_devs 21 | 22 | vgcreate $SHARED -l 2 "$vg" "${DEVICES[@]}" 23 | lvcreate -aey -n one -l 1 $vg 24 | lvcreate -n two -l 1 $vg 25 | not lvcreate -n three -l 1 $vg 26 | vgremove -ff $vg 27 | 28 | vgcreate $SHARED -l 3 "$vg" "${DEVICES[@]}" 29 | lvcreate -aey -n one -l 1 $vg 30 | lvcreate -n snap -s -l 1 $vg/one 31 | lvcreate -n two -l 1 $vg 32 | not lvcreate -n three -l 1 $vg 33 | vgchange --monitor y $vg 34 | vgchange -an $vg 2>&1 | tee vgchange.out 35 | not grep "event server" vgchange.out 36 | 37 | vgremove -ff $vg 38 | -------------------------------------------------------------------------------- /test/shell/vgck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 3 19 | lvcreate -n blabla -L 1 $vg 20 | 21 | dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" 22 | 23 | # TODO: aux lvmconf "global/locking_type = 4" 24 | 25 | vgscan 2>&1 | tee vgscan.out || true 26 | 27 | grep "checksum" vgscan.out 28 | 29 | dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" 30 | 31 | vgck $vg 2>&1 | tee vgck.out || true 32 | grep "checksum" vgck.out 33 | 34 | vgremove -ff $vg 35 | -------------------------------------------------------------------------------- /test/shell/vgremove-corrupt-vg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2013 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux prepare_vg 3 19 | lvcreate -n blabla -L 1 $vg -an --zero n 20 | 21 | dd if=/dev/urandom bs=512 seek=2 count=32 of="$dev2" 22 | 23 | vgremove -f $vg 24 | -------------------------------------------------------------------------------- /test/shell/vgsplit-stacked.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2010 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | 14 | SKIP_WITH_LVMPOLLD=1 15 | 16 | . lib/inittest 17 | 18 | aux extend_filter_LVMTEST 19 | aux lvmconf "devices/scan_lvs = 1" 20 | 21 | aux prepare_pvs 3 22 | 23 | vgcreate $SHARED $vg1 "$dev1" "$dev2" 24 | lvcreate -n $lv1 -l 100%FREE $vg1 25 | 26 | aux extend_devices "$DM_DEV_DIR/$vg1/$lv1" 27 | 28 | #top VG 29 | pvcreate "$DM_DEV_DIR/$vg1/$lv1" 30 | vgcreate $SHARED $vg "$DM_DEV_DIR/$vg1/$lv1" "$dev3" 31 | 32 | vgchange -a n $vg $vg1 33 | 34 | # this should fail but not segfault, RHBZ 481793. 35 | not vgsplit $vg $vg1 "$dev3" 36 | 37 | vgremove -ff $vg $vg1 38 | -------------------------------------------------------------------------------- /test/shell/zz-lvmlockd-dlm-remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v.2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Remove the dlm test setup' 14 | 15 | . lib/inittest 16 | 17 | [ -z "$LVM_TEST_LOCK_TYPE_DLM" ] && skip; 18 | 19 | # FIXME: collect debug logs (only if a test failed?) 20 | # lvmlockctl -d > lvmlockd-debug.txt 21 | # dlm_tool dump > dlm-debug.txt 22 | 23 | lvmlockctl --stop-lockspaces 24 | sleep 1 25 | killall lvmlockd 26 | sleep 1 27 | killall lvmlockd || true 28 | sleep 1 29 | systemctl stop dlm 30 | systemctl stop corosync 31 | -------------------------------------------------------------------------------- /test/shell/zz-lvmlockd-idm-remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (C) 2021 Seagate. All rights reserved. 4 | # 5 | # This copyrighted material is made available to anyone wishing to use, 6 | # modify, copy, or redistribute it subject to the terms and conditions 7 | # of the GNU General Public License v2. 8 | # 9 | # You should have received a copy of the GNU General Public License 10 | # along with this program; if not, write to the Free Software Foundation, 11 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | 13 | test_description='Remove the idm test setup' 14 | 15 | . lib/inittest 16 | 17 | [ -z "$LVM_TEST_LOCK_TYPE_IDM" ] && skip; 18 | 19 | # FIXME: collect debug logs (only if a test failed?) 20 | # lvmlockctl -d > lvmlockd-debug.txt 21 | # dlm_tool dump > dlm-debug.txt 22 | 23 | lvmlockctl --stop-lockspaces 24 | sleep 1 25 | killall lvmlockd 26 | sleep 1 27 | killall lvmlockd || true 28 | sleep 1 29 | killall seagate_ilm 30 | -------------------------------------------------------------------------------- /test/unit/unit-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (C) 2018 Red Hat, Inc. All rights reserved. 3 | # 4 | # This file is part of LVM2. 5 | # 6 | # This copyrighted material is made available to anyone wishing to use, 7 | # modify, copy, or redistribute it subject to the terms and conditions 8 | # of the GNU General Public License v.2. 9 | # 10 | # You should have received a copy of the GNU General Public License 11 | # along with this program; if not, write to the Free Software Foundation, 12 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | 14 | SKIP_WITH_LVMLOCKD=1 15 | SKIP_WITH_LVMPOLLD=1 16 | 17 | SKIP_ROOT_DM_CHECK=1 18 | 19 | . lib/inittest 20 | 21 | aux unittest run 22 | -------------------------------------------------------------------------------- /tools/.exported_symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvmteam/lvm2/37b28216fd029ffe2fac815b16645aeb9d352235/tools/.exported_symbols -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | .commands 2 | dmsetup 3 | dmstats 4 | lvm 5 | cmds.h 6 | command-count.h 7 | command-lines-input.h 8 | -------------------------------------------------------------------------------- /tools/cmdnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #define xx(a, b, c...) a 17 | 18 | #include "commands.h" 19 | -------------------------------------------------------------------------------- /tools/errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #ifndef _LVM_ERRORS_H 17 | #define _LVM_ERRORS_H 18 | 19 | #define ECMD_PROCESSED 1 20 | #define ENO_SUCH_CMD 2 21 | #define EINVALID_CMD_LINE 3 22 | #define EINIT_FAILED 4 23 | #define ECMD_FAILED 5 24 | 25 | /* FIXME Also returned by cmdlib. */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /tools/formats.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #include "tools.h" 17 | 18 | int formats(struct cmd_context *cmd, int argc __attribute__((unused)), 19 | char **argv __attribute__((unused))) 20 | { 21 | display_formats(cmd); 22 | 23 | return ECMD_PROCESSED; 24 | } 25 | -------------------------------------------------------------------------------- /tools/license.inc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2023 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | -------------------------------------------------------------------------------- /tools/lvextend.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #include "tools.h" 17 | 18 | int lvextend(struct cmd_context *cmd, int argc, char **argv) 19 | { 20 | return lvresize_cmd(cmd, argc, argv); 21 | } 22 | -------------------------------------------------------------------------------- /tools/lvm-static.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU General Public License v.2. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #include "tools.h" 17 | 18 | #include "lvm2cmdline.h" 19 | 20 | int main(int argc, char **argv) 21 | { 22 | init_is_static(1); 23 | return lvm2_main(argc, argv); 24 | } 25 | 26 | int lvm_shell(struct cmd_context *cmd __attribute__((unused)), 27 | struct cmdline_context *cmdline __attribute__((unused))) 28 | { 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /tools/lvm2cmd-static.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "lvm2cmdline.h" 16 | #include "tools/lvm2cmd.h" 17 | 18 | void *lvm2_init(void) 19 | { 20 | return cmdlib_lvm2_init(1, 0); 21 | } 22 | 23 | void *lvm2_init_threaded(void) 24 | { 25 | return cmdlib_lvm2_init(1, 1); 26 | } 27 | -------------------------------------------------------------------------------- /tools/lvm2cmd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2007 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "lvm2cmdline.h" 16 | #include "tools/lvm2cmd.h" 17 | 18 | void *lvm2_init(void) 19 | { 20 | return cmdlib_lvm2_init(0, 0); 21 | } 22 | 23 | void *lvm2_init_threaded(void) 24 | { 25 | return cmdlib_lvm2_init(0, 1); 26 | } 27 | 28 | int lvm_shell(struct cmd_context *cmd __attribute__((unused)), 29 | struct cmdline_context *cmdline __attribute__((unused))) 30 | { 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /tools/lvreduce.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #include "tools.h" 17 | 18 | int lvreduce(struct cmd_context *cmd, int argc, char **argv) 19 | { 20 | return lvresize_cmd(cmd, argc, argv); 21 | } 22 | -------------------------------------------------------------------------------- /tools/pvmove_poll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #ifndef _LVM_PVMOVE_H 16 | #define _LVM_PVMOVE_H 17 | 18 | struct cmd_context; 19 | struct dm_list; 20 | struct logical_volume; 21 | struct volume_group; 22 | 23 | int pvmove_update_metadata(struct cmd_context *cmd, struct volume_group *vg, 24 | struct logical_volume *lv_mirr, 25 | struct dm_list *lvs_changed, unsigned flags); 26 | 27 | int pvmove_finish(struct cmd_context *cmd, struct volume_group *vg, 28 | struct logical_volume *lv_mirr, struct dm_list *lvs_changed); 29 | 30 | #endif /* _LVM_PVMOVE_H */ 31 | -------------------------------------------------------------------------------- /tools/segtypes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | #include "tools.h" 17 | 18 | int segtypes(struct cmd_context *cmd, int argc __attribute__((unused)), 19 | char **argv __attribute__((unused))) 20 | { 21 | display_segtypes(cmd); 22 | 23 | return ECMD_PROCESSED; 24 | } 25 | -------------------------------------------------------------------------------- /tools/tags.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Red Hat, Inc. All rights reserved. 3 | * 4 | * This file is part of LVM2. 5 | * 6 | * This copyrighted material is made available to anyone wishing to use, 7 | * modify, copy, or redistribute it subject to the terms and conditions 8 | * of the GNU Lesser General Public License v.2.1. 9 | * 10 | * You should have received a copy of the GNU Lesser General Public License 11 | * along with this program; if not, write to the Free Software Foundation, 12 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 13 | */ 14 | 15 | #include "tools.h" 16 | 17 | int tags(struct cmd_context *cmd, int argc __attribute__((unused)), 18 | char **argv __attribute__((unused))) 19 | { 20 | display_tags(cmd); 21 | 22 | return ECMD_PROCESSED; 23 | } 24 | -------------------------------------------------------------------------------- /tools/tool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 3 | * Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved. 4 | * 5 | * This file is part of LVM2. 6 | * 7 | * This copyrighted material is made available to anyone wishing to use, 8 | * modify, copy, or redistribute it subject to the terms and conditions 9 | * of the GNU Lesser General Public License v.2.1. 10 | * 11 | * You should have received a copy of the GNU Lesser General Public License 12 | * along with this program; if not, write to the Free Software Foundation, 13 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | /* Most source files should include this file or lib.h or dmlib.h */ 17 | 18 | #ifndef _LVM_TOOL_H 19 | #define _LVM_TOOL_H 20 | 21 | #include "base/memory/zalloc.h" 22 | #include "device_mapper/all.h" 23 | #include "lib/misc/util.h" 24 | 25 | #include 26 | 27 | #endif /* _LVM_TOOL_H */ 28 | -------------------------------------------------------------------------------- /udev/.gitignore: -------------------------------------------------------------------------------- 1 | 10-dm.rules 2 | 11-dm-lvm.rules 3 | 13-dm-disk.rules 4 | 69-dm-lvm.rules 5 | 69-dm-lvm-metad.rules 6 | 95-dm-notify.rules 7 | -------------------------------------------------------------------------------- /udev/95-dm-notify.rules.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 Red Hat, Inc. All rights reserved. 2 | # 3 | # This file is part of LVM2. 4 | 5 | # Udev rules for device-mapper devices. 6 | # 7 | # These rules are responsible for sending a notification to a process 8 | # waiting for completion of udev rules. The process is identified by 9 | # a cookie value sent within "change" and "remove" events (the cookie 10 | # value is set before by that process for every action requested). 11 | 12 | ENV{DM_COOKIE}=="?*", RUN+="(DM_EXEC)/dmsetup udevcomplete $env{DM_COOKIE}" 13 | --------------------------------------------------------------------------------