Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd and lvm2 and lvmetad
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 23, 2014 2:58 am    Post subject: systemd and lvm2 and lvmetad Reply with quote

Since I migrated to Gnome 3 from Gnome 2, I needed to migrate as well to systemd (okay, I know now Gnome 3 is also working with openrc but it is too late).

In the migration to systemd, the migration document at section Using LVM2 and initramfs for systemd instructs us to set use_lvmetad = 1 in /etc/lvm/lvm.conf. So I did. I can boot my system, no problem, I can access my LV, VG and all the stuff.

The problem occurs when I want to resize a LV, create a new LV, create a VG and so on. I am getting all kind of errors and it seems this is related to the change to use_lvmetad = 1. I read the documentation, searched the web and I was unable to find anything useful to solve this problem.

So, to track down this problem I am giving here a very specific scenario. I am creating a new VG with a single PV, then I am trying to create a LV on the VG. Here are the steps:

Code:
feynman linux # vgcreate rpivg1 /dev/sdd2
  Volume group "rpivg1" successfully created
feynman linux # lvcreate --size 100M --name testlv rpivg1
  Not activating rpivg1/testlv since it does not pass activation filter.
  Failed to activate new LV.


Here is my /etc/lvm/lvm.conf:
Code:
feynman linux # cat /etc/lvm/lvm.conf
config {
    checks = 1
    abort_on_errors = 0
    profile_dir = "/etc/lvm/profile"
}
devices {
    dir = "/dev"
    scan = [ "/dev" ]
    obtain_device_list_from_udev = 1
    preferred_names = [ ]
    filter = [ "r|/dev/nbd.*|", "a/.*/" ]
    cache_dir = "/etc/lvm/cache"
    cache_file_prefix = ""
    write_cache_state = 1
    sysfs_scan = 1
    multipath_component_detection = 1
    md_component_detection = 1
    md_chunk_alignment = 1
    data_alignment_detection = 1
    data_alignment = 0
    data_alignment_offset_detection = 1
    ignore_suspended_devices = 0
    disable_after_error_count = 0
    require_restorefile_with_uuid = 1
    pv_min_size = 2048
    issue_discards = 0
}
allocation {
    maximise_cling = 1
    mirror_logs_require_separate_pvs = 0
    thin_pool_metadata_require_separate_pvs = 0
}
log {
    verbose = 0
    silent = 0
    syslog = 0
    file = "/var/log/lvm2.log"
    overwrite = 0
    level = 0
    indent = 1
    command_names = 0
    prefix = "  "
    debug_classes = [ "memory", "devices", "activation", "allocation",
            "lvmetad", "metadata", "cache", "locking" ]
}
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
    activation = 1
    fallback_to_lvm1 = 0
    proc = "/proc"
    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"
    use_lvmetad = 1
}
activation {
    checks = 0
    udev_sync = 1
    udev_rules = 1
    verify_udev_operations = 0
    retry_deactivation = 1
    missing_stripe_filler = "error"
    use_linear_target = 1
    reserved_stack = 64
    reserved_memory = 8192
    process_priority = -18
    volume_list = [ "racinevg", "donneesvg", "bb10vg", "rpivg1/*" ]
    raid_region_size = 512
    readahead = "auto"
    raid_fault_policy = "warn"
    mirror_log_fault_policy = "allocate"
    mirror_image_fault_policy = "remove"
    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
}
metadata {
}
dmeventd {
    mirror_library = "libdevmapper-event-lvm2mirror.so"
    snapshot_library = "libdevmapper-event-lvm2snapshot.so"
    thin_library = "libdevmapper-event-lvm2thin.so"
}


If I increase the level of messages and errors reported to the maximum, here is what I am getting following the very same steps above:

Code:
feynman linux # vgcreate rpivg1 /dev/sdd2
    Logging initialised at Fri Aug 22 22:45:08 2014
    Set umask from 0022 to 0077
    Adding physical volume '/dev/sdd2' to volume group 'rpivg1'
    Archiving volume group "rpivg1" metadata (seqno 0).
    Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 1).
  Volume group "rpivg1" successfully created
    Wiping internal VG cache
