Install gentoo on zfs root




















It is correct that ZFS can be slower than other file systems Admittedly I still have to convert my system to use ZFS as root, but knowing someone else who has already done so with an initramfs, I don't have worries that I'll be able to accomplish this. If data integrity is not your top priority, and you don't have a need for the many ZFS-specific features like send, fixed snapshots, etc, then sure use another file system if you want something faster and more convenient.

By default the special vdev will be used for metadata, which already speeds the system up a fair bit due to fewer small reads and writes to the HDDs. I have never read about anyone else exploiting this allocation classes feature in that way to get real hybrid storage. Gentoo on zfs root works great especially if you have the capability to use uefi boot.

Thanks for the compliment. I'm setting up a fake system in a virtual machine, just to try out all the steps, examine options, and pick my new favorite methodology.

For the past few years I've relied on ZFS for my backup system, with atomic snapshots taken regularly, plus zfs send and zfs recv making geographic redundancy an easy extra layer. I also LUKS encrypt the disks for peace of mind, especially in the case of failed disks.

This document is a detailed explanation of how I set up a brand new machine from scratch with an ecrypted ZFS root file system. Work through the Gentoo Handbook until the Preparing the Disks section. I have selected raidz1 for a balance of disk redundancy plus usable space.

I've had a couple disks go bad over the years, but never two at once, so this means I've always been able to replace a disk before any serious catastrophe. So I assume that there are three disks. I used to prefer a completely separate unencrypted boot device. I originally thought that it was "best practice" to provision ZFS on raw disks, with no partitions.

I'm no longer confident that this is true, and I've come up with reasons to prefer partitions. It can be difficult to hook up enough disks. It's common for motherboards to provide four SATA ports. If that's three ZFS volumes plus one boot disk, they're all used up. Where do you put your extra disk when swapping in a replacement or an upgrade?

Even if you've got the space, there's the expense of another device, plus a separate plan for it's failure? I'm skipping dedicated boot devices from here on out. So now I'm selecting a partitioned scheme. Each disk will have partition 1 occupying the first MB for the unencrypted boot, then partition 2 fills the rest of the disk.

Set that up. A quick note on the examples before this first one: The shell prompts are colored red, the inputs I type are colored green, and the rest is the output.

Your output will likely differ in small details; I'm trusting you to be intelligent enough to figure that out if you're following this as a guide. But I find archiving the output still makes it easier to follow along. Your inputs may differ as well, be careful to make sure you are referencing e.

Depending on your situation you might need a "bios boot" partition as well. Since we're putting ZFS in a partition, it's of the utmost importance to make sure that the partition start is aligned with a physical disk sector. We recommend using funtoo-current stages for ZFS. Extract the contents with the following command. If the user is using an arch-optimized stage 3 tarball, substitute in the actual filename.

An important step is to copy the ZFS cache into the chroot. You will also want to copy over resolv. Configure your system according to the main install guide. Note that swap on ZFS is unstable. The Funtoo stage3 includes a linux kernel and initramfs. The initramfs is designed to mount and start Funtoo Linux on a variety of file systems. The initramfs contained within the stage3 will not mount and start Funtoo in our ZFS storage pool.

We must create an updated 'ZFS-friendly' initramfs. Adjust --makeopts according to the number of available threads:. This guide assumes the usage of debian-sources. Tailor it to your specific kernel name, platform, and kernel version. Forgetting to rename initramfs-genkernel to initramfs-debian-sources will render the system unbootable. This is achieved using the 'libzfs' USE flag.

When zpool created our storage pool rpool , it created partitions under a GPT scheme. By design, ZFS zpool left a very small unpartitioned space at the beginning of the disk.

To avoid problems with GRUB, use partx to refresh the list of partitions that are 'seen' by the kernel. Now, it's time for us to create grub's configuration file. Configure your network according to the main installation guide. ZFS is very sensitive about the data that is contained in the zpool. To ensure we have a good cache file, we have instructed bliss-initramfs in the bootloader config above, to ignore the current cachefile on the system, and make a new one that is up-to-date. We only need to do this once.

Since we now have a working system, we will snapshot it in case we ever want to go back or recover files:. You can view the contents of these snapshots by checking their respective and hidden. When the system starts up, and the module is loaded, these options will be passed to the zfs kernel module.

Once we have the above file created, let's regenerate the initramfs. When you reboot your machine, the initramfs will load up the zfs kernel module with the parameters found in the file. If you need to get back into your zpool from a livecd environment, you'll simply need to import your pool again using the following commands:.

If your pool is encrypted, you will also want to either pass the -l lower case L option your the zpool import command above Which will ask you for the pool's passphrase and thus load the keys , or you can use the following command after you imported the pool without keys:.

This will also ask you for the passphrase and load the key for the pool. Once you do that, you should be able to see the available value for your encrypted pool by doing:. Warning Continuing the installation without being in UEFI mode will most likely yield an unbootable system. If you want to install in BIOS mode, you will need a different setup.



0コメント

  • 1000 / 1000