Solved Cannot import mirror into newly installed system

It's strange that on your old system, the mirror disks are referred to as gpt/disk0 and gpt/disk1, but on the new system they're called ada1p2 and ada0p2. I'd investigate that, but I don't have an idea what went wrong.
My first FreeBSD with ZFS was version 9.0 about 8-9 years ago. In those times I used shell script to install FreeBSD from CD. That script contained something like this:
# for disk0
gpart create -s GPT ada0
gpart add -b 34 -s 64k -t freebsd-boot ada0
gpart add -t freebsd-zfs -l disk0 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1ada0
# for disk1
gpart create -s GPT ada1
gpart add -b 34 -s 64k -t freebsd-boot ada1
gpart add -t freebsd-zfs -l disk1 ada1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1


As you can see, the script contains commands for creating labels for disks. After FreeBSD 9.0, I updated the system to version 10.1 several times. It seems that this is why in FreeBSD 10.1 mirror disks are called gpt/disk0 and gpt/disk1 instead of ada0p2 and ada1p2
 
Gumlokt yep, and when you created the mirror you used /dev/gpt/disk0|disk1 I'm guessing.
On your FreeBSD 13 system what is the value of sysctl kern.geom.label.gpt.enable? If it's 0, then the gpart labels get "geom withered" and aren't available.
By default the installer uses partions not labels.

I'm wondering if on the FreeBSD13 boot, check that sysctl, if it's 0 set it to 1. Then maybe it'll "just work?"

Edit:
if you created the mirror using /dev/gpt/disk0|disk1 there was probably still a reference somewhere with ada0p2 and ada1p2. If the drives are not physcially in that position anymore (dmesg would show) that may be why it thinks it's damaged and can't be imported.
Just a speculation on my part.
 
mer , on my FreeBSD 13 system both kern.geom.label.gptid.enable and kern.geom.label.gpt.enable are set to 1. Thus, these settings do not affect the zpool import command.
 
  • Thanks
Reactions: mer
Trying to export a working mirror on my old FreeBSD 10 returns this error: cannot unmount '/var/log': Device busy. And this is the reason why I couldn't import it into the new system. In the end, I solved the problem by connecting an empty hard drive to the old system. I created a pool from this hard drive on the old system, copied all the files to it and exported the pool. And then I managed to successfully import the pool into the new FreeBSD 13 system.
 
  • Like
Reactions: mer
Perhaps it was necessary to try to export the pool in the old system in single user mode. But I didn't try it. And now I only have remote access to the computer and will not be able to check it in the near future.
 
Back
Top