feynman linux # lvcreate --size 100M --name testlv rpivg1
    Logging initialised at Fri Aug 22 22:45:22 2014
    Set umask from 0022 to 0077
    Setting logging type to disk
    Finding volume group "rpivg1"
    Archiving volume group "rpivg1" metadata (seqno 1).
    Creating logical volume testlv
    Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 2).
    activation/volume_list configuration setting defined: Checking the list to match rpivg1/testlv
    No item supplied in activation/volume_list configuration setting matches rpivg1/testlv
  Not activating rpivg1/testlv since it does not pass activation filter.
  Failed to activate new LV.
    Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 3).
    Wiping internal VG cache


And here is the content of the logfile /var/log/lvm2.log with level = 4:

Code:
feynman linux # cat /var/log/lvm2.log
commands/toolcontext.c:234   Logging initialised at Fri Aug 22 22:55:24 2014
commands/toolcontext.c:303   Set umask from 0022 to 0077
metadata/metadata.c:190   Adding physical volume '/dev/sdd2' to volume group 'rpivg1'
format_text/archiver.c:137   Archiving volume group "rpivg1" metadata (seqno 0).
format_text/archiver.c:438   Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 1).
vgcreate.c:126   Volume group "rpivg1" successfully created
cache/lvmcache.c:1605   Wiping internal VG cache
commands/toolcontext.c:234   Logging initialised at Fri Aug 22 22:55:24 2014
commands/toolcontext.c:303   Set umask from 0022 to 0077
cache/lvmcache.c:1605   Wiping internal VG cache
commands/toolcontext.c:234   Logging initialised at Fri Aug 22 22:55:34 2014
commands/toolcontext.c:303   Set umask from 0022 to 0077
lvcreate.c:486   Setting logging type to disk
lvcreate.c:1083   Finding volume group "rpivg1"
format_text/archiver.c:137   Archiving volume group "rpivg1" metadata (seqno 1).
metadata/lv_manip.c:4317   Creating logical volume testlv
format_text/archiver.c:438   Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 2).
activate/activate.c:451   activation/volume_list configuration setting not defined: Checking only host tags for rpivg1/testlv
metadata/lv_manip.c:5400   Clearing start of logical volume "testlv"
metadata/lv_manip.c:5403   /dev/rpivg1/testlv: not found: device not cleared
metadata/lv_manip.c:6058   Aborting. Failed to wipe start of new LV.
format_text/archiver.c:438   Creating volume group backup "/etc/lvm/backup/rpivg1" (seqno 3).
libdm-common.c:2172   semid 917506: semop failed for cookie 0xd4dfdf6: incorrect semaphore state
libdm-common.c:2434   Failed to set a proper state for notification semaphore identified by cookie value 223215094 (0xd4dfdf6) to initialize waiting for incoming notifications.
cache/lvmcache.c:1605   Wiping internal VG cache
commands/toolcontext.c:234   Logging initialised at Fri Aug 22 22:55:34 2014
commands/toolcontext.c:303   Set umask from 0022 to 0077
cache/lvmcache.c:1605   Wiping internal VG cache


Anyone can decipher this stuff? I just don't get why the /dev/rpivg1/testlv special file isn't created neither the VG's device file /dev/rpivg1 despite the fact the VG creation succeeded.
_________________
Achille Talon Hop!


Last edited by AchilleTalon on Sat Aug 23, 2014 1:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Sat Aug 23, 2014 8:30 am    Post subject: Reply with quote

Do you mind stripping comments? Filtering configs with
Quote:
grep -v '^[[:space:]]*#\|^[[:space:]]*$'

makes them much more readable
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Sat Aug 23, 2014 1:03 pm    Post subject: Reply with quote

szatox wrote:
Do you mind stripping comments? Filtering configs with
Quote:
grep -v '^[[:space:]]*#\|^[[:space:]]*$'

makes them much more readable


Done.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum