<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[One method to encrypt &#x2F;home&#x2F;phablet]]></title><description><![CDATA[<p dir="auto">Hi, I'm posting this here in case anyone else wants to encrypt their <code>/home/phablet</code> directory, I'd strongly suggest that only people who know their way around Linux via the command line do this…</p>
<p dir="auto">This is easier to do if you have <code>ssh</code> access to the phone, to enable that use the UT Tweak Tool or do it using the command line, in this example <code>$GITHUBUSERNAME</code> is your GitHub username and it assumes your public SSH keys are available at this URL, you could also use <code>adb</code> to push your public keys to the phone:</p>
<pre><code class="language-bash">android-gadget-service enable ssh
cd
mkdir .ssh
chmod 700 .ssh
cd .ssh
wget https://github.com/$GITHUBUSERNAME.keys -O authorized_keys
chmod 600 authorized_keys
</code></pre>
<p dir="auto">You can then <code>ssh</code> to the phone as the <code>phablet</code> user.</p>
<p dir="auto">Install <code>cryptsetup</code>, by remounting root read write (do <em>not</em> run <code>apt-get upgrade</code> — only install packages that are essential to you like this):</p>
<pre><code class="language-bash">mount -o rw,remount /
apt-get update
apt-get install cryptsetup
mount -o ro,remount /
</code></pre>
<p dir="auto">Create a 2G disk, encrypt it, format it, mount it, rsync data to it, unmount and remount it and restart the display manager:</p>
<pre><code class="language-bash">sudo -i
cd /home
fallocate -l 2G phablet.img
cryptsetup luksFormat phablet.img
cryptsetup luksOpen phablet.img phablet
mkfs.ext4 /dev/mapper/phablet
mkdir /media/phablet
mount /dev/mapper/phablet /media/phablet
rsync -av /home/phablet/ /media/phablet/
umount /media/phablet/
mount /dev/mapper/phablet /home/phablet
cd /tmp
nohup /etc/init.d/lightdm force-reload
</code></pre>
<p dir="auto">If everything is OK you might then want to delete the extra copy of the data at <code>/home/phablet</code>, or if you have done this on an initial install install of the phone you might want to leave that where it is since the phone will then appear to have no data on it when booted and your data will only appear after you have decrypted and mounted the disk:</p>
<pre><code class="language-bash">sudo -i
cryptsetup luksOpen phablet.img phablet
e2fsck /dev/mapper/phablet 
mount /dev/mapper/phablet /home/phablet
cd /tmp
nohup /etc/init.d/lightdm force-reload
</code></pre>
]]></description><link>https://forums.ubports.com/topic/1012/one-method-to-encrypt-home-phablet</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 10:42:25 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/1012.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Mar 2018 14:01:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 19 Dec 2025 19:05:11 GMT]]></title><description><![CDATA[<p dir="auto">BTW it appears that the latest UBports 24.04 version does now natively support encryption using ext4 (?) fscrypt, using the lock-screen passphrase:</p>
<p dir="auto"><a href="https://gitlab.com/ubports/development/core/ubuntu-touch-session/-/issues/22#note_2475632676" target="_blank" rel="noopener noreferrer nofollow ugc">https://gitlab.com/ubports/development/core/ubuntu-touch-session/-/issues/22#note_2475632676</a></p>
<p dir="auto">I haven't tried this out yet, but I'm looking forward to.</p>
]]></description><link>https://forums.ubports.com/post/91607</link><guid isPermaLink="true">https://forums.ubports.com/post/91607</guid><dc:creator><![CDATA[Dave]]></dc:creator><pubDate>Fri, 19 Dec 2025 19:05:11 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 10 Sep 2024 08:23:44 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Also note that nowadays ext4 filesystem natively supports per-directory encryption which may allow a more efficient and better integrated way to encrypt /home.</p>
</blockquote>
<p dir="auto">replying to myself:  this is called filesystem-based encryption.  <a href="https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html" target="_blank" rel="noopener noreferrer nofollow ugc">Here is the relevant documentation for the part living inside the Linux kernel</a>.</p>
<p dir="auto">Appears that Android nowadays <a href="https://source.android.com/docs/security/features/encryption/file-based" target="_blank" rel="noopener noreferrer nofollow ugc">also uses this</a> for providing user-data encryption (albeit with a different user-space tooling).</p>
<p dir="auto">As this allows very fine-grained encryption of specific directories only, it may be easier to integrate with LightDM, i.e. maybe not requiring a full restart of LightDM after unlocking just some of the more privacy-relevant directories.</p>
<p dir="auto">Both recent LUKS versions and fscrypt userspace can process the disk encryption password via <a href="https://en.wikipedia.org/wiki/Argon2" target="_blank" rel="noopener noreferrer nofollow ugc">Argon 2</a>.  If you choose sufficiently CPU-intensive parameters for Argon 2 (e.g. multi-second execution time, 4 CPU threads, 512 MB of RAM), then even a password with 40 bits of entropy will be very costly to break using a GPU based brute-force atttack.</p>
<p dir="auto">If one believes the (pretty outdated) claims on the argon2-gpu gitlab page, then the Argon2 settings that I use with LUKS on my Volla22:</p>
<pre><code>	PBKDF:      argon2id
	Time cost:  12
	Memory:     500000
	Threads:    4
