Solved No such geom after zpool import

For many reasons I've a Linux system installed on a SD card with a ZFS pool created with ZoL. Now, I want remove the SD card and install FreeBSD into the existing pool. So, I have this configuration (copied on a Virtualbox VM used for testing and listed via livecd):
Code:
root@:~ # gpart show
=>      63  16777153  ada0  MBR  (8.0G)
        63      1985        - free -  (993K)
      2048   1024000     1  linux-data  [active]  (500M)
   1026048  15751168     2  linux-lvm  (7.5G)

=>      34  41942973  ada1  GPT  (20G)
        34      2014        - free -  (1.0M)
      2048      1024     1  freebsd-boot  (512K)
      3072      1024        - free -  (512K)
      4096   2097152     2  freebsd-swap  (1.0G)
   2101248  39841759     3  freebsd-zfs  (19G)

=>      34  41942973  ada2  GPT  (20G)
        34      2014        - free -  (1.0M)
      2048      1024     1  freebsd-boot  (512K)
      3072      1024        - free -  (512K)
      4096   2097152     2  freebsd-swap  (1.0G)
   2101248  39841759     3  freebsd-zfs  (19G)

=>      34  41942973  ada3  GPT  (20G)
        34      2014        - free -  (1.0M)
      2048      1024     1  freebsd-boot  (512K)
      3072      1024        - free -  (512K)
      4096   2097152     2  freebsd-swap  (1.0G)
   2101248  39841759     3  freebsd-zfs  (19G)

=>      63  16777153  diskid/DISK-VB091bbdc6-467901fc  MBR  (8.0G)
        63      1985                                   - free -  (993K)
      2048   1024000                                1  linux-data  [active]  (500M)
   1026048  15751168                                2  linux-lvm  (7.5G)

=>      34  41942973  diskid/DISK-VBf3b0bc3c-1f6bc489  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  ada4  GPT  (20G)
        34      2014        - free -  (1.0M)
      2048      1024     1  freebsd-boot  (512K)
      3072      1024        - free -  (512K)
      4096   2097152     2  freebsd-swap  (1.0G)
   2101248  39841759     3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB85a3f207-7e78069d  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB0f5c4ac9-88d944c2  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB3e293846-83cea468  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

root@:~ #

Partitions are created from Linux gdisk utility. When I import the pool, I've this result:
Code:
root@:~ # zpool import -R /mnt -f zroot
root@:~ # gpart show
=>      63  16777153  ada0  MBR  (8.0G)
        63      1985        - free -  (993K)
      2048   1024000     1  linux-data  [active]  (500M)
   1026048  15751168     2  linux-lvm  (7.5G)

=>      63  16777153  diskid/DISK-VB091bbdc6-467901fc  MBR  (8.0G)
        63      1985                                   - free -  (993K)
      2048   1024000                                1  linux-data  [active]  (500M)
   1026048  15751168                                2  linux-lvm  (7.5G)

=>      34  41942973  diskid/DISK-VBf3b0bc3c-1f6bc489  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB85a3f207-7e78069d  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB0f5c4ac9-88d944c2  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

=>      34  41942973  diskid/DISK-VB3e293846-83cea468  GPT  (20G)
        34      2014                                   - free -  (1.0M)
      2048      1024                                1  freebsd-boot  (512K)
      3072      1024                                   - free -  (512K)
      4096   2097152                                2  freebsd-swap  (1.0G)
   2101248  39841759                                3  freebsd-zfs  (19G)

root@:~ #

As noticed, gpart cannot view ada disks, but onlly diskid. If I try a gpart show ada1 system return the error gpart: No such geom: ada1. but a ls shows all disks:
Code:
root@:~ # ls -l /dev/ada*
crw-r-----  1 root  operator  0x4e Dec  4 13:46 /dev/ada0
crw-r-----  1 root  operator  0x52 Dec  4 13:46 /dev/ada0s1
crw-r-----  1 root  operator  0x54 Dec  4 13:46 /dev/ada0s2
crw-r-----  1 root  operator  0x56 Dec  4 13:46 /dev/ada1
crw-r-----  1 root  operator  0x58 Dec  4 13:46 /dev/ada2
crw-r-----  1 root  operator  0x5a Dec  4 13:46 /dev/ada3
crw-r-----  1 root  operator  0x5c Dec  4 13:46 /dev/ada4
root@:~ #
How I solve this? Only workaround I've founded is to remove a disk from the pool and I repartition with gpart, but is too expensive and I prefer to find another solution. For the test, I've used FreeBSD 10.2 Livecd
 
Hmm, I do remember something about devices not being visible if you access the same device via another node. (For example gpt label entries (/dev/gpt/*) would disappear if you opened the associated raw device). I didn't think it affected the actual ada entries though...

You could try exporting the pool, then booting up with disk_ident labels disabled. You shouldn't get any /dev/diskid entries then so hopefully ZFS will use the adaXpY entries instead.

/boot/loader.conf
Code:
kern.geom.label.disk_ident.enable="0"
 
What's the output zpool status zroot after importing the pool?
This is the output of a zpool import before import:
Code:
root@:~ # zpool import
   pool: zroot
     id: 3533126322304859631
  state: ONLINE
 status: Some supported features are not enabled on the pool.
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        zroot                                  ONLINE
          raidz1-0                             ONLINE
            diskid/DISK-VBf3b0bc3c-1f6bc489p3  ONLINE
            diskid/DISK-VB85a3f207-7e78069dp3  ONLINE
            diskid/DISK-VB0f5c4ac9-88d944c2p3  ONLINE
            diskid/DISK-VB3e293846-83cea468p3  ONLINE
root@:~ #
And this is the output of a zpool status zroot after the import:
Code:
root@:~ # zpool status zroot
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: none requested
config:

        NAME                                   STATE     READ WRITE CKSUM
        zroot                                  ONLINE       0     0     0
          raidz1-0                             ONLINE       0     0     0
            diskid/DISK-VBf3b0bc3c-1f6bc489p3  ONLINE       0     0     0
            diskid/DISK-VB85a3f207-7e78069dp3  ONLINE       0     0     0
            diskid/DISK-VB0f5c4ac9-88d944c2p3  ONLINE       0     0     0
            diskid/DISK-VB3e293846-83cea468p3  ONLINE       0     0     0

errors: No known data errors
root@:~ #
 
Hmm, I do remember something about devices not being visible if you access the same device via another node. (For example gpt label entries (/dev/gpt/*) would disappear if you opened the associated raw device). I didn't think it affected the actual ada entries though...

You could try exporting the pool, then booting up with disk_ident labels disabled. You shouldn't get any /dev/diskid entries then so hopefully ZFS will use the adaXpY entries instead.

/boot/loader.conf
Code:
kern.geom.label.disk_ident.enable="0"
Thank you, but this problem is present first in the livecd, so, I haven't already installed the system. I can ty to use the /dev/diskid, but I don't think is a good solution...
 
I found a solution. Since in my configuration the ada entries are needed only for creating gmirror devices (for boot and swap), I've solved creating mirrors before import the zpool. After terminated the installation, I've booted in the new os and I've repartitioned (and relabeled) all disks
 
Back
Top