<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=4097&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / easy script to mount luks encrypted drives, usb etc.]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=4097</link>
		<description><![CDATA[The most recent posts in easy script to mount luks encrypted drives, usb etc..]]></description>
		<lastBuildDate>Tue, 02 Feb 2021 11:09:25 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27164#p27164</link>
			<description><![CDATA[<p>thats excellent fsmithred, even opens spacefm in the required directory. I dont use gvfs or polkits so this is why im doing this. Will stop work on my script now, seems to redundant lol. Thanks again</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Tue, 02 Feb 2021 11:09:25 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27164#p27164</guid>
		</item>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27163#p27163</link>
			<description><![CDATA[<p>Oh yeah, pmount. Try this -<br /><a href="https://sourceforge.net/projects/refracta/files/Extras/usbpmount-1.2.deb" rel="nofollow">https://sourceforge.net/projects/refrac … nt-1.2.deb</a></p><p>It works for removable USB, CD and mmc devices. Add any fixed drives to /etc/pmount.allow.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Tue, 02 Feb 2021 10:56:25 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27163#p27163</guid>
		</item>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27160#p27160</link>
			<description><![CDATA[<p>I just found out that pmount does what i want as far as mounting luks encrypted usb drives.</p><p>edited out script. Im just not getting it !</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Tue, 02 Feb 2021 09:57:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27160#p27160</guid>
		</item>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27152#p27152</link>
			<description><![CDATA[<p>thanks fsmithred i will look into those today. </p><p>head on a stick, yes i forgot to remove those. I copied over that part of the script from anther script which is using them. Thanks for pointing that out and cheers for the whiptail reference.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Mon, 01 Feb 2021 23:05:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27152#p27152</guid>
		</item>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27149#p27149</link>
			<description><![CDATA[<div class="quotebox"><cite>dice wrote:</cite><blockquote><div><div class="codebox"><pre><code>        m ) crypt_mount &quot;$@&quot;
        ;;
        u ) crypt_umount &quot;$@&quot;</code></pre></div></div></blockquote></div><p>Why are you passing the arguments applied to the script to those functions? They don&#039;t appear to do anything with them unless I&#039;m missing something obvious.</p><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><p>From refracta2usb. These list usb devices.</p><div class="codebox"><pre><code>usbdevlist=$(/usr/sbin/hwinfo --usb --short|grep &quot;/dev/sd&quot;|awk &#039;{print $1}&#039;)
usbdevfulllist=$(/usr/sbin/hwinfo --usb --short|grep &quot;/dev/sd&quot;|awk &#039;{print $0}&#039;)</code></pre></div></div></blockquote></div><p>No need for <span class="bbc">grep</span>:</p><div class="codebox"><pre><code>usbdevlist=$(/usr/sbin/hwinfo --usb --short|awk &#039;/\/dev\/sd/{print $1}&#039;)
usbdevfulllist=$(/usr/sbin/hwinfo --usb --short|awk &#039;/\/dev\/sd/{print $0}&#039;)</code></pre></div><p>And here&#039;s a whiptail alternative for the yad dialogue:</p><div class="codebox"><pre><code>usbdevlist() {
   /usr/sbin/hwinfo --usb --short|awk &#039;/\/dev\/sd/{print $1,$1}&#039;
}
device=$(whiptail --notags --menu &quot;Please select the target device to which you want to copy the live image:&quot; 0 0 0 $(usbdevlist) 3&gt;&amp;2 2&gt;&amp;1 1&gt;&amp;3)</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Mon, 01 Feb 2021 20:31:22 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27149#p27149</guid>
		</item>
		<item>
			<title><![CDATA[Re: easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27148#p27148</link>
			<description><![CDATA[<p>Maybe you can do something with these. </p><p>From refractainstaller. This lists partitions. It does not differentiate between encrypted and non-encrypted. Using blkid would be one way to find the encrypted partitions.</p><div class="codebox"><pre><code>find /dev -mindepth 1 -maxdepth 1  | egrep  &quot;*[shv]d[a-z][1-99]|*nvme[0-9]n[0-9]p[1-99]|*mmcblk[0-9]p[1-99]&quot;   | sort | awk &#039;{print &quot;\n&quot; $0 }&#039;</code></pre></div><p>Same thing with a graphical interface (yad)</p><div class="codebox"><pre><code>device=$(find /dev -mindepth 1 -maxdepth 1  | egrep  &quot;*[shv]d[a-z][1-99]|*nvme[0-9]n[0-9]p[1-99]|*mmcblk[0-9]p[1-99]&quot; \
  | sort | awk &#039;{print &quot;\n&quot; $0 }&#039; \
  | yad --list   --title=&quot;Select device&quot; --center --borders=10 --text=&quot;Select a device.&quot; \
  --separator=&quot;&quot; --column &#039; &#039; --column$&#039;Partitions&#039; --height=380 --width=200 --button=&quot;OK&quot;:0)</code></pre></div><p>From refracta2usb. These list usb devices.</p><div class="codebox"><pre><code>usbdevlist=$(/usr/sbin/hwinfo --usb --short|grep &quot;/dev/sd&quot;|awk &#039;{print $1}&#039;)
usbdevfulllist=$(/usr/sbin/hwinfo --usb --short|grep &quot;/dev/sd&quot;|awk &#039;{print $0}&#039;)</code></pre></div><p>And used with yad.</p><div class="codebox"><pre><code>device=$(yad --width=400 --height=200 --center --title=&quot;$TITLE&quot; --list --separator=&quot;&quot; --column=&quot;&quot; --text=$&quot;Detected USB devices:\n\n$usbdevfulllist\n\nSelect the target device you want to copy the live image to.&quot; $usbdevlist \
	--button=&quot;OK&quot;:0 --button=&quot;Exit&quot;:1</code></pre></div><p>I had to alter some of these so they would make sense. I hope I didn&#039;t break anything.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Mon, 01 Feb 2021 19:15:59 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27148#p27148</guid>
		</item>
		<item>
			<title><![CDATA[easy script to mount luks encrypted drives, usb etc.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=27140#p27140</link>
			<description><![CDATA[<p>This something to make my life easier, it just basically opens and mounts/unmounts a luke encrypted usb drive, could be any sort of pluggable drive i suppose. Thinking of adding some options to easily create full disk encryption to go along with these options as well.</p><p>Just thought i would share.</p><p>all that needs to be done is to have a usb or disk with a partuuid and a label and those are the parameters it opens and mounts by. But these parameters need to be added to the script manually.</p><p>so usage is as root <span class="bbc">cryptmount -m</span> to open and mount</p><p>and <span class="bbc">cryptmount -u</span> to unmount and close</p><div class="codebox"><pre><code>#!/bin/sh

u=$(logname)

crypt_mount () {
        cryptsetup luksOpen &quot;/dev/disk/by-partuuid/00000-1&quot; usb;
        mount -L &quot;BACKUPS&quot; /media/&quot;${u}&quot;
}

crypt_umount () {
        umount -R /media/&quot;${u}&quot;;
        cryptsetup close usb
}

while getopts &quot;:mu&quot; opt; do
  case &quot;${opt}&quot; in
        m ) crypt_mount
        ;;
        u ) crypt_umount
        ;;
        *)
        ;;
  esac
done</code></pre></div><p>I would like to explore how to make this a kind of menu where you could pick available devices to encrypt and mount</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Mon, 01 Feb 2021 13:07:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=27140#p27140</guid>
		</item>
	</channel>
</rss>
