<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=2690&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Shutdown encrypted LVM on Beowulf]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=2690</link>
		<description><![CDATA[The most recent posts in Shutdown encrypted LVM on Beowulf.]]></description>
		<lastBuildDate>Tue, 04 Apr 2023 15:11:03 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41754#p41754</link>
			<description><![CDATA[<div class="quotebox"><cite>czeekaj wrote:</cite><blockquote><div><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>&#160; I haven&#039;t tested this yet, because I have&#039;t been able to boot into my encrypted lvm install.</p></div></blockquote></div><p>Have you tried using the Debian installer? <br />For LVM install I find it works flawlessly.</p></div></blockquote></div><p>I did use d-i, but then I must have done something to break that system. It was just a test system in a VM. I tested again with a fresh install the next day, and I&#039;m not able to reproduce the problem.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Tue, 04 Apr 2023 15:11:03 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41754#p41754</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41742#p41742</link>
			<description><![CDATA[<div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>&#160; I haven&#039;t tested this yet, because I have&#039;t been able to boot into my encrypted lvm install.</p></div></blockquote></div><p>Have you tried using the Debian installer? <br />For LVM install I find it works flawlessly.</p>]]></description>
			<author><![CDATA[dummy@example.com (czeekaj)]]></author>
			<pubDate>Tue, 04 Apr 2023 04:44:25 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41742#p41742</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41075#p41075</link>
			<description><![CDATA[<p>New cryptsetup-modified-functions is now in ceres. It&#039;ll migrate down to daedalus next week. I know that it installs correctly, but I can&#039;t test to see if it does what it&#039;s supposed to do. Please test and let me know. Thanks.</p><div class="codebox"><pre><code>$ apt policy cryptsetup-modified-functions
cryptsetup-modified-functions:
  Installed: 2023.02.12
  Candidate: 2023.02.12
  Version table:
 *** 2023.02.12 100
        100 /var/lib/dpkg/status
     23.02.12 10
         10 http://deb.devuan.org/merged ceres/main amd64 Packages</code></pre></div><p>Also, I noticed that this section still has a long timeout loop. In the past, I reduced the timeout to 1, I think. Is it still a problem?</p><div class="codebox"><pre><code>_do_stop_remove() {
    local name=&quot;$1&quot; i rv=0
    for i in 1 2 4 8 16 32; do
        remove_mapping &quot;$name&quot; 3&lt;&amp;- &amp;&amp; break || rv=$?
        if [ $rv -eq 1 ] || [ $rv -eq 2 -a $i -gt 16 ]; then
            log_action_end_msg $rv
            break
        fi
        log_action_cont_msg &quot;$name busy...&quot;
        sleep $i
    done
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Mon, 13 Feb 2023 16:37:59 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41075#p41075</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41064#p41064</link>
			<description><![CDATA[<p>the code is essentially boughtonps line</p><div class="codebox"><pre><code> [ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgchange -a n &gt;/dev/null 2&gt;&amp;1</code></pre></div><p>behind line 188 in /lib/cryptsetup/cryptdisks-functions</p><p>------------------to check -------------------------------------------</p><p># diff -Naur cryptdisks-functions.orig cryptdisks-functions<br />--- cryptdisks-functions.orig&#160; &#160;2023-01-31 21:00:09.967829315 +0100<br />+++ cryptdisks-functions&#160; &#160; &#160; &#160; 2023-02-11 20:17:49.665380782 +0100<br />@@ -186,6 +186,7 @@</p><div class="codebox"><pre><code> do_stop() {
     local devno_rootfs devno_usr
     dmsetup mknodes
+    [ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgchange -a n &gt;/dev/null 2&gt;&amp;1
     log_action_begin_msg &quot;Stopping $INITSTATE crypto disks&quot;
 
     devno_rootfs=&quot;$(get_mnt_devno /)&quot; || devno_rootfs=&quot;&quot; </code></pre></div><p>------------------to check/-------------------------------------------</p><p>I use a byzantine fstab with 13 entries for mounted lvs&#160; - almost all mounted with different - very restrictive mount options ( with very sharp fitted excessive file space). /boot lives on an encrypted &quot;real&quot; gpt 512 MB partition. /home sits on a dm raid1 on a vg in an lv of it&#039;s own. All vgs sit on pvs on LUKS devices.<br />As systemd gets a hiccup on partition systems like this - this might cause side effects - as some programmers might be tempted to falsely rely on big &quot;complete&quot; root partitions...</p>]]></description>
			<author><![CDATA[dummy@example.com (devujan)]]></author>
			<pubDate>Sun, 12 Feb 2023 19:59:08 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41064#p41064</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41054#p41054</link>
			<description><![CDATA[<p>I did two installs today with devuan_daedalus_5.0.preview-20230206_amd64_netinstall.iso.</p><p>One had an encrypted root partition and unencrypted /boot partition.<br />The other had encrypted lvm with unencrypted /boot partition, via Guided Partitioning in the installer.</p><p>I see no delay in shutdown with either system.</p><p>I can still update cryptsetup-modified-functions and build it for ceres/daedalus if there are cases where it&#039;s needed. <br />@devujan: Please put the final version you want me to use in a code box to make it easy for me. (so I don&#039;t screw it up.) Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Sat, 11 Feb 2023 23:01:54 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41054#p41054</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41048#p41048</link>
			<description><![CDATA[<p>Dear boughtonp you are a hero.<br />I tried all versions against each other....<br />(by 100% scientific loud counting :-) )<br />--- cryptdisks-functions.orig&#160; &#160;2023-01-31 21:00:09.967829315 +0100<br />+++ cryptdisks-functions&#160; &#160; &#160; &#160; 2023-02-11 20:17:49.665380782 +0100<br />@@ -186,6 +186,7 @@<br /> do_stop() {<br />&#160; &#160; &#160;local devno_rootfs devno_usr<br />&#160; &#160; &#160;dmsetup mknodes<br />+&#160; &#160; [ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgchange -a n &gt;/dev/null 2&gt;&amp;1<br />&#160; &#160; &#160;log_action_begin_msg &quot;Stopping $INITSTATE crypto disks&quot;</p><p>&#160; &#160; &#160;devno_rootfs=&quot;$(get_mnt_devno /)&quot; || devno_rootfs=&quot;&quot;</p><p>This version took the same ~ 6 seconds to shut down my desktop as the version looping over the vgs.<br />The lvm manual was right. :-)<br />I also counted the time for the original version and that was ~ 40 seconds to shutdown.<br />Thank you!</p>]]></description>
			<author><![CDATA[dummy@example.com (devujan)]]></author>
			<pubDate>Sat, 11 Feb 2023 19:43:14 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41048#p41048</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41035#p41035</link>
			<description><![CDATA[<div class="quotebox"><cite>devujan wrote:</cite><blockquote><div><p>What makes me like (even realy ugly looking) sed code one liners over awk or shell loops is resource considerations. <br />This code is run once at shutdown. To me it is unlikely that parts of the code are somewhere cached in the CPU caches.<br />sed has an extremely small footprint (in memory and CPU usage).</p></div></blockquote></div><p>Have you actually profiled the different versions to compare resource usage?</p><p>Sed itself may have a small footprint, but that means little with a regex pattern which backtracks several times.</p><p>The pattern can be fixed, but given the other overheads involved (subshell, scanning and parsing), is it worth it? I don&#039;t know, but I would suspect <span class="bbc">if list pipe loop</span> to be more efficient than <span class="bbc">if subshell scan pipe parse if loop</span>, and certainly I find it clearer and more readable.</p><p>*shrug* This may all be redundant...</p><p>Looking at <a href="https://manpages.debian.org/bullseye/lvm2/vgchange.8.en.html" rel="nofollow">man vgchange</a> the VG name is an optional filter, so not sure why it is necessary to look them up and run the command once for each, when it can simply be run once without the filter for all:</p><div class="codebox"><pre><code>[ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgchange -a n &gt;/dev/null 2&gt;&amp;1</code></pre></div><p>?</p>]]></description>
			<author><![CDATA[dummy@example.com (boughtonp)]]></author>
			<pubDate>Sat, 11 Feb 2023 16:51:31 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41035#p41035</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41032#p41032</link>
			<description><![CDATA[<div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Well, I have my desktop running with Daedalus, lightdm &amp; Cinnamon, up-to-date, openrc and amd64, traditional unencrypted /boot, a luks-encrypted container holding a LVM for / and /swap. Working fine, just tried it, no shutdown delays.</p><p>Update: also checked my laptop running Daedalus with similar setup: no problems with shutdown delays.</p><p>I looked into my update history. The last update of the cryptsetup-stuff was before Chrismas. Why do we suddenly have a problem?</p></div></blockquote></div><p>I set up a laptop for my smallest daughter in December with Daedalus and had the problem - and I renewed my desktop in January with the next netinstall.iso from Daedalus and had the same issue again. (Both with two VGs - the desktop has additional a raid 1 md device which caused also grub problems (but that is another story). Both FDE with separate /boot partition on LUKS1. Both with xfs (and few ext2) on lvm on LUKS2.)</p>]]></description>
			<author><![CDATA[dummy@example.com (devujan)]]></author>
			<pubDate>Sat, 11 Feb 2023 15:41:13 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41032#p41032</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=41030#p41030</link>
			<description><![CDATA[<div class="quotebox"><cite>boughtonp wrote:</cite><blockquote><div><p>On reflection, no need for Awk either, the whole change can <em>potentially</em> be simplified to:</p><div class="codebox"><pre><code>[ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgscan | while IFS=\&quot; read -r _ vg _
do
   [ -n &quot;$vg&quot; ] &amp;&amp; /sbin/lvm vgchange -a n &quot;$vg&quot; &gt;/dev/null 2&gt;&amp;1
done</code></pre></div><p>Or:</p><div class="codebox"><pre><code>[ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgs --options vg_name --noheadings | while read -r vg
do
   /sbin/lvm vgchange -a n &quot;$vg&quot; &gt;/dev/null 2&gt;&amp;1
done</code></pre></div></div></blockquote></div><p>Dear boughtonp all your code suggestions look cool.<br />What makes me like (even realy ugly looking) sed code one liners over awk or shell loops is resource considerations. <br />This code is run once at shutdown. To me it is unlikely that parts of the code are somewhere cached in the CPU caches.<br />sed has an extremely small footprint (in memory and CPU usage).<br />This patch adds to 99% of all systems an additional slowdown of less than a 1ms during shutdown due to the check for lvm</p><div class="codebox"><pre><code> if [ -x /sbin/lvm ];</code></pre></div><p>which I think is a fair deal, because 100% of all systems running lvm on top of LUKS will benefit from that with additional 120 seconds less waiting for a shutdown.<br />Because cryptsetup does check for open VGs living on LUKS devices and does oppose to a possible premature closing of those devices with the VGs still online.<br />(I like that kind of error caching.)<br />Usually I run my laptops with at least two different VGs each holding different PVs.<br />If you come up with a solution which is small, easy to read and faster than the one I wrote - may rolfie decide ....</p>]]></description>
			<author><![CDATA[dummy@example.com (devujan)]]></author>
			<pubDate>Sat, 11 Feb 2023 15:28:00 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=41030#p41030</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=40994#p40994</link>
			<description><![CDATA[<p>Well, I have my desktop running with Daedalus, lightdm &amp; Cinnamon, up-to-date, openrc and amd64, traditional unencrypted /boot, a luks-encrypted container holding a LVM for / and /swap. Working fine, just tried it, no shutdown delays.</p><p>Update: also checked my laptop running Daedalus with similar setup: no problems with shutdown delays.</p><p>I looked into my update history. The last update of the cryptsetup-stuff was before Chrismas. Why do we suddenly have a problem?</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 10 Feb 2023 15:52:55 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=40994#p40994</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=40993#p40993</link>
			<description><![CDATA[<p>On reflection, no need for Awk either, the whole change can <em>potentially</em> be simplified to:</p><div class="codebox"><pre><code>[ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgscan | while IFS=\&quot; read -r _ vg _
do
   [ -n &quot;$vg&quot; ] &amp;&amp; /sbin/lvm vgchange -a n &quot;$vg&quot; &gt;/dev/null 2&gt;&amp;1
done</code></pre></div><p>Or:</p><div class="codebox"><pre><code>[ -x /sbin/lvm ] &amp;&amp; /sbin/lvm vgs --options vg_name --noheadings | while read -r vg
do
   /sbin/lvm vgchange -a n &quot;$vg&quot; &gt;/dev/null 2&gt;&amp;1
done</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (boughtonp)]]></author>
			<pubDate>Fri, 10 Feb 2023 15:44:24 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=40993#p40993</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=40992#p40992</link>
			<description><![CDATA[<p>I don&#039;t know what this is about, but this line doesn&#039;t seem right...</p><div class="codebox"><pre><code>+        vgs=&quot;$(/sbin/lvm vgscan | sed -n &#039;/&quot;/s/^.*&quot;\([^&#039;\&#039;&#039;]*\)&quot;.*$/\1/p&#039;)&quot;</code></pre></div><p>Is there a reason this isn&#039;t just using <span class="bbc">vgs --options vg_name --noheadings</span> ?</p><p>If so, that sed script is <em>eugh</em>. How about <span class="bbc">awk -F\&quot; &#039;/&quot;/{print $2}&#039;</span> instead?</p>]]></description>
			<author><![CDATA[dummy@example.com (boughtonp)]]></author>
			<pubDate>Fri, 10 Feb 2023 15:17:41 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=40992#p40992</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=40991#p40991</link>
			<description><![CDATA[<p>Thank you!</p><p>I guess I will be reviving the cryptsetup-modified-functions package for daedalus.</p><div class="quotebox"><cite>devujan wrote:</cite><blockquote><div><div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Outlook to Chimaera: there the issue is fixed.</p><p>rolfie</p></div></blockquote></div><p>In Daedalus the problem is back....</p><p>--------------------------patch-----------------------------------------------<br />--- /lib/cryptsetup/cryptdisks-functions.orig&#160; &#160;2023-01-31 21:00:09.967829315 +0100<br />+++ /lib/cryptsetup/cryptdisks-functions&#160; &#160; &#160; &#160; 2023-01-31 21:10:31.023816298 +0100<br />@@ -184,8 +184,16 @@<br /> # Removes all mappings in crypttab, except the ones holding the root<br /> # file system or /usr<br /> do_stop() {<br />-&#160; &#160; local devno_rootfs devno_usr<br />+&#160; &#160; local devno_rootfs devno_usr vgs vg<br />&#160; &#160; &#160;dmsetup mknodes<br />+&#160; &#160; &#160; &#160;if [ -x /sbin/lvm ]; then<br />+&#160; &#160; &#160; &#160; vgs=&quot;$(/sbin/lvm vgscan | sed -n &#039;/&quot;/s/^.*&quot;\([^&#039;\&#039;&#039;]*\)&quot;.*$/\1/p&#039;)&quot;<br />+&#160; &#160; &#160; &#160; &#160;if [ -n &quot;${vgs}&quot; ]; then<br />+&#160; &#160; &#160; &#160; &#160; for vg in ${vgs}; do<br />+&#160; &#160; &#160; &#160; &#160; &#160;/sbin/lvm vgchange -a n ${vg} &gt;/dev/null 2&gt;&amp;1<br />+&#160; &#160; &#160; &#160; &#160; done<br />+&#160; &#160; &#160; &#160; &#160;fi<br />+&#160; &#160; &#160; &#160;fi<br />&#160; &#160; &#160;log_action_begin_msg &quot;Stopping $INITSTATE crypto disks&quot;</p><p>&#160; &#160; &#160;devno_rootfs=&quot;$(get_mnt_devno /)&quot; || devno_rootfs=&quot;&quot;<br />--------------------------patch/----------------------------------------------</p><p>Above patch mitigates the problem for me (Daedalus FDE &amp;&amp; LVM).</p><p>Best wishes</p><p>Jan</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Fri, 10 Feb 2023 13:39:59 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=40991#p40991</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=40990#p40990</link>
			<description><![CDATA[<div class="quotebox"><cite>rolfie wrote:</cite><blockquote><div><p>Outlook to Chimaera: there the issue is fixed.</p><p>rolfie</p></div></blockquote></div><p>In Daedalus the problem is back....</p><p>--------------------------patch-----------------------------------------------<br />--- /lib/cryptsetup/cryptdisks-functions.orig&#160; &#160;2023-01-31 21:00:09.967829315 +0100<br />+++ /lib/cryptsetup/cryptdisks-functions&#160; &#160; &#160; &#160; 2023-01-31 21:10:31.023816298 +0100<br />@@ -184,8 +184,16 @@<br /> # Removes all mappings in crypttab, except the ones holding the root<br /> # file system or /usr<br /> do_stop() {<br />-&#160; &#160; local devno_rootfs devno_usr<br />+&#160; &#160; local devno_rootfs devno_usr vgs vg<br />&#160; &#160; &#160;dmsetup mknodes<br />+&#160; &#160; &#160; &#160;if [ -x /sbin/lvm ]; then<br />+&#160; &#160; &#160; &#160; vgs=&quot;$(/sbin/lvm vgscan | sed -n &#039;/&quot;/s/^.*&quot;\([^&#039;\&#039;&#039;]*\)&quot;.*$/\1/p&#039;)&quot;<br />+&#160; &#160; &#160; &#160; &#160;if [ -n &quot;${vgs}&quot; ]; then<br />+&#160; &#160; &#160; &#160; &#160; for vg in ${vgs}; do<br />+&#160; &#160; &#160; &#160; &#160; &#160;/sbin/lvm vgchange -a n ${vg} &gt;/dev/null 2&gt;&amp;1<br />+&#160; &#160; &#160; &#160; &#160; done<br />+&#160; &#160; &#160; &#160; &#160;fi<br />+&#160; &#160; &#160; &#160;fi<br />&#160; &#160; &#160;log_action_begin_msg &quot;Stopping $INITSTATE crypto disks&quot;</p><p>&#160; &#160; &#160;devno_rootfs=&quot;$(get_mnt_devno /)&quot; || devno_rootfs=&quot;&quot;<br />--------------------------patch/----------------------------------------------</p><p>Above patch mitigates the problem for me (Daedalus FDE &amp;&amp; LVM).</p><p>Best wishes</p><p>Jan</p>]]></description>
			<author><![CDATA[dummy@example.com (devujan)]]></author>
			<pubDate>Fri, 10 Feb 2023 09:50:35 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=40990#p40990</guid>
		</item>
		<item>
			<title><![CDATA[Re: Shutdown encrypted LVM on Beowulf]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=30098#p30098</link>
			<description><![CDATA[<p>I keep a copy of that patch around on my machines in case I do a fresh reinstall. Has worked like a charm for me. Thanks for this!</p>]]></description>
			<author><![CDATA[dummy@example.com (tylerdurden)]]></author>
			<pubDate>Tue, 08 Jun 2021 12:10:29 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=30098#p30098</guid>
		</item>
	</channel>
</rss>
