# Problem with boot - no bootable device found



## VDR (Dec 17, 2020)

Hi, I have vm Proxmox freebsd with ZFS Geli encrypted partition (the whole encrypted by freebsd installer). 

When start the vm I have got: 






So I boot from CD and use live CD and do:

geli attach /dev/ada0p3
enter password and got a /dev/ada0p3.eli device. 

zpool import said zroot is Online, ada0p3.eli is Online 

so: 

mkdir /tmp/vdr
zpool import -f -R /tmp/vdr zroot

zfs mount zroot/ROOT/default 

and got all files at /mnt/vdr

How can I restore booloader or boot system from my zfs encrypted partition ?

When I run bootloader from CD - I see zfs:zroot device.





I will try set currdev etc but without success :/


----------



## VDR (Dec 20, 2020)

Nobody wrote but I resolve my problem 

I found that:

```
root@pve-radom:~# fdisk -l /dev/zfs-pool/vm-100-disk-0
Disk /dev/zfs-pool/vm-100-disk-0: 300 GiB, 322122547200 bytes, 629145600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 8192 bytes
I/O size (minimum/optimal): 8192 bytes / 8192 bytes
root@pve-radom:~#

root@pve-radom:~# gdisk /dev/zfs-pool/vm-100-disk-0
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with corrupt MBR; using GPT and will write new
protective MBR on save.

Command (? for help):

So press w and voila.

root@pve-radom:~# fdisk -l /dev/zfs-pool/vm-100-disk-0
Disk /dev/zfs-pool/vm-100-disk-0: 300 GiB, 322122547200 bytes, 629145600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 8192 bytes
I/O size (minimum/optimal): 8192 bytes / 8192 bytes
Disklabel type: gpt
Disk identifier: 844485A0-1E75-11E9-83D4-6D3C42FC25D1

Device                          Start       End   Sectors  Size Type
/dev/zfs-pool/vm-100-disk-0p1      40      1063      1024  512K FreeBSD boot
/dev/zfs-pool/vm-100-disk-0p2    2048   4196351   4194304    2G FreeBSD swap
/dev/zfs-pool/vm-100-disk-0p3 4196352 629143551 624947200  298G FreeBSD ZFS

Partition 1 does not start on physical sector boundary.
root@pve-radom:~#
```
Next boot from CD Live to recover bootcode. Because it's a ZFS GPT BIOS partition I've done:
`gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0`

and my machine boot properly after restart. 
Solved.


----------

