<?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=559&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=559</link>
		<description><![CDATA[The most recent posts in Installing to existing partitions/mount? Full disk encrypt? Feedback..]]></description>
		<lastBuildDate>Sat, 15 Jul 2017 22:56:45 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=3356#p3356</link>
			<description><![CDATA[<p>One minor glitch consisted in /boot not being mounted after kernel took over completely from initramfs, with /usr completely available and all.</p><p>Grub unlocks it, that was fine. I think I needed to give the password twice. And it took time, maybe because the system is old, but it was much slower than normal; this system does not boot so slow normally.</p><p>But when other partitions were mounted, and from the settings in my <strong>/etec/crypttab</strong>, which holds /, swap and another partition, the system couldn&#039;t mount the /boot!</p><p>Grub unlocked it and ran the kernel and the initramfs, but then all of a sudden, it couldn&#039;t anymore mount what it unlocked!</p><p>But all that was needed was to put also the settings for /dev/sda1 luks partition in <strong>/etec/crypttab</strong> and now my system boots, completely encrypted.</p><p>I mean, it was a little cryptic (sic!)... Because it said nothing about the luksUUID, no! It complained it couldn&#039;t find the ext2 partition&#039;s UUID! But it couldn&#039;t find it because it does need to be unlocked for a third time (see above for the first two times, IIUC) to become visible! See?</p><p>Regards!</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Sat, 15 Jul 2017 22:56:45 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=3356#p3356</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=3354#p3354</link>
			<description><![CDATA[<p>True! <span style="color: purple">Simplicio</span>, be happy, you&#039;ve been proven wrong. <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>I just booted into full-encrypted /boot, / and all (all the rest of the) HDD. And my /boot and entire HDD are on an only MBR-BIOS (some 15yrs old Award6.0 BIO, IIRC, Abit AT832 is the MBO), so HDD (which is just some Seagate 250GB, is MBR-formatted.</p><p>It&#039;s just the MBR that is but a little exposed to maids (the maids from the attack), and the base Grub in it. And of course the firmware, anywhere in this system, MBO, HDD, is not-completely protectable, because it&#039;s the usual NDA stuff, not FOSS like Coreboot...</p><p>But encryption is protection in many ways, even on a running system with all unlocked...</p><p>Aaarghh... Minor glitches to solve only.</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Sat, 15 Jul 2017 21:33:27 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=3354#p3354</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=3352#p3352</link>
			<description><![CDATA[<div class="quotebox"><cite>Simplicio wrote:</cite><blockquote><div><p>miroR, I&#039;m sorry to say that, as far as I can tell, you can&#039;t do the same with MBR disks as I believe there is not enough room in the MBR for GRUB code installed to the MBR to have the capability of opening encrypted partitions. So on MBR-based systems, you will need to have a non-encrypted boot partition.</p><p>I&#039;m very happy to be proved wrong.</p></div></blockquote></div><p>I think you&#039;ll be very happy!</p><p>I studied this matter over in a few places, starting from links available in this topic. The most important:</p><p><a href="https://wiki.archlinux.org/index.php/GRUB#Boot_partition" rel="nofollow">https://wiki.archlinux.org/index.php/GR … _partition</a></p><p>and I ended up convinced that encrypted boot is not a dependency of EFI, but a feature of Grub for long by now, after reading:</p><p><a href="https://wiki.debian.org/Grub2" rel="nofollow">https://wiki.debian.org/Grub2</a></p><p><strong># apt-cache policy grub2</strong></p><div class="codebox"><pre><code>grub2:
  Installed: (none)
  Candidate: 2.02~beta3-5
  Version table:
     2.02~beta3-5 500
        500 http://packages.devuan.org/merged ascii/main amd64 Packages
        500 http://auto.mirror.devuan.org/merged ascii/main amd64 Packages</code></pre></div><p><strong>#</strong><br />but:<br /><strong># apt-cache policy grub2-common</strong></p><div class="codebox"><pre><code>grub2-common:
  Installed: 2.02~beta3-5
  Candidate: 2.02~beta3-5
  Version table:
 *** 2.02~beta3-5 500
        500 http://packages.devuan.org/merged ascii/main amd64 Packages
        500 http://auto.mirror.devuan.org/merged ascii/main amd64 Packages
        100 /var/lib/dpkg/status</code></pre></div><p><strong>#</strong><br />---<br />Important to note is only that the version is higher than <span style="color: blue">2.02~beta2-29</span>, reason follows.</p><div class="quotebox"><cite>https://wiki.debian.org/Grub2 wrote:</cite><blockquote><div><p>Configure encrypted /boot</p><p>Grub <span style="color: green">2.02~beta2-29</span> supports reading an encrypted /boot partition.</p><p>Assuming you already have an encrypted system as setup by debian installer:</p><ul><li><p>add GRUB_ENABLE_CRYPTODISK=y to /etc/default/grub</p></li></ul><ul><li><p>backup the contents of your /boot partition somewhere</p></li></ul><ul><li><p>create an LUKS container where your /boot partition was and unlock it</p></li></ul><ul><li><p>create an ext2 filesystem your LUKS container and mount it to /boot</p></li></ul><ul><li><p>restore the backup of your /boot partition to your new encrypted /boot</p></li></ul><ul><li><p>grub-install and update-grub</p></li></ul><p>Grub2 (last modified 2016-01-24 17:47:35)</p></div></blockquote></div><p>I think it should work both in this old MBR based system of mine, as well as in my GPT based newer (but not so new) system of mine.</p><p>Will report how I fared.</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Sat, 15 Jul 2017 20:30:43 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=3352#p3352</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2602#p2602</link>
			<description><![CDATA[<div class="quotebox"><cite>Simplicio wrote:</cite><blockquote><div><p>miroR, I&#039;m sorry to say that, as far as I can tell, you can&#039;t do the same with MBR disks as I believe there is not enough room in the MBR for GRUB code installed to the MBR to have the capability of opening encrypted partitions. So on MBR-based systems, you will need to have a non-encrypted boot partition.</p><p>I&#039;m very happy to be proved wrong.</p></div></blockquote></div><p>I see. Well, I have a couple of systems (fit for my Air-Gapping method, same hardware more than two MBO), and I&#039;ll be back to apply full encryption like you made here. But that is later.<br />Regards!</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Tue, 27 Jun 2017 15:38:57 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2602#p2602</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2599#p2599</link>
			<description><![CDATA[<p>miroR, I&#039;m sorry to say that, as far as I can tell, you can&#039;t do the same with MBR disks as I believe there is not enough room in the MBR for GRUB code installed to the MBR to have the capability of opening encrypted partitions. So on MBR-based systems, you will need to have a non-encrypted boot partition.</p><p>I&#039;m very happy to be proved wrong.</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Tue, 27 Jun 2017 14:43:54 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2599#p2599</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2595#p2595</link>
			<description><![CDATA[<div class="quotebox"><cite>Simplicio wrote:</cite><blockquote><div><p>Yes, I encrypt even /boot.</p><p>If you read my earlier posts carefully,</p></div></blockquote></div><p>I wish I could have, but haven&#039;t yet gone through carefully. Out of time. And also I work terribly slow...</p><p>But, I now know where to look for information! Thanks!</p><div class="quotebox"><blockquote><div><p>you should be able to do it, especially if you follow the link to Pavel Kogan&#039;s post:</p><p><a href="http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/" rel="nofollow">http://www.pavelkogan.com/2014/05/23/lu … ncryption/</a></p><p>Set up two partitions on the disk:</p><p>First: EFI System Partition</p></div></blockquote></div><p>Not in this setup that I am currently using, such as for online (only Devuan for online since a month ago, be it Devuan proper or Heads).<br />In this setup, this --old-- MBO, it&#039;s MBR, not EFI. </p><p>I hope when I study some day, that there is options for MBR as well... in the links (and maybe in your own posts?)...</p><div class="quotebox"><blockquote><div><p>Second: Luks encrypted</p><p>Inside the LUKS encrypted partition run the Logical Volume Manager (lvm) and create as many volumes as you need.</p><p>Set up your chosen filesystem on each volume.</p><p>Make sure that GRUB2 includes the relevant encryption modules.<br />Make sure that the GRUB setup follows the recommendations given by Pavel Kogan above.</p><p>What Pavel goes on to do is give a set-up that allows you to enter the encryption password/phrase once, rather than twice when booting. I&#039;ve not done that, as I don&#039;t mind typing in the passphrase twice. For now, at least.</p><p>So /boot and swap are encrypted, as well as everything else, apart from the EFI System Partition.</p></div></blockquote></div><p>Thanks! I will use your info some day, but it remains undefined how soon.<br /><span style="color: blue">===========================================================================</span></p><div class="quotebox"><cite>fsmithred wrote:</cite><blockquote><div><div class="quotebox"><cite>miroR wrote:</cite><blockquote><div><p>... [I couldn&#039;t get Refracta to]:</p><div class="codebox"><pre><code># update-initramfs -u -k &lt;the-kernel-version&gt;</code></pre></div><p>so I am wondering now, maybe there is an issue with Refracta?</p><p>Of course, it is (pasting, except to the ellipsis):<br /><a href="http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Refracta-102636.shtml" rel="nofollow">http://linux.softpedia.com/get/System/O … 2636.shtml</a><br />Refracta [...] 8.3 Beta 20170305</p></div></blockquote></div><p>That should have worked. Was there an error message?</p></div></blockquote></div><p>Yes there was, but I don&#039;t remember any details of it now... My mind has started shedding info that I have prepared (and have some in writing) for the Air-Gapped Devuan Install, Tentative topic (linked in my previous post in this topic), and what happeded more exactly with Refracta is lost information here at this time... Sorry!</p><p>But I will try again, only really don&#039;t know how soon or less soon it will be... </p><div class="quotebox"><blockquote><div><p>It seems odd that softpedia labels that iso as beta. It&#039;s 8.3. </p><p>sha256sum</p><div class="codebox"><pre><code>2b9a39c0e4bbee600607ef24053a65685282d4b47c8a6b76418020e59646ad8e  refracta8.3_xfce_amd64-20170305_0250.iso</code></pre></div></div></blockquote></div><p>Yes, I checked (that&#039;s quick, the try and run update-initramfs with Refracta is the --unknown how soon-- next time)... That&#039;s the DVD I used.</p><div class="quotebox"><blockquote><div><p>Here&#039;s where I put my isos (and .asc files if you want to check the signature.)<br /><a href="https://sourceforge.net/projects/refracta/files/isohybrid/" rel="nofollow">https://sourceforge.net/projects/refrac … isohybrid/</a></p></div></blockquote></div><p>You should... Ah, a private PM is due.</p><p>Thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Tue, 27 Jun 2017 09:41:58 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2595#p2595</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2590#p2590</link>
			<description><![CDATA[<div class="quotebox"><cite>miroR wrote:</cite><blockquote><div><p>Everything worked fine until writing out the GRUB2 loader, which reported failure.<br />I couldn&#039;t get Refracta to, after regularly chroot&#039;ing into a working distro cloned onto another hard disk to put it into another machine [I couldn&#039;t get Refracta to]:</p><div class="codebox"><pre><code># update-initramfs -u -k &lt;the-kernel-version&gt;</code></pre></div><p>so I am wondering now, maybe there is an issue with Refracta?</p><p>Of course, it is (pasting, except to the ellipsis):<br /><a href="http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Refracta-102636.shtml" rel="nofollow">http://linux.softpedia.com/get/System/O … 2636.shtml</a><br />Refracta [...] 8.3 Beta 20170305</p></div></blockquote></div><p>That should have worked. Was there an error message?</p><p>It seems odd that softpedia labels that iso as beta. It&#039;s 8.3. </p><p>sha256sum</p><div class="codebox"><pre><code>2b9a39c0e4bbee600607ef24053a65685282d4b47c8a6b76418020e59646ad8e  refracta8.3_xfce_amd64-20170305_0250.iso</code></pre></div><p>Here&#039;s where I put my isos (and .asc files if you want to check the signature.)<br /><a href="https://sourceforge.net/projects/refracta/files/isohybrid/" rel="nofollow">https://sourceforge.net/projects/refrac … isohybrid/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Tue, 27 Jun 2017 02:32:26 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2590#p2590</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2587#p2587</link>
			<description><![CDATA[<p>Yes, I encrypt even /boot.</p><p>If you read my earlier posts carefully, you should be able to do it, especially if you follow the link to Pavel Kogan&#039;s post:</p><p><a href="http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/" rel="nofollow">http://www.pavelkogan.com/2014/05/23/lu … ncryption/</a></p><p>Set up two partitions on the disk:</p><p>First: EFI System Partition<br />Second: Luks encrypted</p><p>Inside the LUKS encrypted partition run the Logical Volume Manager (lvm) and create as many volumes as you need.</p><p>Set up your chosen filesystem on each volume.</p><p>Make sure that GRUB2 includes the relevant encryption modules.<br />Make sure that the GRUB setup follows the recommendations given by Pavel Kogan above.</p><p>What Pavel goes on to do is give a set-up that allows you to enter the encryption password/phrase once, rather than twice when booting. I&#039;ve not done that, as I don&#039;t mind typing in the passphrase twice. For now, at least.</p><p>So /boot and swap are encrypted, as well as everything else, apart from the EFI System Partition.</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Mon, 26 Jun 2017 22:38:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2587#p2587</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2586#p2586</link>
			<description><![CDATA[<p>Just a not on this failure below.</p><div class="quotebox"><cite>Simplicio wrote:</cite><blockquote><div><p>I tried the installer, rather than the live iso, using the Expert option and manual partitioning.<br />...<br />Everything worked fine until writing out the GRUB2 loader, which reported failure.</p></div></blockquote></div><p>I couldn&#039;t get Refracta to, after regularly chroot&#039;ing into a working distro cloned onto another hard disk to put it into another machine [I couldn&#039;t get Refracta to]:</p><div class="codebox"><pre><code># update-initramfs -u -k &lt;the-kernel-version&gt;</code></pre></div><p>so I am wondering now, maybe there is an issue with Refracta?</p><p>Because I could, on the last Gentoo instance that I still have for use, arrange for, and mount the new system partitions and all, and chroot into it, from that Gentoo, and perfectly and successfully run the:</p><div class="codebox"><pre><code># update-initramfs -u -k &lt;the-kernel-version&gt;</code></pre></div><p>Actually I am now running that new machine (new by way of all cloned anew onto the HDD; but MBO was already previously in use), as I am writing this.</p><p>Of course, it is (pasting, except to the ellipsis):<br /><a href="http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Refracta-102636.shtml" rel="nofollow">http://linux.softpedia.com/get/System/O … 2636.shtml</a><br />Refracta [...] 8.3 Beta 20170305</p><p>And just a remark:<br />I don&#039;t want (nor need) to use this one (used it in the past a lot, also a few times the Super GRUB2):</p><div class="quotebox"><blockquote><div><p>Booting from a SystemRescueCD USB drive<br />...</p></div></blockquote></div><p>on principle. It&#039;s SystemDestruction-contaminated...</p><p>I do have all (and I mean all) encrypted except the /boot. If you <span style="color: green">Simplicio</span> really manage it to encrypt even /boot, pls. teach us.</p><p>But I have to go now and update my topic over at:</p><p>Air-Gapped Devuan Install, Tentative<br /><a href="https://dev1galaxy.org/viewtopic.php?id=746" rel="nofollow">https://dev1galaxy.org/viewtopic.php?id=746</a></p><p>Regards!</p>]]></description>
			<author><![CDATA[dummy@example.com (miroR)]]></author>
			<pubDate>Mon, 26 Jun 2017 21:53:34 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2586#p2586</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=2585#p2585</link>
			<description><![CDATA[<p>OK, so I finally had the time to work my way through the issues I encountered.</p><p>The task I had set myself was to install Devuan onto an SSD that itself was installed as a replacement for the original hard disk in laptop with 4 Gbytes of memory, a 64-bit capable AMD processor, and UEFI boot firmware. </p><p>By the way, I&#039;m lazy. All this was done while logged in as root, not using sudo.</p><p>Writing the net-install ISO to a USB flash memory drive and doing a minimal install worked fine, as documented above, so I had an SSD with two partitions: /dev/sda1 and /dev/sda2</p><p>/dev/sda1 is the EFI system partition, vFAT formatted<br />/dev/sda2 is a single, encrypted partition, which is opened at boot by GRUB2</p><p>It&#039;s probably a good idea to make sure the system is nicely up-to-date</p><div class="codebox"><pre><code>apt-get update
apt-get upgrade</code></pre></div><p>(Reboot if necessary if a new kernel has appeared)</p><p>After that interlude, once accessed through the device mapper, the encrypted sda2 (/dev/sda2_crypt) appears as a Linux Logical Volume Manager (lvm) physical device, in which I set up a single volume group (Volume Group Foo (vgf)), and a set of volumes. (If I had felt like it, I could have set up multiple Volume Groups, e.g. Volume Group Bar Volume Group Baz, but for now at least, it wasn&#039;t necessary). I chose to set up the following volumes (I&#039;m sure there are different, better ways, but I had to start somewhere. I prefixed each name with an &#039;x&#039; because I knew that later on I&#039;d need a clearly different name for migration purposes).</p><p>Physical Volume<br />/dev/sda2_crypt<br />Volume Group: vgf<br />xroot<br />xboot<br />xhome<br />xtmp<br />xvar<br />xswap</p><p>If someone else is doing this, they could well have chosen a different name for their encrypted device. You can find out what encrypted devices are on your system by looking at the output of</p><div class="codebox"><pre><code>dmsetup status --target crypt</code></pre></div><p>which will list all of the devices where the device mapper is using encryption.</p><p>The logical volume manager also uses the device mapper, but rather than encryption it is doing some clever stuff that enables (for example) separate blocks of storage on different disks to looks as if they are a single device, and allows (relatively) easy expansion and contraction of those devices.</p><p>Anyway, you can list the physical devices being used by the logical volume manager by:</p><div class="codebox"><pre><code>lvm pvs </code></pre></div><p>(physical device show)</p><p>You can see what volume groups are defined</p><div class="codebox"><pre><code>lvm vgs </code></pre></div><p>(volume group show)</p><p>and you can see what volumes are define in each volume group</p><div class="codebox"><pre><code>lvm lvs</code></pre></div><p>(logical volume show)</p><p>Each logical volume can be treated as thought it were a disk partition. Expanding or contracting lvm volumes is a great deal easier than doing the same with partitions.</p><p>So, each lvm volume has its own filesystem. The Devuan installer does not support the NILFS2 filesystem, so what I did, as a temporary measure, is create an ext2 filesystem on each logical volume. I chose to use less than half of my available disk space for the logical volumes I created with ext2 filesystems, as I knew I would need to migrate them later, so I needed to leave space to migrate them into.</p><p>You can confirm this on your own system by looking at&#160; /proc/mounts</p><div class="codebox"><pre><code>cat /proc/mounts</code></pre></div><p>or, in a slightly nicer format</p><div class="codebox"><pre><code>findmnt</code></pre></div><p>As I documented above, there were a couple of glitches to do with the way GRUB2 handles encrypted boot partitions, but I got that sorted out, so I had a system I could boot, GRUB would prompt me for the password/phrase for the encrypted partition which allowed it to access /boot and the initrd and initramfs, then the initial startup in the initramfs would re-prompt me for the password/phrase so the system could be brought up.</p><p>So, I then had to replace the ext2 filesystems with nilfs2 filesystems. I can&#039;t remember if the nilfs tools are included on the minimal net-install Devuan, but if they are not, it is a simple matter of</p><div class="codebox"><pre><code>apt-get install nilfs-tools</code></pre></div><p>I could then use the Logical Volume Manager to define some more volumes, which I put in the same volume group as the first set - they didn&#039;t need to be, but there was no pressing reason to define a new one.</p><p>yroot<br />yboot<br />yhome<br />ytmp<br />yvar<br />yswap</p><p>so I now had a whole new set of volumes defined with names that started with a &#039;y&#039; instead of an &#039;x&#039;. I could then format these volumes as NILFS2 filesystems as I wasn&#039;t using the installer: this was a normal system.</p><div class="codebox"><pre><code>mkfs.nilfs2 /dev/mapper/vgf-yroot
mkfs.nilfs2 /dev/mapper/vgf-yboot
mkfs.nilfs2 /dev/mapper/vgf-yhome
mkfs.nilfs2 /dev/mapper/vgf-ytmp
mkfs.nilfs2 /dev/mapper/vgf-yvar</code></pre></div><p>I left NILFS with all the defaults. Note that NILFS2 uses disk space in an unusual way, so you do NOT want to make the volume too small. This is especially true of the boot volume, which normally doesn&#039;t need to be very big at all. I used a sledgehammer to crack a nut and made yboot 4 Gbytes in size, which is probably way too big, but I should be able to reduce it down later, if necessary, as the NILFS2 filesystem is resizeable, and lvm volmes can be shrunk as well.</p><p>Now comes the fun bit: I needed to migrate (copy) all of the information from the ext2 volumes over to their corresponding nilfs volumes. If you try to do this on a running system, it probably wont work very well, so don&#039;t try it!</p><p>Instead, I got a copy of System Rescue CD and put it on a USB flash memory drive. I booted the laptop into System Rescue CD, so the root filesystem in use is on the USB drive. Then a &#039;fair amount&#039; of typing is needed.</p><p>First of all, you need to connect the encrypted partition on the laptop to the device mapper. My laptop discovered the internal disk first, even when booted from the USB drive, so it remained as device /dev/sda, but other laptops may enumerate the USD drive first, so the internal disk might appear as /dev/sdb. The rest of this assumes it&#039;s /dev/sda.</p><div class="codebox"><pre><code>cryptsetup luksOpen /dev/sda2  &lt;your-chosen-cryptname&gt;  #&lt;-note, /dev/sda1 is the EFI system partition</code></pre></div><p>You get prompted for the password/phrase, and assuming it&#039;s right, the device mapper swings into action, decrypting the partition on the fly/on demand as necessary. You can confirm this by</p><div class="codebox"><pre><code>dmsetup status --target crypt</code></pre></div><p>The logical volume manager will also have swung into action and discovered the volumes defined on the encrypted partiton - you can check this by </p><div class="codebox"><pre><code>lvm pvs
lvm vgs
lvm lvs</code></pre></div><p>We can now mount all the volumes and copy the data across. Because we booted from the USB drive, we don&#039;t have to worry about what happens if you copy a file system in use on a running system.</p><p>Create the mount points for the source (old) data</p><div class="codebox"><pre><code>mkdir /mnt/old
mkdir /mnt/old/root
mkdir /mnt/old/boot
mkdir /mnt/old/home
mkdir /mnt/old/tmp
mkdir /mnt/old/var</code></pre></div><p>mount the ext volumes (read-only, just for some pretence at safety - you do have backups, don&#039;t you?)</p><div class="codebox"><pre><code>mount -o ro /dev/mapper/vgf-xroot  /mnt/old/root
mount -o ro /dev/mapper/vgf-xboot /mnt/old/boot
mount -o ro /dev/mapper/vgf-xhome /mnt/old/home
mount -o ro /dev/mapper/vgf-xtmp /mnt/old/tmp
mount -o ro /dev/mapper/vgf-xvar /mnt/old/var</code></pre></div><p>Now do the destinations</p><div class="codebox"><pre><code>mkdir /mnt/new
mkdir /mnt/new/root
mkdir /mnt/new/boot
mkdir /mnt/new/home
mkdir /mnt/new/tmp
mkdir /mnt/new/var</code></pre></div><p>mount the nilfs2 volumes. These are the options I chose, they are probably not optimal. Shrug.</p><div class="codebox"><pre><code>mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yroot  /mnt/new/root
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yboot /mnt/new/boot
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yhome /mnt/new/home
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-ytmp /mnt/new/tmp
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yvar /mnt/new/var</code></pre></div><p>now do the copying</p><div class="codebox"><pre><code>cp -ax /mnt/old/root/* /mnt/new/root
cp -ax /mnt/old/boot/* /mnt/new/boot
cp -ax /mnt/old/home/* /mnt/new/home
cp -ax /mnt/old/tmp/* /mnt/new/tmp
cp -ax /mnt/old/var/* /mnt/new/var</code></pre></div><p>Now, the fstab we have copied across will still refer the OLD ext2 volumes, so we need to edit the fstab on the new nilfs2 volume</p><div class="codebox"><pre><code>nano /mnt/new/root/etc/fstab</code></pre></div><p>(I use nano, you can use whatever editor you are comfortable with)</p><p>The relevant entries will need to be modified to (a) point to the new lvm volumes (the ones prefixed by &#039;y&#039;) and (b) have mount options suitable for nilfs2 (as above).</p><p>You can&#039;t just reboot and have everything work now. The GRUB2 boot setup still points to all the old volumes, so we not only have to tell GRUB2 that we are using different lvm volumes, GRUB2 also has to understand nilfs2 and have the initial ram disk rebuilt, otherwise nothing will work. As I found out. Repeatedly.</p><p>Now, in principle, you can rebuild GRUB2 while you are booted from the System Rescue CD USB drive. In principle.</p><p>I ran out of patience, and used a chroot method instead.</p><p>So we shut down, and reboot back into Devuan on the ext2 volumes. This doesn&#039;t affect the data on the nilfs volumes.</p><p>We then set up the chroot environment which will allow us to run the GRUB2 setup for the changed environment. </p><p>First of all, create a mount point for the new volumes</p><div class="codebox"><pre><code>mkdir /mnt/chr</code></pre></div><p>now mount the nilfs volumes there</p><div class="codebox"><pre><code>mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yroot  /mnt/chr/  #&lt;-note difference to what we did above
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yboot /mnt/chr/boot
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yhome /mnt/chr/home
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-ytmp /mnt/chr/tmp
mount -o async,noatime,discard,order=strict /dev/mapper/vgf-yvar /mnt/chr/var</code></pre></div><p>now you have a &#039;sort-of&#039; copy of the familiar linux filesystem layout under /mnt/chr</p><p>We do some chroot setup magic</p><div class="codebox"><pre><code>mount -t proc none /mnt/chr/proc
mount -t sysfs none /mnt/chr/sys #&lt;-note sysfs, not sys
mount -o bind /dev /mnt/chr/dev
mount -o bind /run /mnt/chr/run</code></pre></div><p>(The chroot environment wont work properly without the above. Depending on what you are doing, you can &#039;get away&#039; without some of the above e.g. if you don&#039;t need network access while chrooted, but I&#039;m documenting what worked for me. Wiser, better informed heads than me can improve things, I&#039;m sure).</p><p>Now, finally we need to make the EFI system partition available while in the chroot environment. What I&#039;m about to do is probably not recommended (Danger Will Robinson!), but it worked for me.<br />We unmount from it&#039;s proper place and remount it at /mnt/new, so we can access it later while chrooted. If a wiser head can advise a better way, please do tell me. (The uuid details can be found in /etc/fstab)</p><div class="codebox"><pre><code>umount /boot/efi
mount -o umask=0077 UUID=&lt;your-uuid&gt; /mnt/chr/boot/efi</code></pre></div><p>Now we chroot</p><div class="codebox"><pre><code>chroot /mnt/chr /bin/bash</code></pre></div><p>...and we are now in a chroot environment aka a chroot jail. In the context of this process, the filesystem layout has its root at /mnt/chr, not / . Wow.</p><p>Now, if we run the various GRUB utilities, they will update the new volumes, not the old ones.</p><p>There&#039;s a couple of things we need to do.<br />First of all, we need to tell GRUB that it should load the nilfs2 module so it can understand the filesystem on the new volumes. We do that by adding nilfs2 to /etc/initramfs-tools/modules. For good measure, I added lvm, crypto, and cryptodisk too.</p><div class="codebox"><pre><code>nano /etc/initramfs-tools/modules</code></pre></div><p>The other thing to check is that /etc/mtab is correct.</p><div class="codebox"><pre><code>cat /etc/mtab</code></pre></div><p>if it isn&#039;t (I didn&#039;t need to do this)&#160; you can &#039;simply&#039; </p><div class="codebox"><pre><code>cat /proc/mounts &gt; /etc/mtab  #&lt;-this is another &#039;Danger Will Robinson! moment</code></pre></div><p>This (apparently) is important, as GRUB gets some information from /etc/mtab when doing its setup fandango.</p><p>Now we can run grub-update, which will build a new initramfs, and rebuild the GRUB2 boot menu. As we are in the chroot environment which should be set up properly, and using the same kernel, we don&#039;t have to worry about passing target directories, or specifying processor architecture etc. It &#039;just works&#039;</p><div class="codebox"><pre><code>update-grub</code></pre></div><p>Then we install it</p><div class="codebox"><pre><code>grub-install</code></pre></div><p>Don&#039;t reboot yet.</p><p>I&#039;m told its a good idea to dismount volumes nicely, as what you&#039;ve been doing in the chroot environment isn&#039;t visible to the normal system, so we leave the chroot</p><div class="codebox"><pre><code>exit</code></pre></div><p>Then we&#039;d better put the EFI system partition back</p><div class="codebox"><pre><code>umount /mnt/chr/boot/efi
mount -o umask=0077 UUID=&lt;your-uuid&gt; /boot/efi</code></pre></div><p>unmount the pre-chroot magic</p><div class="codebox"><pre><code>umount /mnt/chr/run
umount /mnt/chr/dev
umount /mnt/chr/sys 
umount /mnt/chr/proc</code></pre></div><p>Now you can reboot.</p><p>And now, in theory, if I&#039;ve documented my hurried scribblings properly, when the system comes back up again, it boots using the NILFS2 volumes, and I&#039;ve achieved what I wanted to do. Use NILFS2 on my SSD, and have an encrypted boot, root and swap, as well as home and everything else.</p><p>Now to install/upgrade to a full desktop. Wish me luck...</p><p>[Note to self, will add BBCode formatting later, once I get sufficient time. I just wanted to get a rough draft out]</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Mon, 26 Jun 2017 20:00:43 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=2585#p2585</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1832#p1832</link>
			<description><![CDATA[<p>Just a quick update to say that reading Pavel Kogan&#039;s blog allowed me to get one baby step further.</p><p><a href="http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/" rel="nofollow">http://www.pavelkogan.com/2014/05/23/lu … ncryption/</a></p><p>In it he points out that /etc/default/grub needs to be edited to pass the cryptdevice as a kernel parameter. Modifying it for a (reasonably) default Devuan Jessie install (I downloaded the actual release rather than release candidate and redid things from scratch)</p><div class="quotebox"><blockquote><div><p>GRUB_CMDLINE_LINUX=&quot;cryptdevice=/dev/sda2:sda2_crypt&quot;</p></div></blockquote></div><p>you then need to update the grub installation (there&#039;s more to this than meets the eye, which I&#039;ll expand on when I have time). </p><p>My laptop now boots all the way into Devuan, with an encrypted boot/root&#160; - the only unencrypted area of the disk is the EFI System Partition. The boot process requires you to type in the Luks password twice (Pavel Kogan provides a possible workaround for this).</p><p>Unfortunately, I couldn&#039;t install on the filesystem of my choice (NILFS), so as a temporary measure, I used ext2, but having got the encryption bit sorted, I&#039;m pretty sure I can sort out creating some NILFS volumes in lvm, copy everything across, update fstab, do a chroot and a grub update (I&#039;ve probably missed something) and get things set up the way I want. It&#039;s &#039;just&#039; a question of finding the time.</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Wed, 31 May 2017 14:25:39 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1832#p1832</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1302#p1302</link>
			<description><![CDATA[<p>OK, getting there slowly.</p><p>By using Super GRUB2 disk to boot into the new installation, I can run grub-install. This fails with an error, which was roughly:</p><div class="quotebox"><blockquote><div><p>grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=1&#039; in file `/etc/default/grub&#039;.</p></div></blockquote></div><p>Anyway, there is a slight misfeature in that you need to edit /etc/default/grub with - </p><div class="quotebox"><blockquote><div><p>GRUB_ENABLE_CRYPTODISK=y &lt;&lt;--note, not &#039;1&#039;</p></div></blockquote></div><p>(This bug refers: <a href="https://savannah.gnu.org/bugs/?41524" rel="nofollow">https://savannah.gnu.org/bugs/?41524</a> ) The GRUB manual documents the actual behaviour: <a href="https://www.gnu.org/software/grub/manual/grub.html" rel="nofollow">https://www.gnu.org/software/grub/manual/grub.html</a></p><div class="quotebox"><blockquote><div><p>‘GRUB_ENABLE_CRYPTODISK’</p><p>&#160; &#160; If set to ‘y’, grub-mkconfig and grub-install will check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible because GRUB will wait for passphrase to unlock encrypted container.</p></div></blockquote></div><p>Having done that, and added in GRUB_PRELOAD_MODULES=&quot;lvm&quot; for good measure (probably not necessary, but I haven&#039;t checked to find out), I then re-run grub-install, this time with no errors.</p><p>Then, when I boot, I get presented with a prompt for the password for the encrypted partition. Yay!</p><p>But I subsequently get dumped into a GRUB&gt; prompt (not Grub rescue). Boo.</p><p>However, if I look at the devices</p><div class="codebox"><pre><code>GRUB&gt; ls</code></pre></div><p>I see all the lvm volumes. </p><p>so I set up the linux and initrd </p><div class="codebox"><pre><code>GRUB&gt; linux (lvm/vg1-root)/vmlinuz
GRUB&gt; initrd (lvm/vg1-root)/initrd.img
GRUB&gt; boot</code></pre></div><p>And the boot fails, saying - </p><div class="codebox"><pre><code>error: no suitable video mode found
Booting in blind mode.</code></pre></div><p>However, after a bit of looking, if you add the following command in GRUB before booting</p><div class="codebox"><pre><code>GRUB&gt; insmod all_video</code></pre></div><p>it boots successfully, asking (for the second time, as expected) for the password to the encrypted partition as part of the linux boot sequence.</p><p>So all I need to do now is automate the manual fix above. Which I know is possible, because Super GRUB2 disk works fine.</p><p>Which means I am one step closer to having Devuan with an unencrypted EFI System Partition, and one encrypted partition that holds LVM volumes providing swap, root, home, etc...</p><p>Simplicio</p><p>[edited to add <a href="https://dev1galaxy.org/help.php#bbcode" rel="nofollow">BBCode</a> quote and code markup]</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Fri, 28 Apr 2017 12:16:37 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1302#p1302</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1238#p1238</link>
			<description><![CDATA[<p>I tried the installer, rather than the live iso, using the Expert option and manual partitioning. This allows me to:</p><p>a) Create an EFI System partition (/dev/sda1) and a partition encompassing the rest of the disk (/dev/sda2);<br />b) Devote the (/dev/sda2) partition to the encryption layer (creating /dev/mapper/sda2_crypt);<br />c) Build LVM on top the the block device presented by the device mapper (/dev/mapper/sda2_crypt) - creating Volume group 1 (vg1);<br />d) Create a swap partition within LVM (vg1-swap); BUT<br />e) NOT use NILFS2 as the filesystem for the root (vg1-root) and other partitions (vg1-&lt;foo,bar,baz&gt;). The installer doesn&#039;t offer NILFS as a filesystem which is surely because it does not have mkfs.nilfs2. This debian bug/wishlist item may be relevant ( <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655438" rel="nofollow">https://bugs.debian.org/cgi-bin/bugrepo … bug=655438</a> ).</p><p>As a temporary measure, I used ext2, just to see if the installation would complete nicely...</p><p>Everything worked fine until writing out the GRUB2 loader, which reported failure.</p><p>Booting from a SystemRescueCD USB drive, I can see the encryption, lvm setup, ext2 filesystems on root and other mount points have all been successfully created and populated, but apparently nothing written into the devuan directory created on the EFI System partition. </p><p>By using a Super GRUB2 disk ( <a href="http://www.supergrubdisk.org/super-grub2-disk/" rel="nofollow">http://www.supergrubdisk.org/super-grub2-disk/</a> ) on a USB drive, I can boot the newly-installed Devuan system - this involves enabling the luks capability in GRUB2 to mount the encrypted partition, followed by enabling the lvm-aware capability, at which point SuperGRUB2 finds the initial ramdisk on the root volume and booting works without a problem. This demonstrates that encrypting all except the EFI System partition is achievable...there are &#039;just&#039; a few details to be worked on.</p><p>Personally, I think that encrypting all but the EFI System Partition should be, if not the default, at least a standard option offered to everyone.</p><p>One thing I have learnt from this is that it is entirely possible to have your EFI System partition on a separate USB drive to the internal disk on a laptop, which might be useful to some people.</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Sun, 23 Apr 2017 21:52:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1238#p1238</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1211#p1211</link>
			<description><![CDATA[<p>Ah, thank-you. Yes, I was using the live iso, which includes an experimental installer. I&#039;ll try an appropriate one from the ones you linked to, when I get time away from other distractions again.</p><p>I&#039;m not sure I&#039;m up to remastering yet.</p>]]></description>
			<author><![CDATA[dummy@example.com (Simplicio)]]></author>
			<pubDate>Sat, 22 Apr 2017 17:01:47 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1211#p1211</guid>
		</item>
		<item>
			<title><![CDATA[Re: Installing to existing partitions/mount? Full disk encrypt? Feedback.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1202#p1202</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>The current Jessie rc installer is not LVM2 aware.</p></div></blockquote></div><p>That is not exaclty right. You must have downloaded a live iso. The live installer does not do lvm. The installer in the regular installer isos is the debian-installer. It&#039;ll do lvm, raid, and all the other stuff you would expect. (It might be possible to get it to install to your prepared lvm with a little bit of hacking. I can&#039;t give that a lot of thought at the moment, but I&#039;m not dismissing the idea.)&#160; </p><p>For the regular installer, try one of these:<br /><a href="https://files.devuan.org/devuan_jessie_rc/installer-iso/" rel="nofollow">https://files.devuan.org/devuan_jessie_ … aller-iso/</a></p><p>Regarding encrypted boot: I&#039;ve heard of it. Don&#039;t know much about it.</p><p>Edit: for the remastering tools, you need refractasnapshot and refractainstaller. (-base packages for cli-only, both -base and -gui for gui) either from devuan experimental repo or download debs from here - <a href="https://sourceforge.net/projects/refracta/files/tools/" rel="nofollow">https://sourceforge.net/projects/refracta/files/tools/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Sat, 22 Apr 2017 00:18:31 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1202#p1202</guid>
		</item>
	</channel>
</rss>