</code></pre>
<p dir="auto">only allow for roughly 8 password attempts per seconds when brute-forcing on a NVIDIA Tesla K20X.  That's only 2^28 password attempts per year and GPU!?</p>
<p dir="auto">Note that Argon2 support in LUKS is not available on the older 16.04 version of UBports, you need 20.04 (focal).</p>
]]></description><link>https://forums.ubports.com/post/81938</link><guid isPermaLink="true">https://forums.ubports.com/post/81938</guid><dc:creator><![CDATA[Dave]]></dc:creator><pubDate>Tue, 10 Sep 2024 08:23:44 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 17 Sep 2024 07:20:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chris_bavaria" aria-label="Profile: chris_bavaria">@<bdi>chris_bavaria</bdi></a> said in <a href="/post/81818">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">Has anyone experienced similar issues with OT-5 or knows of a more reliable way to restart LightDM without the screen staying black? Any help or tips would be greatly appreciated!</p>
<p dir="auto">Thanks in advance!</p>
</blockquote>
<p dir="auto">I've always been using an encrypted home setup similar to what you are trying with my Volla 22 on OTA-4.  I'm using the below restart sequence after remounting /home.</p>
<p dir="auto">RUN THE BELOW CODE AT YOUR OWN RISK, AND ONLY IF YOU FULLY UNDERSTAND IT AND KNOW WHAT YOU ARE DOING.  YOU MAY e.g. BRICK YOUR PHONE OR LOOSE DATA.  ABSOLUTELY NO WARRANTY.</p>
<pre><code class="language-sh">for i in \
    dconf-service \
    media-hub-server \
    history-daemon \
    address-book-service \
    evolution-addressbook-factory \
    evolution-calendar-factory \
    evolution-source-registry \
    gnome-keyring-daemon \
    mpris-proxy \
    mission-control ; do
    su phablet -c "killall $i" || true
done

