Building a Gentoo Minimal LiveCD with ZFS support
2013-12-18 21:51 - Linux - Edit
I've used Gentoo Linux on my servers for some time. A few years back I learned how to set up encryption via LUKS over the whole root partition. Now I'm trying to use ZFS as my root file system and keep LUKS for encryption. The first thing I needed was a bootable install environment with support for both ZFS and LUKS. The only one I could find was the Gentoo LiveDVD, but that's over a year old. I've tried using it in tests, and it causes the whole machine to hang quite often.
I found an old repository that claimed to provide straightforward instructions to build a regular Gentoo install CD with ZFS support. But it was even older than the live DVD. So old that I couldn't get it to build correctly. This pointed me towards the Gentoo Catalyst build system, however. I found the source for Gentoo releng, where the catalyst tool which makes the Gentoo installation media is developed. And I updated it to support ZFS. I've made those changes available, so you should be able to:
# cd /root # git clone https://github.com/arantius/gentoo-releng.git releng # cd releng # git checkout -t origin/zfs # mkdir -p /var/tmp/catalyst/builds/default # cd /var/tmp/catalyst/builds/default # wget ... -O stage3-amd64-latest.tar.xz # xzcat stage3-amd64-latest.tar.xz | bzcat -1 -z > stage3-amd64-latest.tar.bz2 # emerge catalyst # cd /root # catalyst -s latest # catalyst -v -f releng/releases/weekly/specs/amd64/installcd-stage1.spec # catalyst -v -f releng/releases/weekly/specs/amd64/installcd-stage2-minimal.spec
Customizing of course that wget line, maybe even using links interactively. Just make sure the stage3 snapshot ends up at exactly that path (and bz2 compressed, not xz). Also note that you really must put these files at /root/releng, as they contain hard coded references to that absolute path. If you don't already have a working Gentoo instance, this will work perfectly fine in a virtual machine. For me, stage 1 took about 70 minutes, and stage 2 about 20. An ISO image should now be located in /var/tmp/catalyst/builds/default/.
Finally, I'm making the fully built ISO image I created available for download. See this salient note on licensing. Download gentoo-install-amd64-minimal-20131205.zfs.iso; MD5 6b70a2109b323c077c458c72dcf09c83; SHA1 f36d8454da1ab4c889615085bb97d2070e2d99d0.
2014-08-14 19:52 - arantius - Delete
I had another install to do, and it turns out the network wasn't supported by my build above, the appropriate module was missing. I built a newer version, with more driver modules and btrfs support included, as well as ZFS. It's also available for download: gentoo-install-amd64-minimal-20140808.zfs.iso; MD5 80a47497cb3e78215e68182b6163e621; SHA1 83af108055a1d84960c22066233be02d162a80d4.