Import a ZFS pool in a logical partition?

Good evening,
I have 15.0 installed on a Pi 4B which uses USB to connect SSDs. On the second SSD (e.g. not the boot/system device) I have what was originally a Debian install with two pools in logical partitions. (Wasn't really my choice, but this was a throw away test system and I didn't really care when I told the installer to use the entire disk.)

If possible I'd like to import the pools on the Pi running FreeBSD but it seems like the logical partitions are not seen.


Code:
root@vulcan:~ # gpart show /dev/da1
=>        63  1953525105  da1  MBR  (932G)
          63        1985       - free -  (993K)
        2048    58591232    1  linux-data  [active]  (28G)
    58593280        2046       - free -  (1.0M)
    58595326  1894928386    2  ebr  (904G)
  1953523712        1456       - free -  (728K)

root@vulcan:~ #

Is there any option to get this to work?

Thanks!
 
Thanks both for the replies. And yes, zpool import does not list any pools nor can I import by helping it to find the pool.

Code:
root@vulcan:~ # ls /dev/da1s?
/dev/da1s1      /dev/da1s2
root@vulcan:~ # gpart show da1s2
gpart: No such geom: da1s2.
root@vulcan:~ #
root@vulcan:~ # zpool import -d /dev/da1s1
no pools available to import
root@vulcan:~ #
root@vulcan:~ # ls -l /dev/da1*
crw-r-----  1 root operator 0x99 Jan 30 15:07 /dev/da1
crw-r-----  1 root operator 0x9a Jan 30 15:07 /dev/da1s1
crw-r-----  1 root operator 0x9b Jan 30 15:07 /dev/da1s2
root@vulcan:~ #

That's interesting. It seems that the kernel does not recognize the extended partitions and only sees the primary partitions.

It's not a big issue. I don't need the data in the partitions. I just thought I could save some time by reusing the pools and I wondered if I had overlooked something. I can repartition the drive and recreate the pools.

best,

Edit: zpool import -d /dev/da1s1 does not point to the partition that holds the pool. That would be /dev/da1s6 and that is not apparently found by the kernel.
 
Code:
[root@hp14 ~]# gpart create -s ebr md0s2
md0s2 created
[root@hp14 ~]# gpart add -t freebsd -s 10m md0s2
md0s2+00000001 added
[root@hp14 ~]# gpart show md0s2
=>    0  40960  md0s2  EBR  (20M)
      0  20475      1  freebsd  (10M)
  20475  20485         - free -  (10M)
if you have "logical partitions" as in logical drives in msdos speak they should/used to be diskNs5 diskNs6 in freebsd
looks like it is no longer the case (haven't dealt with extended partitions in a while
 
try gpart show da0s2
Code:
root@vulcan:~ # gpart show da0
=>       63  234441585  da0  MBR  (112G)
         63       1985       - free -  (993K)
       2048     102400    1  fat32lba  [active]  (50M)
     104448  234337200    2  freebsd  (112G)

root@vulcan:~ #  gpart show da0s2
=>        0  234337200  da0s2  BSD  (112G)
          0        128         - free -  (64K)
        128  218302336      1  freebsd-ufs  (104G)
  218302464   16031744      2  freebsd-swap  (7.6G)
  234334208       2992         - free -  (1.5M)

root@vulcan:~ #

At this point that tells me nothing, but perhaps meaningful to you? That's my system disk and is entirely allocated to FreeBSD:

Code:
root@vulcan:~ # geom disk list da0
Geom name: da0
Providers:
1. Name: da0
   Mediasize: 120034123776 (112G)
   Sectorsize: 512
   Mode: r3w3e10
   descr: KINGSTON SA400S37120G
   lunid: 5000000000000001
   ident: 0420041516E9
   rotationrate: 0
   fwsectors: 63
   fwheads: 255

root@vulcan:~ #
 
You've got enough free space at the beginning and the end of the disk da1 to write a GPT partition table to it with entries for the existing partitions. You just need to obtain information about the partitions from Linux: the start sector numbers relative to the start of the disk and the sizes in sectors.



It seems that options GEOM_PART_EBR is not included by default in arm64 kernels. It provides support for logical partitions. Maybe loading the kernel module geom_part_ebr.ko will enable gpart to see those partitions.
 
Back
Top