pid="$(cat /var/run/lightdm.pid)"
sudo kill $pid
</code></pre>
<p dir="auto">edit sept. 17: I think the above script snippet needs to be modified to include <code>media-hub-server</code> in the list of services to restart.  Otherwise passing data between applications fails after remounting /home/phablet (and restart of lightdm).  E.g. configuring a background image by selecting a photo in the gallery.</p>
<p dir="auto">It used to be much simpler on 16.04.</p>
<p dir="auto">That said, I'd really like for ubports to have a better integrated support for encryption.</p>
<p dir="auto">Also note that nowadays ext4 filesystem natively supports per-directory encryption which may allow a more efficient and better integrated way to encrypt /home. This <a href="https://github.com/google/fscrypt" target="_blank" rel="noopener noreferrer nofollow ugc">github project</a> has more details.  I'm using Ubuntu's fscrypt package on a Ubuntu laptop to add another layer of encryption between different users.</p>
]]></description><link>https://forums.ubports.com/post/81866</link><guid isPermaLink="true">https://forums.ubports.com/post/81866</guid><dc:creator><![CDATA[Dave]]></dc:creator><pubDate>Tue, 17 Sep 2024 07:20:52 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 03 Sep 2024 20:00:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bodow" aria-label="Profile: BodoW">@<bdi>BodoW</bdi></a></p>
<p dir="auto">Hello everyone,</p>
<p dir="auto">I'm encountering a similar issue as <a class="plugin-mentions-user plugin-mentions-a" href="/user/ernest" aria-label="Profile: ernest">@<bdi>ernest</bdi></a>. After successfully encrypting /home/phablet with LUKS, my screen remains black after restarting LightDM, although SSH access continues to work fine. This happens on my Redmi Note 9S Pro running Ubuntu Touch 20.04 OT-5.</p>
<p dir="auto">The workaround of locking the screen (using the power button) before initiating the force-reload of LightDM doesn't seem to work reliably anymore. I suspect that something has changed in OT-5, causing LightDM not to come back correctly when it's restarted while the display is on.</p>
<p dir="auto">Has anyone experienced similar issues with OT-5 or knows of a more reliable way to restart LightDM without the screen staying black? Any help or tips would be greatly appreciated!</p>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://forums.ubports.com/post/81818</link><guid isPermaLink="true">https://forums.ubports.com/post/81818</guid><dc:creator><![CDATA[chris_bavaria]]></dc:creator><pubDate>Tue, 03 Sep 2024 20:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Sat, 04 Sep 2021 10:35:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ernest" aria-label="Profile: ernest">@<bdi>ernest</bdi></a> said in <a href="/post/42810">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a><br />
Lomiri cannot restart thus the screen remains black, while ssh access works fine.</p>
</blockquote>
<p dir="auto">I ran into the same problem on my Nexus 5.<br />
The solution is to lock the screen (Power Button) before initiating the force-reload.<br />
For some reason lightdm does not come back when it was shut down while the display was lit. (It took me quite a while and several WTFs to stumble over this. :grinning_squinting_face: )<br />
Thus my script is as follows:</p>
<pre><code>#!/bin/bash

cryptsetup luksOpen /home/phablet.img phablet
e2fsck /dev/mapper/phablet
mount /dev/mapper/phablet /home/phablet &amp;&amp; \

echo "Lock the screen now!"
echo "Restart in"
for ((t=5;t&gt;0;t--))
do
	echo "$t s"
	sleep 1
done

cd /tmp
nohup /etc/init.d/lightdm force-reload &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;
</code></pre>
]]></description><link>https://forums.ubports.com/post/54871</link><guid isPermaLink="true">https://forums.ubports.com/post/54871</guid><dc:creator><![CDATA[BodoW]]></dc:creator><pubDate>Sat, 04 Sep 2021 10:35:29 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Wed, 24 Feb 2021 10:45:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/c4pp4" aria-label="Profile: c4pp4">@<bdi>c4pp4</bdi></a> x1000 thanks!!!</p>
]]></description><link>https://forums.ubports.com/post/47073</link><guid isPermaLink="true">https://forums.ubports.com/post/47073</guid><dc:creator><![CDATA[llzzrrdd]]></dc:creator><pubDate>Wed, 24 Feb 2021 10:45:56 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Wed, 10 Feb 2021 00:16:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ernest" aria-label="Profile: ernest">@<bdi>ernest</bdi></a> said in <a href="/post/42555">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">Seems that lightdm doesn't restart with the latest OTA. Any tips ?</p>
</blockquote>
<p dir="auto">Hi, I'm using the following script (tested on OTA-15 and OTA-16 devel):</p>
<pre><code>#!/bin/bash
if ! dpkg-query -l cryptsetup | grep ^ii 1&gt;/dev/null; then
	mount -o remount,rw /
	apt-get update &amp;&amp; \
	apt-get -y install cryptsetup
	sync
	mount -o remount,ro /
fi

cryptsetup luksOpen /home/phablet.img phablet
e2fsck /dev/mapper/phablet
mount /dev/mapper/phablet /home/phablet &amp;&amp; \
nohup /etc/init.d/lightdm force-reload &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;
</code></pre>
<p dir="auto">run as root: sudo bash &lt;nameofscript&gt;</p>
]]></description><link>https://forums.ubports.com/post/46341</link><guid isPermaLink="true">https://forums.ubports.com/post/46341</guid><dc:creator><![CDATA[c4pp4]]></dc:creator><pubDate>Wed, 10 Feb 2021 00:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 17 Nov 2020 16:44:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a><br />
Lomiri cannot restart thus the screen remains black, while ssh access works fine.</p>
]]></description><link>https://forums.ubports.com/post/42810</link><guid isPermaLink="true">https://forums.ubports.com/post/42810</guid><dc:creator><![CDATA[ernest]]></dc:creator><pubDate>Tue, 17 Nov 2020 16:44:29 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 17 Nov 2020 03:16:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ernest" aria-label="Profile: ernest">@<bdi>ernest</bdi></a> said in <a href="/post/42555">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">Seems that lightdm doesn't restart with the latest OTA. Any tips ?</p>
</blockquote>
<p dir="auto">Hmm.  I've not been testing lately so hadn't noticed.  Will see what I can figure out when I next have some time, but that may be a while.  What errors or symptoms occur?</p>
]]></description><link>https://forums.ubports.com/post/42772</link><guid isPermaLink="true">https://forums.ubports.com/post/42772</guid><dc:creator><![CDATA[trainailleur]]></dc:creator><pubDate>Tue, 17 Nov 2020 03:16:52 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Tue, 10 Nov 2020 22:06:16 GMT]]></title><description><![CDATA[<p dir="auto">Seems that lightdm doesn't restart with the latest OTA. Any tips ?</p>
]]></description><link>https://forums.ubports.com/post/42555</link><guid isPermaLink="true">https://forums.ubports.com/post/42555</guid><dc:creator><![CDATA[ernest]]></dc:creator><pubDate>Tue, 10 Nov 2020 22:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Sat, 11 Jul 2020 15:58:51 GMT]]></title><description><![CDATA[<p dir="auto">Have gone further on the PinePhone and copied all of the writable data into a new luks-encrypted partition.</p>
<p dir="auto">I now have a shell script in my home directory as initially booted that will:</p>
<ol>
<li>check to see if cryptsetup is installed and if not kick off an install script</li>
<li>turn off swap so we don't end up with encryption keys in swap</li>
<li>unlock the encrypted partition</li>
<li>cd to /tmp (because not doing so was tripping me up in the next step)</li>
<li>force umount /userdata using "umount -l"</li>
<li>remount the encrypted partition on it</li>
<li>in sequence force umount each userdata-mounted writeable part of the filesystem using "umount -l" then bind mount it back on the new, encrypted userdata (the bind mounts for your system can be found with findmnt)</li>
<li>turn swap back on using a new swap file in the encrypted partition with the same -1 setting that the original swap had (a larger swap file, in my case)</li>
<li>force-reload lightdm</li>
</ol>
<p dir="auto">Is anything aside from updates writen to permanent storage other than to bind mounts on /userdata?  I didn't find anything, but there's always the possibility that I missed something.</p>
<p dir="auto">All of this adds a couple of minutes to getting the phone ready for use, of course, and there may be things I've not yet discovered which will turn out to be broken.</p>
<p dir="auto">Given how much is not yet working in the PinePhone, I should probably replicate this on an Android-based UBPorts device like the OnePlus One or the Nexus 5 for further testing.  I'm thinking it should probably work with a large container in /userdata, skipping the umount of /userdata and mounting the decrypted block file (and the consequent bind mounts) on a file within /userdata, but this isn't testing I plan to pursue for now, as other tests take priority.</p>
<p dir="auto">I am not posting my script here because it only applies to how I have set up my PinePhone.  There are a few choices I made which would break completely for someone who made different setup choices.  Anyone capable of getting this working on their device will need to understand what is meant by each step above so should be able to develop a process that works for them.  If anyone who does want to try this and does know what they're doing hits a snag and has a question, I'll try to answer it.</p>
<p dir="auto">Standard caveat applies: this could break everything on your phone, and UBPorts developers will not support this or help you fix it.  Proceed at your own risk.</p>
]]></description><link>https://forums.ubports.com/post/36545</link><guid isPermaLink="true">https://forums.ubports.com/post/36545</guid><dc:creator><![CDATA[trainailleur]]></dc:creator><pubDate>Sat, 11 Jul 2020 15:58:51 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Wed, 08 Jul 2020 10:19:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a> said in <a href="/post/33319">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">Will test on PinePhone when I get the chance, but unfortunately my BraveHeart device has been gathering dust for a few months.  (Too many projects, too little time, even with all this extra quarantine time in my life.  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> )</p>
</blockquote>
<p dir="auto">I finally tested this on the PinePhone (dev channel).  It works fine, as expected, though instead of using a file as the encrypted block device, I created a new partition on the sdcard I'm using for testing.</p>
]]></description><link>https://forums.ubports.com/post/36414</link><guid isPermaLink="true">https://forums.ubports.com/post/36414</guid><dc:creator><![CDATA[trainailleur]]></dc:creator><pubDate>Wed, 08 Jul 2020 10:19:12 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Thu, 21 May 2020 16:42:52 GMT]]></title><description><![CDATA[<p dir="auto">Revisiting this a year later, following a fresh install of OTA-12 on a OnePlus One.  It still works.</p>
<p dir="auto">I did have to bind mount /var/cache/apt as per <a class="plugin-mentions-user plugin-mentions-a" href="/user/jezek" aria-label="Profile: jezek">@<bdi>jezek</bdi></a> 's tip here: <a href="https://forums.ubports.com/post/20297">https://forums.ubports.com/post/20297</a></p>
<p dir="auto">I also dispensed with the cd to /tmp when I remembered that nohup is just writing standard output to a file anyway, so there was no reason not to write to /dev/null, obviating the need to write to a filesystem that will survive the lightdm reload:</p>
<pre><code>nohup /etc/init.d/lightdm force-reload &gt; /dev/null
</code></pre>
<p dir="auto">Will test on PinePhone when I get the chance, but unfortunately my BraveHeart device has been gathering dust for a few months.  (Too many projects, too little time, even with all this extra quarantine time in my life.  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> )</p>
<p dir="auto">As always, <strong>DON'T</strong> do this unless you know what you're doing* and are prepared to accept the risk of a broken system, either now or at the next OTA.</p>
<p dir="auto">*A good litmus test might be: you understand what all of the commands in this thread are doing and why they were chosen, as that comprehension implies understanding of the potential consequences as well as the limitations.</p>
]]></description><link>https://forums.ubports.com/post/33319</link><guid isPermaLink="true">https://forums.ubports.com/post/33319</guid><dc:creator><![CDATA[trainailleur]]></dc:creator><pubDate>Thu, 21 May 2020 16:42:52 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Sat, 09 Feb 2019 14:08:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a> Hey guys, thanks for your help!</p>
<p dir="auto">Ok so everything is working fine with ssh after each restart etc. I was also experimenting doing it by the phone terminal but when I go that route I only get half of my config working. For example, the contacts are not visible, the changes made with UTweaktool are not present, the keyboard theme etc. Sadly for some reason doing it by the terminal only decrypt half of my config or something like that. I don't know why.<br />
Also I noticed a worse battery perfomance in my Nexus 5. It was 65% 8 hours ago before going to sleep and today in the morning the phone was dead. Other than that. I will try to figure out why decrypting the phone via the terminal is not working for me, if I manage to get that working or by a script/bash alias I will keep with the encryption long term. Let's see.. Thank you again.</p>
<p dir="auto">One more thing, I am also experiencing the wifi dissapearing sometimes, usually I fix that by restarting once the phone.</p>
<p dir="auto">edit2: after trying to decrypt with the new commands, it worked well doing it from the phone terminal <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forums.ubports.com/post/17301</link><guid isPermaLink="true">https://forums.ubports.com/post/17301</guid><dc:creator><![CDATA[malditobastardo]]></dc:creator><pubDate>Sat, 09 Feb 2019 14:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Sat, 09 Feb 2019 11:26:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a> thanks for you help with this and I'm glad it has been of use, I have updated the top post with your method to restart the display manager.</p>
<p dir="auto">As I said in the top post, <em>"I'd strongly suggest that only people who know their way around Linux via the command line do this…"</em></p>
<p dir="auto">I have also added a <code>e2fsck /dev/mapper/phablet</code> line — if your phone goes flat or has to be forcibly power cycled it can result in some disk inconsistency so best check before mounting.</p>
<p dir="auto">I don't have a SIM card in my Ubuntu Touch OnePlus One (in fact I have the mobile phone network modem switched off via <code>/usr/share/ofono/scripts/disable-modem /ril_0</code>), I only use WiFi and also have an encrypted Debian Stretch chroot on the phone (which also runs a SSH server) that I use for most things and I run all my terminal sessions in <code>screen</code> so that when there is the occasional display manager crash I don't lose them. I also make a lot of use of <code>git</code> and <code>mosh</code> and <code>ansible</code> (via Debian backports) — I don't like carrying a laptop around all the time but I like to be able to do emergency sysadmin work from anywhere and the Ubuntu Touch phone enables this.</p>
<p dir="auto">I have terrible battery life when WiFi is on, I generally only have it on when it is plugged in or when doing something in an emergency, I use my LineageOS OnePlus 3 (without Gapps) as a hotspot and connect via that. When the WiFi is off I have <em>excellent</em> battery life, the phone might only drop 1% overnight even with multiple <code>mosh</code> sessions running in <code>screen</code> in the Debian chroot with <em>Prevent app suspension</em> enabled for the Terminal app via the UT Tweak Tool.</p>
<p dir="auto">I have some <a href="https://ubuntu.webarch.uk/wiki/Main_Page" target="_blank" rel="noopener noreferrer nofollow ugc">old notes on some other tricks on a wiki</a>, but I haven't updated that for a couple of years so much of it might be outdated.</p>
]]></description><link>https://forums.ubports.com/post/17298</link><guid isPermaLink="true">https://forums.ubports.com/post/17298</guid><dc:creator><![CDATA[chrisc]]></dc:creator><pubDate>Sat, 09 Feb 2019 11:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Sat, 09 Feb 2019 01:43:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> said in <a href="/post/17251">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a> I only have a OnePlus One at the moment and sometimes it takes a while for the display to come back up after a <code>/etc/init.d/lightdm restart</code> and yes it is easier doing it via SSH.</p>
</blockquote>
<p dir="auto">I had inconsistent results with restart (sometimes display would never return, and other times it would return but with wifi broken, though I admit I have no idea what would cause that to happen.  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/263a.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--relaxed" style="height:23px;width:auto;vertical-align:middle" title=":relaxed:" alt="☺" /> ), but force-reload has worked every time so far.</p>
<p dir="auto">Thank you again for your help with this!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/malditobastardo" aria-label="Profile: malditobastardo">@<bdi>malditobastardo</bdi></a> said in <a href="/post/17254">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">edit: is this step needed? (I did this in a fresh install). Should I just leave the "phablet.img" sitting there (2GB) in /home/phablet?</p>
</blockquote>
<p dir="auto">Sorry I was offline when all of your questions came up.  Glad <a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a>  was here to help!</p>
<p dir="auto">You could put it anywhere, so long as it's on a writable filesystem.  Since much of the UBPorts filesystem is not writable by default, /home seems a good place to me.</p>
<blockquote>
<p dir="auto">edit2: ok I am starting to understand how this works.. I think. So after a restart of the phone I can't see any of my files, config, photos, etc. so it looks like every time I restart or shutdown my phone I need to "decrypt" the disk manually. The issue is that I am trying to follow the steps mentioned in the guide but I am getting access denied? Is this correct? Its normal that I have to decrypt everytime i restart the phone?</p>
</blockquote>
<p dir="auto">Yes, normal.  You could write a script or create a bash alias to make it simpler.  Since I'm still tinkering, I've not yet done this but plan to.</p>
<blockquote>
<p dir="auto">Edit3: Ok so I managed to "decrypt" and I have all of my files back again. I had to run the commands in /home to make it work (mybad).<br />
Anyway, whats the best way to decrypt the phone? Because most of the times in don't have the chance to ssh into my phone and I usually restart the device 2-3 times per day, so doing this everytime is kind of PIA <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> .  There is no easy way to deal with this? Otherwise I may just reset the phone  and wait for a proper way to Encrypt the phone in the future <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> .</p>
</blockquote>
<p dir="auto">Use the built in terminal application, and you won't have to ssh.  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/263a.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--relaxed" style="height:23px;width:auto;vertical-align:middle" title=":relaxed:" alt="☺" />   ssh is useful for doing a lot of setup, but just to unlock and mount the crypt is only a few commands and easy enough to type in the terminal.  Just note what my earlier posts said about the steps I had to take to get lightdm to restart when run from the local terminal on the phone as opposed to ssh.  I agree that ssh isn't a good solution to unlocking the phone, which is why I kept chipping away at it until I found steps which would work in the on-board terminal.</p>
<p dir="auto">I may have a bit of an advantage in that from other work I'm extremely used to typing cryptsetup commands by hand and could type them in my sleep (I have in fact dreamt them before  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f628.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--fearful" style="height:23px;width:auto;vertical-align:middle" title=":fearful:" alt="😨" /> ), but it's pretty easy to set up bash aliases or write a simple bash script if you have trouble remembering the steps or syntax or simply want to save the hassle of typing on a software keyboard.</p>
<blockquote>
<p dir="auto">Thanks everyone for everything specially <a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> !!!</p>
</blockquote>
<p dir="auto">I'm delighted to know there are now at least three of us doing this.  <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/263a.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--relaxed" style="height:23px;width:auto;vertical-align:middle" title=":relaxed:" alt="☺" /></p>
]]></description><link>https://forums.ubports.com/post/17292</link><guid isPermaLink="true">https://forums.ubports.com/post/17292</guid><dc:creator><![CDATA[trainailleur]]></dc:creator><pubDate>Sat, 09 Feb 2019 01:43:49 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 15:17:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/malditobastardo" aria-label="Profile: malditobastardo">@<bdi>malditobastardo</bdi></a> said in <a href="/post/17248">One method to encrypt /home/phablet</a>:</p>
<blockquote>
<p dir="auto">...<br />
phablet@ubuntu-phablet:~$ apt-get update<br />
...<br />
<strong>Ok I needed "sudo", is that normal???</strong> (installing cryptsetup)</p>
</blockquote>
<p dir="auto">As far I know, you <strong>always</strong> need <code>sudo</code> when doing <code>apt-get install</code>, or <code>apt-get update</code>. For me this works:</p>
<pre><code class="language-bash">phablet@ubuntu-phablet:~$ sudo apt-get update
</code></pre>
]]></description><link>https://forums.ubports.com/post/17255</link><guid isPermaLink="true">https://forums.ubports.com/post/17255</guid><dc:creator><![CDATA[jezek]]></dc:creator><pubDate>Fri, 08 Feb 2019 15:17:18 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 17:18:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> First step done! I am getting this in the second part:</p>
<p dir="auto">sent 40,788,174 bytes  received 21,557 bytes  16,323,892.40 bytes/sec<br />
total size is 40,668,865  speedup is 1.00<br />
root@ubuntu-phablet:/home# umount /media/phablet/<br />
root@ubuntu-phablet:/home# mount /dev/mapper/phablet /home/phablet<br />
root@ubuntu-phablet:/home# cd /tmp<br />
root@ubuntu-phablet:/tmp# nohup /etc/init.d/lightdm force-reload<br />
nohup: ignoring input and appending output to 'nohup.out'<br />
root@ubuntu-phablet:/tmp# cd<br />
root@ubuntu-phablet:~# cryptsetup luksOpen phablet.img phablet<br />
Device phablet.img doesn't exist or access denied.</p>
<p dir="auto">edit: is this step needed? (I did this in a fresh install). Should I just leave the "phablet.img" sitting there (2GB) in /home/phablet?</p>
<p dir="auto">edit2: ok I am starting to understand how this works.. I think. So after a restart of the phone I can't see any of my files, config, photos, etc. so it looks like every time I restart or shutdown my phone I need to "decrypt" the disk manually. The issue is that I am trying to follow the steps mentioned in the guide but I am getting access denied? Is this correct? Its normal that I have to decrypt everytime i restart the phone?</p>
<p dir="auto">Edit3: Ok so I managed to "decrypt" and I have all of my files back again. I had to run the commands in /home to make it work (mybad).<br />
Anyway, whats the best way to decrypt the phone? Because most of the times in don't have the chance to ssh into my phone and I usually restart the device 2-3 times per day, so doing this everytime is kind of PIA <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> .  There is no easy way to deal with this? Otherwise I may just reset the phone  and wait for a proper way to Encrypt the phone in the future <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=56a73af4c47" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> .<br />
Thanks everyone for everything specially <a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> !!!</p>
]]></description><link>https://forums.ubports.com/post/17254</link><guid isPermaLink="true">https://forums.ubports.com/post/17254</guid><dc:creator><![CDATA[malditobastardo]]></dc:creator><pubDate>Fri, 08 Feb 2019 17:18:56 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 14:05:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/trainailleur" aria-label="Profile: trainailleur">@<bdi>trainailleur</bdi></a> I only have a OnePlus One at the moment and sometimes it takes a while for the display to come back up after a <code>/etc/init.d/lightdm restart</code> and yes it is easier doing it via SSH.</p>
]]></description><link>https://forums.ubports.com/post/17251</link><guid isPermaLink="true">https://forums.ubports.com/post/17251</guid><dc:creator><![CDATA[chrisc]]></dc:creator><pubDate>Fri, 08 Feb 2019 14:05:47 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 14:01:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/malditobastardo" aria-label="Profile: malditobastardo">@<bdi>malditobastardo</bdi></a> run <code>sudo -i</code> to become root.</p>
]]></description><link>https://forums.ubports.com/post/17250</link><guid isPermaLink="true">https://forums.ubports.com/post/17250</guid><dc:creator><![CDATA[chrisc]]></dc:creator><pubDate>Fri, 08 Feb 2019 14:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 13:37:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisc" aria-label="Profile: chrisc">@<bdi>chrisc</bdi></a> Hello Sir, thank you for your answer.</p>
<p dir="auto">I just realized that I am getting tons of errors when trying to do apt-get update</p>
<p dir="auto">(  Could not open file /var/lib/apt/lists/partial/ports.ubuntu.com_ubuntu-ports_dists_xenial-updates_main_source_Sources.xz - open (13: Permission denied) [IP: 91.189.88.150 80])<br />
Similar lo this.</p>
<p dir="auto">Maybe is a ubports server issue?<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/advocatux" aria-label="Profile: advocatux">@<bdi>advocatux</bdi></a></p>
<p dir="auto">and this:</p>
<p dir="auto">"phablet@ubuntu-phablet:~$ sudo mount -o rw,remount /<br />
[sudo] password for phablet:<br />
phablet@ubuntu-phablet:~$ apt-get update<br />
Reading package lists... Done<br />
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)<br />
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)<br />
E: Unable to lock directory /var/lib/apt/lists/<br />
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)<br />
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)"</p>
<p dir="auto"><strong>Ok I needed "sudo", is that normal???</strong> (installing cryptsetup)</p>
]]></description><link>https://forums.ubports.com/post/17248</link><guid isPermaLink="true">https://forums.ubports.com/post/17248</guid><dc:creator><![CDATA[malditobastardo]]></dc:creator><pubDate>Fri, 08 Feb 2019 13:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 13:04:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/malditobastardo" aria-label="Profile: malditobastardo">@<bdi>malditobastardo</bdi></a> run <code>apt-get update</code> first, <a href="https://packages.ubuntu.com/xenial/cryptsetup" target="_blank" rel="noopener noreferrer nofollow ugc">it is in Xenial</a>.</p>
]]></description><link>https://forums.ubports.com/post/17247</link><guid isPermaLink="true">https://forums.ubports.com/post/17247</guid><dc:creator><![CDATA[chrisc]]></dc:creator><pubDate>Fri, 08 Feb 2019 13:04:36 GMT</pubDate></item><item><title><![CDATA[Reply to One method to encrypt &#x2F;home&#x2F;phablet on Fri, 08 Feb 2019 13:03:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/malditobastardo" aria-label="Profile: malditobastardo">@<bdi>malditobastardo</bdi></a> check that you have the correct entries in your <code>sources.list</code> and do an <code>apt update</code> before trying to install that package</p>
]]></description><link>https://forums.ubports.com/post/17246</link><guid isPermaLink="true">https://forums.ubports.com/post/17246</guid><dc:creator><![CDATA[advocatux]]></dc:creator><pubDate>Fri, 08 Feb 2019 13:03:38 GMT</pubDate></item></channel></rss>