4

I'm trying to install Ubuntu with a native ZFS root filesystem on top of an encrypted partition. The device setup is as follows:

  • The physical disk is partitioned into a small boot partition and the rest.
  • The rest of the disk is entirely encrypted and carved up into a /swap and a /root partition for the actual system.
  • The ZFS pool created on that root partition with a couple of ZFS filesystems for things like /home.

These are the two principal guides I've been following:

It's all working fine except for the final step -- the installation of grub. update-grub says (inside the chroot)

error: cannot find a device for / (is /dev mounted?)

/dev is mounted and I followed the additional advice in the second guide for setting up /etc/default/grub and so on.

I can't seem to get grub to recognise the device and grub.cfg and menu.lst are not being created. Are there any steps I might have missed? All of this is running inside VirtualBox if that's relevant.

In particular I'm wondering what the correct grub command-line would be to boot this system.

1

2 Answers 2

1

Grub 1.99 (shipped with Ubuntu) doesn't support encrypted zfs, which is why update-grub is failing.

So your options are:

  1. Install grub 2.00 (which does support encrypted zfs).
  2. Write your grub.cfg manually rather than using update-grub.

Both of these options deviate significantly from Ubuntu defaults, but still much less so than using encrypted ZFS for your root FS in the first place :)

For #1 you'll need to compile grub 2.00 from source, as I'm not aware of any grub 2.00 packages for Ubuntu.

For #2 you'll need to dpkg-divert update-grub and replace it with a symlink to /bin/true then write your grub.cfg by hand (updating it whenever you get a kernel upgrade).

If you need to more specifics on how to do either option I'd be glad to expand on that.

5
  • The zfs-supporting grub is provided by a ppa (mentioned in the first guide). I've tried ZFS without encryption (i.e. following just the first guide) and that works fine. The problem is really just that I don't know the combination of grub commandline options and initrd configuration to make the combination of encryption + zfs succeed. Aug 14, 2012 at 8:02
  • That PPA includes grub with ZFS support, not with encrypted ZFS support. For encrypted ZFS you need grub 2.00. Aug 20, 2012 at 4:28
  • Ahh, I see. I'll give that a try. Aug 20, 2012 at 8:15
  • I've tried compiling grub 2.00 from source but the machine froze up while I did that. I might give it another go later, but this definitely doesn't inspire me with confidence. I'll probably just wait until ZFS on linux is more stable. Aug 21, 2012 at 8:01
  • I've tried with Ubuntu 12.10 which comes with grub 2.00, but that didn't work either -- same error as before. Apparently there are some changes about to be made to the zfs-related packages though, so it might work in a while. Oct 29, 2012 at 11:03
0

You may need to bind the LVM root. Exit the chroot, and type:

sudo mount --bind /dev /mnt/root/dev

Then chroot back in, and see if the ZFS-grub update works.

5
  • I did this. It's in the first guide I linked to. Aug 10, 2012 at 8:06
  • But did you bind your physical root and not the ZFS root?
    – ish
    Aug 11, 2012 at 1:01
  • Yes. Exactly as you said, before entering the chroot. Aug 11, 2012 at 11:13
  • This step what does it give you: 6.1 Verify that the ZFS root filesystem is recognized by GRUB: # grub-probe / zfs
    – LnxSlck
    Aug 13, 2012 at 15:51
  • It gives me the same error about not being able to find a device. Aug 15, 2012 at 13:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .