Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. #
  2. # This is a boilerplate LVM configuration file (/etc/lvm/lvm.conf) with a few simple modifications
  3. # that will fix a bug encountered when booting a no-modules kernel with LVM inside of a LUKS device
  4. # The bug is best described as a failure of LVM to find a disk by UUID, even though the device with
  5. # that UUID is present (in this case, in the form of an unlocked LUKS volume)
  6. #
  7. ##
  8. # Symptoms/Preconditions:
  9. # - LUKS device is unlocked and the UUID for the VG can be seen in the `blkid` output
  10. # - The LVM VGs are not present in /dev/mapper/ as expected
  11. # - Using pvscan, lvscan, vgscan and vgchange -ay have no effect
  12. # - Using vgcfgrestore with the backup file defining the configuration of the VG (explicitly!)
  13. # fails, saying it can't find the UUID for the PV
  14. # - The PV UUID is present in `blkid` output, suggesting LVM is searching using some alternate
  15. # method to find the PV by UUID
  16. #
  17. ## Cause
  18. # I honestly do not know. This may be something related to udev, as I believe the LVM tools in
  19. # the default configuration rely on UUID information from udev. As this behavior was only
  20. # encountered on a custom built kernel with modules disabled, there is a strong likelihood that
  21. # this has *something* to do with the problem- but the solution doesn't seem to have anything to do
  22. # with missing kernel features.. ???
  23. # EDIT: Cause seems likely to be a lack of a running lvmetad ..
  24. #
  25. # Solution/Workaround:
  26. #
  27. # The important changes are in the scan and filter lines. Once the lvm.conf is changed to include the
  28. # added regex patterns, the lvm tools are able to discover the UUID correctly. Once the lvm.conf file
  29. # is updated, it is possible to use all of the standard commands to activate the VG..
  30. #
  31. # lvm pvscan
  32. # lvm lvscan
  33. # lvm vgscan --mknodes
  34. # vgchange -ay
  35. #
  36. # Probably the following will be all that you need (if you have a VG backup file)
  37. # vgcfgrestore -f /etc/lvm/backup/<my>-vg <my>-vg
  38. # cgchange -ay
  39. #
  40. config {
  41. checks = 1
  42. abort_on_errors = 0
  43. profile_dir = "/etc/lvm/profile"
  44. }
  45.  
  46. devices {
  47. dir = "/dev"
  48. scan = [ "/dev", "/dev/mapper" ]
  49. obtain_device_list_from_udev = 1
  50. external_device_info_source = "none"
  51. filter = [ "a|/dev/sda.*|", "a|/dev/mapper/.*|", "a|/dev/disk/by-uuid/.*|", "a|/dev/disk/by-id/dm-uuid-.*mpath-.*|", "r|.*|"]
  52. sysfs_scan = 1
  53. scan_lvs = 1
  54. multipath_component_detection = 1
  55. md_component_detection = 1
  56. fw_raid_component_detection = 0
  57. md_chunk_alignment = 1
  58. data_alignment_detection = 1
  59. data_alignment = 0
  60. data_alignment_offset_detection = 1
  61. ignore_suspended_devices = 0
  62. ignore_lvm_mirrors = 1
  63. require_restorefile_with_uuid = 1
  64. pv_min_size = 2048
  65. issue_discards = 0
  66. allow_changes_with_duplicate_pvs = 0
  67. }
  68.  
  69. allocation {
  70. maximise_cling = 1
  71. use_blkid_wiping = 1
  72. wipe_signatures_when_zeroing_new_lvs = 1
  73. mirror_logs_require_separate_pvs = 0
  74. cache_pool_metadata_require_separate_pvs = 0
  75. thin_pool_metadata_require_separate_pvs = 0
  76. }
  77.  
  78. log {
  79. verbose = 0
  80. silent = 0
  81. syslog = 1
  82. overwrite = 0
  83. level = 0
  84. indent = 1
  85. command_names = 0
  86. prefix = " "
  87. activation = 0
  88. debug_classes = [ "memory", "devices", "io", "activation", "allocation", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
  89. }
  90.  
  91. backup {
  92. backup = 1
  93. backup_dir = "/etc/lvm/backup"
  94. archive = 1
  95. archive_dir = "/etc/lvm/archive"
  96. retain_min = 10
  97. retain_days = 30
  98. }
  99.  
  100. shell {
  101. history_size = 100
  102. }
  103.  
  104. global {
  105. umask = 077
  106. test = 0
  107. units = "r"
  108. si_unit_consistency = 1
  109. suffix = 1
  110. activation = 1
  111. proc = "/proc"
  112. etc = "/etc"
  113. wait_for_locks = 1
  114. locking_dir = "/run/lock/lvm"
  115. prioritise_write_locks = 1
  116. abort_on_internal_errors = 0
  117. metadata_read_only = 0
  118. mirror_segtype_default = "raid1"
  119. raid10_segtype_default = "raid10"
  120. sparse_segtype_default = "thin"
  121. event_activation = 1
  122. use_lvmlockd = 0
  123. system_id_source = "none"
  124. use_lvmpolld = 1
  125. notify_dbus = 1
  126. }
  127.  
  128. activation {
  129. checks = 0
  130. udev_sync = 1
  131. udev_rules = 1
  132. verify_udev_operations = 0
  133. retry_deactivation = 1
  134. missing_stripe_filler = "error"
  135. use_linear_target = 1
  136. reserved_stack = 64
  137. reserved_memory = 8192
  138. process_priority = -18
  139. raid_region_size = 2048
  140. readahead = "auto"
  141. raid_fault_policy = "warn"
  142. mirror_image_fault_policy = "remove"
  143. mirror_log_fault_policy = "allocate"
  144. snapshot_autoextend_threshold = 100
  145. snapshot_autoextend_percent = 20
  146. thin_pool_autoextend_threshold = 100
  147. thin_pool_autoextend_percent = 20
  148. vdo_pool_autoextend_threshold = 100
  149. use_mlockall = 0
  150. monitoring = 1
  151. polling_interval = 15
  152. activation_mode = "degraded"
  153. }
  154.  
  155. dmeventd {
  156. mirror_library = "libdevmapper-event-lvm2mirror.so"
  157. snapshot_library = "libdevmapper-event-lvm2snapshot.so"
  158. thin_library = "libdevmapper-event-lvm2thin.so"
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement