答案1
该问题与 systemd/udev 有关。
解决方案是从向后移植安装 systemd 和 udev 版本 250.3-2~bpo11+1 或更高版本并重新启动,这对我有用。
答案2
我的目标也有同样的问题。但是,在带有 systemd 251.5-1 的 Debian 11.5 上,我不可能改变这种行为。
在我的 LVM 日志中,始终遵循以下消息
警告:即使等待 10000000 微秒,设备 /dev/sda17 也未在 udev 数据库中初始化。
对我来说,解决方案是通过设置来改变 LVM 的行为udev_sync和udev_规则为 0 而不是 Debian 标准值 1。
请在下面找到我的配置。
$ cat /etc/lvm/lvm.conf |grep -v "#" |grep -v ^$
config {
checks = 1
abort_on_errors = 0
profile_dir = "/etc/lvm/profile"
}
devices {
dir = "/dev"
scan = [ "/dev" ]
obtain_device_list_from_udev = 1
external_device_info_source = "none"
cache_dir = "/run/lvm"
cache_file_prefix = ""
write_cache_state = 1
sysfs_scan = 1
multipath_component_detection = 1
md_component_detection = 1
fw_raid_component_detection = 0
md_chunk_alignment = 1
data_alignment_detection = 1
data_alignment = 0
data_alignment_offset_detection = 1
ignore_suspended_devices = 0
ignore_lvm_mirrors = 1
disable_after_error_count = 0
require_restorefile_with_uuid = 1
pv_min_size = 2048
issue_discards = 0
allow_changes_with_duplicate_pvs = 0
}
allocation {
maximise_cling = 1
use_blkid_wiping = 1
wipe_signatures_when_zeroing_new_lvs = 1
mirror_logs_require_separate_pvs = 0
cache_pool_metadata_require_separate_pvs = 0
thin_pool_metadata_require_separate_pvs = 0
}
log {
report_command_log = 1
command_log_sort = "log_seq_num"
command_log_cols = "log_seq_num,log_type,log_context,log_object_type,log_object_name,log_object_id,log_object_group,log_object_group_id,log_message,log_errno,log_ret_code"
verbose = 0
silent = 0
syslog = 0
file = "/var/log/lvm/lvm.log"
overwrite = 0
level = 5
indent = 1
command_names = 0
prefix = " "
activation = 0
debug_classes = [ "memory", "devices", "activation", "allocation", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
}
backup {
backup = 1
backup_dir = "/etc/lvm/backup"
archive = 1
archive_dir = "/etc/lvm/archive"
retain_min = 10
retain_days = 30
}
shell {
history_size = 100
}
global {
umask = 077
test = 0
units = "h"
si_unit_consistency = 1
suffix = 1
activation = 1
fallback_to_lvm1 = 0
format = "lvm2"
proc = "/proc"
etc = "/etc"
locking_type = 1
wait_for_locks = 1
fallback_to_clustered_locking = 1
fallback_to_local_locking = 1
locking_dir = "/run/lock/lvm"
prioritise_write_locks = 1
abort_on_internal_errors = 0
detect_internal_vg_cache_corruption = 0
metadata_read_only = 0
mirror_segtype_default = "raid1"
raid10_segtype_default = "raid10"
sparse_segtype_default = "thin"
use_lvmetad = 1
lvmetad_update_wait_time = 10
use_lvmlockd = 0
lvmlockd_lock_retries = 3
system_id_source = "none"
use_lvmpolld = 1
notify_dbus = 1
}
activation {
checks = 0
udev_sync = 0
udev_rules = 0
verify_udev_operations = 0
retry_deactivation = 1
missing_stripe_filler = "error"
use_linear_target = 1
reserved_stack = 64
reserved_memory = 8192
process_priority = -18
raid_region_size = 512
readahead = "auto"
raid_fault_policy = "warn"
mirror_image_fault_policy = "remove"
mirror_log_fault_policy = "allocate"
snapshot_autoextend_threshold = 100
snapshot_autoextend_percent = 20
thin_pool_autoextend_threshold = 100
thin_pool_autoextend_percent = 20
use_mlockall = 0
monitoring = 1
polling_interval = 15
activation_mode = "degraded"
}
report {
output_format = "basic"
compact_output = 0
compact_output_cols = ""
aligned = 1
buffered = 1
separator = " "
list_item_separator = ","
prefixes = 0
quoted = 1
binary_values_as_numeric = 0
time_format = "%Y-%m-%d %T %z"
devtypes_sort = "devtype_name"
devtypes_cols = "devtype_name,devtype_max_partitions,devtype_description"
devtypes_cols_verbose = "devtype_name,devtype_max_partitions,devtype_description"
lvs_sort = "vg_name,lv_name"
lvs_cols = "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,metadata_percent,move_pv,mirror_log,copy_percent,convert_lv"
lvs_cols_verbose = "lv_name,vg_name,seg_count,lv_attr,lv_size,lv_major,lv_minor,lv_kernel_major,lv_kernel_minor,pool_lv,origin,data_percent,metadata_percent,move_pv,copy_percent,mirror_log,convert_lv,lv_uuid,lv_profile"
vgs_cols = "vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"
vgs_cols_verbose = "vg_name,vg_attr,vg_extent_size,pv_count,lv_count,snap_count,vg_size,vg_free,vg_uuid,vg_profile"
pvs_sort = "pv_name"
pvs_cols = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"
pvs_cols_verbose = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,dev_size,pv_uuid"
segs_sort = "vg_name,lv_name,seg_start"
segs_cols = "lv_name,vg_name,lv_attr,stripes,segtype,seg_size"
segs_cols_verbose = "lv_name,vg_name,lv_attr,seg_start,seg_size,stripes,segtype,stripesize,chunksize"
pvsegs_sort = "pv_name,pvseg_start"
pvsegs_cols = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size"
pvsegs_cols_verbose = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size,lv_name,seg_start_pe,segtype,seg_pe_ranges"
vgs_cols_full = "vg_all"
pvs_cols_full = "pv_all"
lvs_cols_full = "lv_all"
pvsegs_cols_full = "pvseg_all,pv_uuid,lv_uuid"
segs_cols_full = "seg_all,lv_uuid"
vgs_sort_full = "vg_name"
pvs_sort_full = "pv_name"
lvs_sort_full = "vg_name,lv_name"
pvsegs_sort_full = "pv_uuid,pvseg_start"
segs_sort_full = "lv_uuid,seg_start"
mark_hidden_devices = 1
two_word_unknown_device = 0
}
dmeventd {
mirror_library = "libdevmapper-event-lvm2mirror.so"
raid_library = "libdevmapper-event-lvm2raid.so"
snapshot_library = "libdevmapper-event-lvm2snapshot.so"
thin_library = "libdevmapper-event-lvm2thin.so"
executable = "/sbin/dmeventd"
}