# Importing BE from another system



## abishai (Jan 4, 2018)

I try to import boot environment from one laptop to another.
Source is FreeBSD 11-STABLE, destination is 11.1-RELEASE. 

1. On the donor: `zfs send zroot/ROOT/stable@trn |gzip > /tmp/backup.gz`
2. On recipient: `gzcat /tmp/backup.gz |zfs recv -uv zroot/ROOT/stable`
3. `beadm activate stable`

On reboot, system can't mount root


```
Mounting from zfs:zroot/ROOT/stable failed with error 6.

Loader variables:
  vfs.root.mountfrom=zfs:zroot/ROOT/stable
```

I know, that formally, STABLE is unsupported, but error 6 is ENXIO (device not found), that's very strange error.

I rebooted to my old BE and mounted/checked zroot/ROOT/stable. Everything seems to be in place, zfs options are the same as well. I have 'fat' BEs, that shares another pool for /home.


```
zroot               30,5G   273M    96K  none
zroot/ROOT          30,5G   273M    96K  none
zroot/ROOT/default  18,0G   273M  16,8G  /
zroot/ROOT/stable   12,2G   273M  12,2G  /mnt
zroot/ROOT/temp      342M   273M   342M  /
zroot/tmp             96K   273M    96K  /tmp
```


```
abishai@moonstar:~ % zfs get all zroot/ROOT/stable |grep local
zroot/ROOT/stable  mountpoint            /mnt                        local
zroot/ROOT/stable  canmount              noauto                      local
```

Obviously,  / was set initially, I changed it to /mnt for investigation.


```
abishai@moonstar:~ % zpool get all zroot| grep local
zroot  bootfs                         zroot/ROOT/stable              local
zroot  feature@async_destroy          enabled                        local
zroot  feature@empty_bpobj            active                         local
zroot  feature@lz4_compress           active                         local
zroot  feature@multi_vdev_crash_dump  enabled                        local
zroot  feature@spacemap_histogram     active                         local
zroot  feature@enabled_txg            active                         local
zroot  feature@hole_birth             active                         local
zroot  feature@extensible_dataset     enabled                        local
zroot  feature@embedded_data          active                         local
zroot  feature@bookmarks              enabled                        local
zroot  feature@filesystem_limits      enabled                        local
zroot  feature@large_blocks           enabled                        local
zroot  feature@sha512                 enabled                        local
zroot  feature@skein                  enabled                        local
```

I think I'm missing something easy.


----------



## SirDice (Jan 4, 2018)

abishai said:


> I know, that formally, STABLE is unsupported


Contrary to -CURRENT, -STABLE is supported. As long as it's a recent -STABLE from a _supported_ major branch (10-STABLE and 11-STABLE at this time).


----------



## abishai (Jan 4, 2018)

Looks like the problem is boot environment content, not import mistake. I'm able to boot with vanilla kernel, not with custom one I have for laptop. I repeated the issue with kernel recompile.
My config is 

```
include GENERIC
ident ECHIDNA

nooptions INET6

device evdev
options EVDEV_SUPPORT
```
How can this lead to error 6 ?!


----------



## ShelLuser (Jan 4, 2018)

This is just a guess, but considering the big difference in size between zroot/ROOT/default and zroot/ROOT/stable I'd start by checking the exact differences between those two environment. Because that difference in size wasn't caused by merely using a different kernel, which leads me to believe that your new environment might be missing some important system files.


----------



## abishai (Jan 4, 2018)

Difference is OK, initial /home import archive left and forgotten on root. I can boot imported root after I put vanilla kernel into /boot/kernel and I'm sure that ECHIDNA kernel made with the config above, so If it's not FreeBSD dislikes Grecian myths, INET6 becomes mandatory or evdev becomes buggy. Laptop is not very fast compiling guy, so it will take a while to check whats wrong. My bet is for INET6, it runs deeper.


----------

