]> sourceware.org Git - lvm2.git/commit
Allow system.devices to be automatically created on first boot 1299853171
authorDavid Teigland <teigland@redhat.com>
Tue, 23 Apr 2024 22:08:26 +0000 (17:08 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 21 May 2024 21:29:12 +0000 (16:29 -0500)
commitc609dedc2f035f770b5f645c4695924abf15c2ca
tree4fe16d08fe13356074d9bdaf8c5b8c2b26a117c4
parent6fdc8787eb507b706c20eb47cfdc3f7c2dba8118
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.
lib/commands/toolcontext.h
lib/config/defaults.h
lib/device/device_id.c
scripts/lvm-devices-import.path [new file with mode: 0644]
scripts/lvm-devices-import.service [new file with mode: 0644]
tools/args.h
tools/command-lines.in
tools/pvscan.c
tools/tools.h
tools/vgchange.c
tools/vgimportdevices.c
This page took 0.041552 seconds and 5 git commands to generate.