Solved Cannot import mirror into newly installed system

My old box is running FreeBSD 10.1 and has 2 HDD configured as mirror.
On my new box I've installed FreeBSD 13.0 and it has 2 HDD configured as mirror too.

Now I want to copy all my files from old box to a new one. But, when I've attached old disks to my new box and run zpool import I've got an error: The pool cannot be imported due to damaged devices or data (see screenshots below).

In fact, the old system is booting successfully without any errors. Any ideas how to mount my old mirror in my new box?
 

Attachments

  • 20210626_170234.jpg
    20210626_170234.jpg
    1.3 MB · Views: 229
  • 20210626_164443.jpg
    20210626_164443.jpg
    1.4 MB · Views: 167
  • 20210626_163719.jpg
    20210626_163719.jpg
    1.4 MB · Views: 200
What controller did the old system have? Is it possible those were configured as separate RAID0 volumes on a RAID controller that didn't support JBOD?
 
There are no hardware RAID controllers in both boxes. On old system during FreeBSD installation I set "Auto (ZFS) Guided Root-on-ZFS" option and further chose "Mirror - n-Way Mirroring" in ZFS Configuration window.

With command line interface it would be looked something like this one:
zpool create zroot mirror /dev/gpt/disk0 /dev/gpt/disk1

In other words, in my old system I configured ZFS soft RAID1 (Mirror) consisting of 2 hard disks. The same I configured in new box too
 
Rather than moving disks back and forth, and although it may not be elegant, could you not connect both boxes with a network cable and copy all data safely. After that you could look into why you cannot import the mirror.
 
It is a good idea, but unfortunately, my old box has broken. Now, In fact, I set boot device settings in BIOS on my new box to boot from old Mirror or to boot from a new one. That's all I can do now.
 
Compare the output of
Code:
zpool list -v
on the new and old box.
Also try a zpool export before the import.
I did not try to do zpool export on old system before importing pool to a new one. Just now I've leaved that box running with old system and I have only remote access to it. So, on old system (FreeBSD 10.1) zpool list -v returns this (see attached screenshot):
 

Attachments

  • FreeBSD-10.1.jpg
    FreeBSD-10.1.jpg
    75.2 KB · Views: 161
Can someone tell me what will happen if I run zpool export on an old system? Will I be able to boot from old mirrored pool after that?
 
And another my question. Is it safe to import FreeBSD 13.0 mirrored zfs pool into old FreeBSD 10.1 system? T-Daemon's idea looks pretty good, but I'm afraid to take risks, since I don't have a backup. I'm not afraid to break the pool in Freebsd 13, because there is no data in it. But I am concerned about the integrity of the data in the pool with FreeBSD 10.
 
I've run zpool import on old FreeBSD-10.1 system and it says, that I cannot import new pool into old system (see attached screenshot)
 

Attachments

  • FreeBSD-10.1.jpg
    FreeBSD-10.1.jpg
    223.2 KB · Views: 177
Can someone tell me what will happen if I run zpool export on an old system? Will I be able to boot from old mirrored pool after that?
zpool export is similar to "umount" of any other filesystem. It makes sure all data is flushed to device and consistent. Should not hurt anything; you should still be able to boot from it.

FreeBSD-13 is using OpenZFS FreeBSD-10 is using "FreeBSD ZFS" that is partly why you are getting the message "can only be imported in read-only mode".
If your goal is to simply copy from the FreeBSD-10 pool to the FreeBSD-13 pool, I would try booting into the FreeBSD-13, then zpool import -o "readonly=on" It sounds like the mirrors are both bootable so you may want to add altroot=

zpool import -o "readonly=on" -o "altroot=/mnt" tanker
 
zpool export is similar to "umount" of any other filesystem. It makes sure all data is flushed to device and consistent. Should not hurt anything; you should still be able to boot from it.

FreeBSD-13 is using OpenZFS FreeBSD-10 is using "FreeBSD ZFS" that is partly why you are getting the message "can only be imported in read-only mode".
If your goal is to simply copy from the FreeBSD-10 pool to the FreeBSD-13 pool, I would try booting into the FreeBSD-13, then zpool import -o "readonly=on" It sounds like the mirrors are both bootable so you may want to add altroot=

