I tried to follow your guide yesterday, but got stuck with grub2-mkconfig, which refused to run the drive probes, because it couldn't load the zfs module (insmod fails with the kernel on the cd).
I guess the reason was, that I used zfs-fuse of a systemrescuecd. Do you know any boot media with zfsonlinux on it or which one do you use to install?

Setting up the chroot environment is actual straight forward, I still struggle with grub a little.
Also had a lot of compile problems -.- like:
zfs-9999 fails because spl-9999 doesn't build against kernel-3.4.0, grub-9999 fails to build because autopoint fails, which means rebuild gettext, this only builds on the livecd I used with the 'path=' trick etc. etc.

You found my notes on how to do a ZFS install. I plan to turn those into official documentation at some point, but for now, I am waiting until I solve some lingering issues.

Note that overlay is where I develop things that is meant to go into portage in the future, which is why it is not in the official overlay list. You can find bits and pieces of the FreeBSD bootloader port that I am doing. Until the port of FreeBSD's bootloader is in the main tree, people should not touch it. My overlay's sys-fs/zfs and sys-kernel/spl ebuilds are relatively safe. Those ebuilds pull from my GIT forks of the upstream code

disi wrote:

zfs-9999 fails because spl-9999 doesn't build against kernel-3.4.0, grub-9999 fails to build because autopoint fails, which means rebuild gettext, this only builds on the livecd I used with the 'path=' trick etc. etc.

There is a patch floating around that can enable it to build, but it doesn't meet upstream's coding standards. I plan to fix this, but I can't promise it within any particular time frame.

What I just remember, I used a different kernel config than in the vm... are there any kernel configs it needs?

//edit: all right, do not try to have /etc as an extra volume and there must be some kernel option missing in my custom config, genkernel boots now..._________________Gentoo on Uptime Project - Larry is a cow

I suggest to give a working grub.cfg as example. For me, with an extra 100MB boot partition, it looks like this (I assume it needs an insmod or something if you have /boot in the pool?):

Code:

linux /kernel root=ZFS=rpool/ROOT/gentoo

In my kernel config was no support for initramfs So the error was always unknown block and cannot mount root fs, set a proper 'root=' kernel option, this was kind of misleading.

Then it was loading everthing, but came up with no more services left in this runlevel and asking for the Runlevel. This was because I had /etc/ on an extra volume, this could be worked around if we do not set the pool to legacy mountpoint. Anyway I moved the files back onto the root volume and works fine now.

One more thing I noticed, if you do not install anything from upstream before running genkernel for the first time, you are missing the tools to compress the initramfs. They are pulled in when you install e.g. zfs-9999. I went manually into the genkernel.conf and told it to use gzip as method._________________Gentoo on Uptime Project - Larry is a cow

In my kernel config was no support for initramfs So the error was always unknown block and cannot mount root fs, set a proper 'root=' kernel option, this was kind of misleading.

I have committed a check for this. It should be on the mirrors (along with sys-fs/zfs-0.6.0_rc9-r3) soon.

disi wrote:

Then it was loading everthing, but came up with no more services left in this runlevel and asking for the Runlevel. This was because I had /etc/ on an extra volume, this could be worked around if we do not set the pool to legacy mountpoint. Anyway I moved the files back onto the root volume and works fine now.

The system should not be able to boot with /etc on a different mount point because /etc/fstab contains the information needed to mount /etc. ZFS datasets are an exception to this, provided that you do not use mountpoint=legacy.

disi wrote:

IOne more thing I noticed, if you do not install anything from upstream before running genkernel for the first time, you are missing the tools to compress the initramfs. They are pulled in when you install e.g. zfs-9999. I went manually into the genkernel.conf and told it to use gzip as method.

Otherwise it checks for 'best' or 'fastest', checks what is enabled in the kernel, starts with xz and breaks the loop if set to best.
So xz it is as best (default) and lzop is fastest... but here must be something going wrong because compression seems empty if xz-utils is not part of stage3 tarballs (not installed)?

Otherwise it checks for 'best' or 'fastest', checks what is enabled in the kernel, starts with xz and breaks the loop if set to best.
So xz it is as best (default) and lzop is fastest... but here must be something going wrong because compression seems empty if xz-utils is not part of stage3 tarballs (not installed)?

is only true, if I have e.g. '/bin/xz' in the history of bash? So it loops through and compression stays empty...?

Or this is all stupid And I missed something...

This is mostly correct. The only error is your interpretation of ${!cmd_variable_name}. It says to look for a variable that is named the value of cmd_variable_name and take the value of it. As an example, `var=value name=var;echo "${!name}"` will output `value`.

This is a minor issue and I am somewhat inundated with more pressing concerns right now. Would you file a bug report in the Gentoo bug tracker?

This is a minor issue and I am somewhat inundated with more pressing concerns right now. Would you file a bug report in the Gentoo bug tracker?

Already done... did you look into the other thread? I was too drunk yesterday (Germany is out of the cup ) and forgot to check for reloading the module, if possible at all._________________Gentoo on Uptime Project - Larry is a cow

This is a minor issue and I am somewhat inundated with more pressing concerns right now. Would you file a bug report in the Gentoo bug tracker?

Already done... did you look into the other thread? I was too drunk yesterday (Germany is out of the cup ) and forgot to check for reloading the module, if possible at all.

