1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00
lvm2/lib/device
David Teigland c609dedc2f Allow system.devices to be automatically created on first boot
An OS installer can create system.devices for the system and
disks, but an OS image cannot create the system-specific
system.devices.  The OS image can instead configure the
image so that lvm will create system.devices on first boot.

Image preparation steps to enable auto creation of system.devices:
- create empty file /etc/lvm/devices/auto-import-rootvg
- remove any existing /etc/lvm/devices/system.devices
- enable lvm-devices-import.path
- enable lvm-devices-import.service

On first boot of the prepared image:
- udev triggers vgchange -aay --autoactivation event <rootvg>
- vgchange activates LVs in the root VG
- vgchange finds the file /etc/lvm/devices/auto-import-rootvg,
  and no /etc/lvm/devices/system.devices, so it creates
  /run/lvm/lvm-devices-import
- lvm-devices-import.path is run when /run/lvm/lvm-devices-import
  appears, and triggers lvm-devices-import.service
- lvm-devices-import.service runs vgimportdevices --rootvg --auto
- vgimportdevices finds /etc/lvm/devices/auto-import-rootvg,
  and no system.devices, so it creates system.devices containing
  PVs in the root VG, and removes /etc/lvm/devices/auto-import-rootvg
  and /run/lvm/lvm-devices-import

Run directly, vgimportdevices --rootvg (without --auto), will create
a new system.devices for the root VG, or will add devices for the
root VG to an existing system.devices.
2024-05-21 16:29:12 -05:00
..
bcache-utils.c gcc: correct signess comparation 2023-07-13 21:31:18 +02:00
bcache.c cleanup: drop unused declared struct 2024-05-13 02:21:37 +02:00
bcache.h bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
dev_util.c devices: factor common list functions 2022-11-07 11:38:46 -06:00
dev-cache.c clenaup: update local static with _ 2024-05-08 01:55:21 +02:00
dev-cache.h device_id: rewrite validation of devname entries 2023-08-04 11:45:40 -05:00
dev-dasd.c cov: mask uninitialized value 2021-03-10 01:34:27 +01:00
dev-ext-udev-constants.h dev-type: check for DEVLINKS udev db variable existence if udev_device_get_is_initialized fn is not present 2016-09-06 13:21:29 +02:00
dev-ext.c const: use arrays of strings 2024-05-04 01:01:57 +02:00
dev-io.c cleanup: correcting some log_print 2023-05-06 20:38:49 +02:00
dev-luks.c filter: remove unused EAGAIN case and flag 2022-04-06 12:51:34 -05:00
dev-lvm1-pool.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-md.c filter: remove unused EAGAIN case and flag 2022-04-06 12:51:34 -05:00
dev-mpath.c gcc: clean cast with -Wbad-function-cast 2024-05-14 17:59:26 +02:00
dev-swap.c filter: remove unused EAGAIN case and flag 2022-04-06 12:51:34 -05:00
dev-type.c gcc: correct signess comparation 2023-07-13 21:31:18 +02:00
dev-type.h gcc: correct signess comparation 2023-07-13 21:31:18 +02:00
device_id.c Allow system.devices to be automatically created on first boot 2024-05-21 16:29:12 -05:00
device_id.h lvmdevices: new output and options for check and update 2023-11-02 11:46:31 -05:00
device-types.h devices: recognise rbd (ceph rados block device) 2021-12-13 13:32:06 -06:00
device.h device_id: remove unused dev pointer from dev_id struct 2023-11-09 13:15:02 -06:00
filesystem.c cov: avoid TOCTOU 2024-05-08 01:55:21 +02:00
filesystem.h lvresize: fail early if crypt device is missing 2023-01-30 17:12:11 -06:00
online.c gcc: clear some complains 2024-04-08 14:52:23 +02:00
online.h cleanup: correcting some log_print 2023-05-06 20:38:49 +02:00
parse_vpd.c gcc: correct signess comparation 2023-07-13 21:31:18 +02:00