From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0GdbAxPMvV49aAAA0tVLHw (envelope-from ) for ; Thu, 14 May 2020 22:54:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +JWbOhLMvV70fwAAbx9fmQ (envelope-from ) for ; Thu, 14 May 2020 22:54:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D4AA940EED for ; Thu, 14 May 2020 22:54:10 +0000 (UTC) Received: from localhost ([::1]:49986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZMjw-0007z2-R6 for larch@yhetil.org; Thu, 14 May 2020 18:54:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZMjq-0007yo-2B for guix-patches@gnu.org; Thu, 14 May 2020 18:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZMjp-0007Y8-PZ for guix-patches@gnu.org; Thu, 14 May 2020 18:54:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZMjp-0001gA-Mp for guix-patches@gnu.org; Thu, 14 May 2020 18:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41143] Some clarification References: In-Reply-To: Resent-From: Mikhail Tsykalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 May 2020 22:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41143 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41143@debbugs.gnu.org Received: via spool by 41143-submit@debbugs.gnu.org id=B41143.15894968206333 (code B ref 41143); Thu, 14 May 2020 22:54:01 +0000 Received: (at 41143) by debbugs.gnu.org; 14 May 2020 22:53:40 +0000 Received: from localhost ([127.0.0.1]:35166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZMjQ-0001dp-I5 for submit@debbugs.gnu.org; Thu, 14 May 2020 18:53:40 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:42261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZMjO-0001cz-AG for 41143@debbugs.gnu.org; Thu, 14 May 2020 18:53:35 -0400 Received: by mail-lj1-f176.google.com with SMTP id d21so147360ljg.9 for <41143@debbugs.gnu.org>; Thu, 14 May 2020 15:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=96RV259xHiZkMoU6IGaxGq/V6XeE05Ikm1BZ6rg0cWs=; b=sGZ7ebyVd+Buwl98Y8JOByzInVWXmwYV9vhR3qFjnbg63oN2/qXs5Eqx4zPVvo2/Bc t5mEMt8JgWy3xRtzoT0kZB/hr6t0rkpkqzVtu3hisLoipkLEiVLXF+yN+l5TR6e0HxTc E5AfRywmLpHxYB0/cf4pk960vW2kIJup2KWHZtr9MvTWWbYKGrL6wj5QO/fMCIkeCMnJ LG58+MBsJ+yo9K9Vp5OF8F9gW/80Saf4WsDyw7dy9f/SNOYab+RIKMoXcKhWnKJb9k5V A2wb7EBHLdFWuoVl5dUgO5IldZQTNjUlMxgAaKzrIZ5qfXRRaQGVnc1WDa830KrGo5et BWVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=96RV259xHiZkMoU6IGaxGq/V6XeE05Ikm1BZ6rg0cWs=; b=M9cAxnUG4y7SJylNGrxe3sGY8EW2S2h10stpBFBKikqLMjvAidwfNXkwmzzPPEvOWs Y2booTnzO4rH6gSoQjECb/QsTWE5khM7FXvVBhf0I07x0Vgx/O9E9YrYiiA2DtNCVDEQ jOvT6Ev46Hfd2T06UeNhFNULc9y/5GFlL+su6VaPiYtcbEGbDif6vL3Se/SFS9XvEWAv 5h8l5QM4wHPe2GT5Rx48r+yYKq5/r7RYquq5XQhnygzedfSPpwSutp8u70EzLEhufuiF JQFnwTQPn1xOckO7JMlUI/0SVQ/X0pAHkhh75Q9Rst+USGEBtP/GIjiX0kxWglFEIcuC 5M4g== X-Gm-Message-State: AOAM5310Z2r3IedCp3BS59pCb67AtQ4BDjXdChIXm2o2789nVC3lVJrE Vyh07CZ0i5o0wNi5zxaa6JADA+/txFM= X-Google-Smtp-Source: ABdhPJyBDNyH4UGh65NsphEVtI9l/a8lLhLn7Ext3Nff8wNmXScRFZCrbcshHtQtr/lroo6Ki2wtzw== X-Received: by 2002:a2e:81d5:: with SMTP id s21mr321948ljg.258.1589496807531; Thu, 14 May 2020 15:53:27 -0700 (PDT) Received: from [192.168.0.75] ([88.201.200.191]) by smtp.gmail.com with ESMTPSA id y9sm143259ljy.31.2020.05.14.15.53.26 for <41143@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 15:53:27 -0700 (PDT) From: Mikhail Tsykalov Message-ID: <7e96c284-c69c-965f-6bae-9546b1c711ad@gmail.com> Date: Fri, 15 May 2020 01:53:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Icedove/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=sGZ7ebyV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.59 X-TUID: hpZRHD3A+2a7 Hi, In LVM one volume group usually haves more than one logical volume, so target need to be a list. Just setting target to list in config doesn't work because that field is actually used for checking when (and whether at all) the device needs to be mounted. Because we still need to support using a string as target, we need to handle two situations: target is a string and target is list of strings. Patch converts plain string target to single element list and proceeds with assuming a list. grep by mapped-device-target revealed two uses in gnu/system.scm and one in gnu/services/base.scm. First two checked if any filesystems used a device, so I replaced plain string comparison with comparison with every element of list and returning true if any of them matched. Last one used target for building service name for shepherd, so I replaced plain target with concatenation of every target that mapped device has. Moving on to second patch. Basically to mount LVM you need to activate volume group(s) with command "vgchange -ay". It worked fine with non-root mounts, but when it got moved in initrd it crashed. Quick look around found that while /dev/dm-X devices were being created, /dev/mapper/ nodes were not. Looking at man pages (and internet) "vgscan --mknodes" looked like what I wanted (there is also dmsetup mknodes, but basically first just calls it). After adding it, boot with root on LVM started working, so I left it. Also I check that targets actually exist, so you get crash in a bit more appropriate place. This check should probably be moved to somewhere else, but I haven't found better solution. Looking at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/udev_device_manager 10-dm.rules looks like what creates /dev/mapper nodes in normal systems, so probably more proper solution will be to add udevd to initrd, but I don't know how to run daemons in initrd properly. dracut also creates file /etc/lvm/lvm.conf, which doesn't seem to be very important, but I probably should look closer to it. Also both dracut and LVM add "--ignorelockingfailure" flag to vgchange, which I forgot and will change in future patches. There seems to be close to no resources about mounting LVM in initrd, so I'm adding code from other initrd generators: Dracut: https://github.com/dracutdevs/dracut/blob/master/modules.d/90lvm/lvm_scan.sh LVM: https://github.com/lvmteam/lvm2/blob/master/scripts/lvm2create_initrd/lvm2create_initrd