Building a Gentoo Minimal LiveCD with ZFS support

2013-12-18 21:51 - Linux

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
# wget ... -O /var/tmp/catalyst/builds/default/stage3-amd64-latest.tar.bz2
# 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. 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. I actually built the ISO I'm using now from within a virtualboxes.org image for Gentoo. For me, stage 1 took just under 2 hours, and stage 2 about half an hour. 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.

Comments:

New Build
2014-08-14 19:52 - arantius

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.

Thanks for updating!
2015-05-29 09:37 - pendor

Pendor from the "old repository" here! =)

Thanks for figuring out the current way to do this. I kind of shot myself in the foot & needed a livecd with ZFS 0.6.4 drivers in it, and it saved me a bunch of time trying to figure out how to get my old build working again.

I've linked to this page from my old instructions and noted that this page has the best working procedure available.

Much appreciated!

New year, New build
2016-11-10 20:22 - arantius

Another few years, another update. I want to update my ZFS version, but I also want to be safe and have a bootable CD that can still access those pools. Of note, Gentoo Releng has a new location. I'm also setting up my VM for building from scratch this time. The basic steps above continue to work as expected, but I forgot to mention originally that a emerge catalyst is required before the steps listed, they say to run that command after all.

Anyway here you go, a fresh new gentoo-install-amd64-minimal-20161109.zfs.iso (CONTENTS, DIGESTS. MD5 f6bef39cddbfa3f4e62d11039fc21946; SHA1 12e6f821eed313d86af726ec0da4189136bf7fa5.

Post a comment:

Username
Password
  If you do not have an account to log in to yet, register your own account. You will not enter any personal info and need not supply an email address.
Subject:
Comment:

You may use Markdown syntax in the comment, but no HTML. Hints:

  • An empty line between text will create a paragraph boundary.
  • Use angle braces around a plain URL to auto-link it: <http://www.example.com/>.
  • Use this format to create a link with different text showing: [An Example](http://www.example.com/).
  • Use backticks (``), not leading spaces to enclose a code block.

If you are attempting to contact me, ask me a question, etc, please send me a message through the contact form rather than posting a comment here. Thank you. (If you post a comment anyway when it should be a message to me, I'll probably just delete your comment. I don't like clutter.)