zpool import -o "readonly=on" -o "altroot=/mnt" tanker
Yes, I just need to copy the files from FreeBSD-10.1 to the newly installed FreeBSD-13.0 on new larger hard drives. Indeed, both mirrors are bootable and work without any errors. The only problem I can't solve is that the old pool can't be mounted to the new FreeBSD-13.0 system. Before creating this thread, I tried to boot into FreeBSD-13.0, and then tried to mount the old pool with different options, including read-only. Here what I tried (zmir - is the name of the old pool):
zpool import zmir -f -R /mnt/temp
zpool import zmir -f -R /mnt/temp -m
zpool import zmir -d /dev -o readonly=on -R /mnt/temp

All these attempts did not help me. But I didn't try to export zpool on the old system before mounting it on the new one. And I did not try option "-o altroot=/mnt"
 
  • Like
Reactions: mer
The problem seems to be that the pool you're trying to import has the same name as the existing pool. What does zpool import show? (Don't give it any options).

You're probably going to need to use something like zpool import <ID of oldpool> -f -R /mnt/temp zmir_old

NB. Please just copy/paste the text. Don't post pictures of text, they're impossible to quote from.
 
The problem seems to be that the pool you're trying to import has the same name as the existing pool. What does zpool import show? (Don't give it any options).

You're probably going to need to use something like zpool import <ID of oldpool> -f -R /mnt/temp zmir_old

NB. Please just copy/paste the text. Don't post pictures of text, they're impossible to quote from.
To avoid conflicts of the same naming when installing a new system, I chose a different name. Now the old pool has the name "zmir", and the new one has the name "tanker".
 
But I didn't try to export zpool on the old system before mounting it on the new one. And I did not try option "-o altroot=/mnt"

I don't think that will work based on what you said in your first post:
But, when I've attached old disks to my new box and run zpool import I've got an error: The pool cannot be imported due to damaged devices or data

If a recursive snapshot of old mirror saved on a external drive (i.e. USB) and received on new mirror is not an option, if there are no backups, and to take not any risks, I would dd(1) one of the old mirror disks into an .img file on 13.0, install emulators/virtualbox-ose (or emulators/virtualbox-ose-nox11), convert .img with VirtualBox into a .vdi disk image, create VM, attach image to VM. I've tested on my system with a small one disk 13.0 ZFS installation, it boots fine in the VM.

Even if it's in a degraded state being only one disk of a mirror, the image should boot. You could then retrieve the data from the 10.1 VM guest to the 13.0 host. If you wish you can proceed the same with the second old mirror disk and create a mirror in the VM.

It's possible to create a VirtualBox rawdisk directly from a physical disk without dd'ing, but to exclude any risks (there are no backups) I didn't suggested it.
 
Wow, this is a very impressive idea!!! ? I definitely wouldn't have thought of such a thing. Your comment gave me the idea to connect an empty disk to the old system, copy all the important files to it, and then connect this disk to the new system and copy the files from it to the new system. It seems to be a little easier way for me
 
If on the empty disk you put an ufs filesystem you will not run into zfs differences when moving the disk between the two systems.
Otherwise it's best to create a zpool on the system with the older O.S. Compatiblilty always goes backword never forward.
 
You could even do the following procedure.
Put the disk in the old system. Make a zpool the size halve of the disk on the old system transfer the files to this zpool.
Put the disk in the new system, make a zpool the other half of the disk.
Move the files from the old zpool to the new zpool on the same disk.
Remove the old zpool. Make a new in place.
The disk now contains two "newer" zpools.
Attach the latest created zdev to to former one , so these two together make up 1 newer zpool total size the full disk.
 
An interesting idea, I will keep it in mind as plan B. At the moment, copying files using an external UFS disk looks preferable to me
 
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.
 
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.
That could be sysctl settings that control GEOM withering. sysctl -a | grep geom | grep label
I think kern.geom.label.disk_ident.enable, kern.geom.label.gptid.enable and kern.geom.label.gpt.enable would be the big ones.
 
Is it possible, that the disks themselves are in the zpool instead of a/the partition?
I remember having something similiar while setting up the Fileserver in my skydiving-club, the OS always complaining the disk is corrupted, until i noticed that i've built the zpool on the disk, not the partition
 
Back
Top