# "gptzfsboot: No ZFS pools located, can't boot." - What am I doing wrong?



## Mr_Dragon (Dec 8, 2018)

I'm trying to do geli-encrypted FreeBSD dual-boot with Debian on legacy BIOS. My partition scheme is:

/dev/ada0 (gpt)
/dev/ada0p1 (bios boot)
/dev/ada0p2 (linux filesystem)
/dev/ada0p3 (linux filesystem)
/dev/ada0p4 (freebsd boot)
/dev/ada0p5 (freebsd swap)
/dev/ada0p6 (freebsd zfs)

I've followed these instructions (link: https://wiki.freebsd.org/MasonLoringBliss/LegacyZFSandGELI) but unfortunately, I've got the following error during booting system: "gptzfsboot: No ZFS pools located, can't boot."

The output from `gpart backup ada0` is:

```
GPT 8184
1 bios-boot      2048            2048
2 linux-data     4096            497664
3 linux-data     501760          2776629248
4 freebsd-boot   2777131008      256              boot0
5 freebsd-swap   2777133056      16777216         swap0
6 freebsd-zfs    2793910272      3066619904       tank0
```
[FONT=Arial]And from `zpool import`:[/FONT]

```
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present; to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
    pool: tank
      id: 13125465944866070244
   state: ONLINE
  action: The pool can be imported using its name or numeric identifier.
  config:

           tank         ONLINE
           ada0p6.eli   ONLINE
```

[FONT=Arial]The output from `geli list`:[/FONT]

```
Geom name: ada0p6.eli
State: ACTIVE
EncryptionAlgorithm: AES-XTS
KeyLength: 256
Crypto: software
Version: 7
UsedKey: 0
Flags: BOOT, GELIBOOT
KeysAllocated: 366
KeysTotal: 366
Providers:
1. Name: ada0p6.eli
   Mediasize: 1570109386752 (1.4T)
   Sectorsize: 4096
   Mode: r0w0e0
Consumers:
1. Name: ada0p6
   Mediasize: 1570109390848
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
```

What am I doing wrong?


----------



## D-FENS (Jan 6, 2019)

Hi, I had a similar problem and I have just found a solution. To be able to boot from an encrypted ZFS pool there are several prerequisites.

1. You must have a freebsd-boot partition of size <0.5M, where the boot code is installed. From this link: https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot
When formatting your boot drive, assuming it's called da0 and the freebsd-boot partition is with number 1:

```
gpart add -a 4k -s 512K -t freebsd-boot da0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
```

2. When encrypting your BOOT partition (in my case it's boot AND root together), you need to set a GELI flag that the partition contains an encrypted bootable pool. After geli init and attach:

```
geli configure -g da0p2
```
My encrypted boot/root pool is on da0p2.

This is from the geli() man page:

```
-g        Enable booting from this encrypted root
                filesystem.  The boot loader prompts for the
                passphrase and loads loader(8) from the
                encrypted partition.
```

3. Your ZFS pool must have the "bootfs" property set to the name of the ZFS dataset you want to boot from. In my case it's "zroot/ROOT/default", it should map to a ZFS dataset containing /boot directory with loader etc.

I wish you good luck.


----------