The short answer is that it is not possible to reload the module when using a ZFS rootfs. The long answer is that it is possible to hack something together to use a tmpfs and switch_root/pivot_root to do it. It would be similar to the zfs-shutdown and linuxrc scripts in portage's ./sys-fs/zfs/files directory. I designed those to unmount the rootfs and export its pool at shutdown. In theory, they could be adapted to do what you want, but doing that would be time consuming and many would find it to be challenging.

I think it would be better to focus on implementing the ability to set these options in genkernel. If I were to dedicate an afternoon for it, I would definitely get it working. The only issue is making time. There are literally a few dozen different things on my to do list at the moment, of which this is one of them.

Quite frankly, the best thing would be to modify the kernel code to permit this setting to be changed without having to reload the module. I do not think I will have time to do it this year and I do not know of anyone who does.

On the Gentoo Wiki there is a request for a Gentoo on ZFS article. That would be a good place to get all the relevant documentation in one place. If you guys could get that started, that would be grand... I am available for help on editing / wikifying (among other places in the #gentoo-wiki channel)._________________"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF

Yes this guide is very nice, but one problem is that when I do a genkernel it says "warning no /boot" and i think it fails in the end.

I like this guide, but it sort of confuses me. I want to put this on a empty SATA 500gb, I want to use ZFS ... I want to use the unstable packages, i want to also use grub legacy instead of grub2 and also it would be nice to have a straight forward guide, though i really like this i get sort of a error when like trying to rc-update add zfs boot. but honestly i will give this a try again, is it possible if i have my gentoo system on another hdd which i do, can i use that system to do this zfs installation on my SATA HDD drive which is sdb and my ide 250gb gentoo system is sda .. can i put a zfs installation using my gentoo system . ? its using stable.. can i turn that system to a unstable sysem.. yes i'm not the professional at gentoo since it will be my second time on host.. but this time i want to do it perfect and right and i want to use zfs filesystem really bad.

If you can , give me some tips on what i should do, and how i should do this all correctly, NOTE i do have acknowledgement on setting up gentoo and everything using their official guide i setup gentoo 4 times 3 times in Virtualbox and one time on a acutal host... i'm just sort of stuck at the /boot with genkernel and the rc-update add zfs boot.. other than that its pretty straight forward.

is it possible i can make a /boot before i jump to the genkernel and just mount it ?

I've converted a couple of machines over to running full zfs systems booting via grub2. While the guides pointed to in this thread were helpful, I did do things a bit different. While I'm pretty sure what I did is OK, I thought I'd run it by other's who have been working with this stuff.

The first difference in how I have done things is in using my own custom initrd. I did that since I had been using my own custom lvm script for a while and it was easier for me to modify it than it was to learn a new initrd system. The second difference is in not creating another gpt boot partition. From what I read, the partition 9 that zfs creates when you give it the entire disk is/was probably used by Solaris for booting. Since it was already there and of sufficient size, I simply changed the partition type so that grub would use it. So far, this seems to be working well and I'm hoping that I won't run into trouble at some later time.

Yes this guide is very nice, but one problem is that when I do a genkernel it says "warning no /boot" and i think it fails in the end.

I like this guide, but it sort of confuses me. I want to put this on a empty SATA 500gb, I want to use ZFS ... I want to use the unstable packages, i want to also use grub legacy instead of grub2 and also it would be nice to have a straight forward guide, though i really like this i get sort of a error when like trying to rc-update add zfs boot. but honestly i will give this a try again, is it possible if i have my gentoo system on another hdd which i do, can i use that system to do this zfs installation on my SATA HDD drive which is sdb and my ide 250gb gentoo system is sda .. can i put a zfs installation using my gentoo system . ? its using stable.. can i turn that system to a unstable sysem.. yes i'm not the professional at gentoo since it will be my second time on host.. but this time i want to do it perfect and right and i want to use zfs filesystem really bad.

If you can , give me some tips on what i should do, and how i should do this all correctly, NOTE i do have acknowledgement on setting up gentoo and everything using their official guide i setup gentoo 4 times 3 times in Virtualbox and one time on a acutal host... i'm just sort of stuck at the /boot with genkernel and the rc-update add zfs boot.. other than that its pretty straight forward.

is it possible i can make a /boot before i jump to the genkernel and just mount it ?

all the help would be cool eh,

Thanks.
Tux Hat

I am late to reply here, but I plan to update that soon. Anyway having a separate /boot dataset on ZFS is fine. I am thinking of changing zfs-install to create it.

Raffi wrote:

I've converted a couple of machines over to running full zfs systems booting via grub2. While the guides pointed to in this thread were helpful, I did do things a bit different. While I'm pretty sure what I did is OK, I thought I'd run it by other's who have been working with this stuff.

The first difference in how I have done things is in using my own custom initrd. I did that since I had been using my own custom lvm script for a while and it was easier for me to modify it than it was to learn a new initrd system. The second difference is in not creating another gpt boot partition. From what I read, the partition 9 that zfs creates when you give it the entire disk is/was probably used by Solaris for booting. Since it was already there and of sufficient size, I simply changed the partition type so that grub would use it. So far, this seems to be working well and I'm hoping that I won't run into trouble at some later time.

That will likely be fine. The only potential issue is what will happen if you ever replace the disk with a new one and use autoexpand.