Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a FreeBSD fileserver configured with one ZFS pool created from whole disk devices. That is, the pool was created like this:

zpool create pool0 raidz ada0 ada1 ada2

This means the disks have ZFS disklabels, rather than FreeBSD disk labels. This is the recommended way of using disks with ZFS:

ZFS can use individual slices or partitions, though the recommended mode of operation is to use whole disks. [ from zpool(1M)]

Formatting the disks like this maximizes the portability of the filesystem between various ZFS implementations. Unfortunately, it means there's nowhere to put a freebsd-boot partition containing the FreeBSD loader...or at least, I think that's what it means, but I'm looking for confirmation.

The system currently boots from a CF card containing the embedded loader (as well as the /boot directory, although this could live in ZFS just fine). This works just fine, but Im curious -- is there any way to install the embedded loader onto the ZFS-labelled disks?

EDIT: I've been trying to answer this myself. I thought maybe I could apply a GPT label non-destructively to the ZFS disks, and then try embedding the boot code -- but while the GPT label didn't cause a problem with ZFS, ZFS seems to tromp on the label somehow. So here's a different question: does OpenSolaris support GPT disk labels? The ultimate goal here is to have a disk pool that will work under both FreeBSD and OpenSolaris while being able to boot from it into FreeBSD.

share|improve this question
    
What version are you running. I know 8.1 and prior can not boot from ZFS without fairly extensive hacking. I can't remember off the top of my head if 8.2 has boot support; I believe 9-Current does and I know it will be backported to either 8.2 or 8.3. –  Chris S Jan 28 '11 at 14:32
    
Booting from ZFS is relatively easy (that's what I meant when I said that /boot can reside on ZFS without a problem). I just need somewhere to the gptzfsboot code, which right now is on a freebsd-boot partition on a CF card. –  larsks Jan 28 '11 at 17:24

1 Answer 1

up vote 2 down vote accepted

Well, it's looking like the answer is, "you can't do that".

The rest of this answer is for anybody who happens to come across this entry and is curious about how this is set up:

I have my boot code on a CF card, and everything else (aka, the /boot directory) on ZFS. The CF card is partitioned like this:

# gpart show ad0
=>     34  7847213  ad0  GPT  (3.7G)
       34      128    1  freebsd-boot  (64K)
      162  7847085       - free -  (3.7G)

I installed the boot code like this:

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad0

And set the appropriate bootfs property on my ZFS pool:

zpool set bootfs=pool0/sys/freebsd pool0

Where pool0/sys/freebsd is my FreeBSD root filesystem (and contains, among other things, the /boot directory).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.