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.

Comments:

New Build
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.

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

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 - Delete

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.

New build, ZFS 0.7.5
2018-01-14 22:14 - arantius - Delete

Time to safely upgrade ZFS again. I've updated everything to the latest stable versions and built a new image again. I've edited the post above to reflect all necessary updates to still work today.

gentoo-install-amd64-minimal-20180113.zfs.iso (CONTENTS, DIGESTS. MD5 6a1a8d9cac32187d6844ddded7241233; SHA1 cdbdf076ddce2f79cb86a326deed30c79dfcf95c.

Post a comment:

Subject:
Comment:

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

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.)

Search on GoogleSet up Mouseover Popup Image Viewer