ZFS How to clone/repair ZFS Label for Pool?

Status
Not open for further replies.
Hello,

I am very new to ZFS and have already broken my ZFS pool :(

(This is on a linux system but Im hoping someone from FreeBSD community has experience in the same issue)

This was due to label corruption via improper shutdown on an external USB DAS.
Is it possible to restore the ZFS label from /dev/sda1 or /dev/sdb1 since they seem to be the only valid labels existing for the pool?



Code:
zpool import -d /dev/disk/by-partuuid
  pool: zfspool0
    id: 17328721603664047508
state: UNAVAIL
status: One or more devices contains corrupted data.
action: The pool cannot be imported due to damaged devices or data.
   see: [URL]https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-5E[/URL]
config:

zfspool0                                  UNAVAIL  insufficient replicas
  mirror-0                                UNAVAIL  insufficient replicas
    66382eb7-820e-3d47-9000-d844c1326d13  UNAVAIL  invalid label
    6b1797a8-26e8-5b41-8fec-18f3977607c5  UNAVAIL  invalid label


Code:
root@localhost:~# zdb -l /dev/sda
failed to unpack label 0
failed to unpack label 1
failed to unpack label 2
failed to unpack label 3
root@localhost:~# zdb -l /dev/sda1
------------------------------------
LABEL 0
------------------------------------
    version: 5000
    name: 'zfspool0'
    state: 0
    txg: 29380
    pool_guid: 17328721603664047508
    errata: 0
    hostid: [snip]
    hostname: 'localhost'
    top_guid: 16873280761438265250
    guid: 7788381016733623247
    vdev_children: 1
    vdev_tree:
        type: 'mirror'
        id: 0
        guid: 16873280761438265250
        metaslab_array: 128
        metaslab_shift: 34
        ashift: 12
        asize: 129986248053358592
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7788381016733623247
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            devid: 'usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:0'
            whole_disk: 1
            DTL: 5839
            create_txg: 4
            expansion_time: 1745969724
        children[1]:
            type: 'disk'
            id: 1
            guid: 241061445970378625
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            devid: 'usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:1'
            whole_disk: 1
            DTL: 5838
            create_txg: 4
            expansion_time: 1745969723
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.klarasystems:vdev_zaps_v2
    labels = 0 1
------------------------------------
LABEL 2
------------------------------------
    version: 5000
    name: 'zfspool0'
    state: 0
    txg: 29376
    pool_guid: 17328721603664047508
    errata: 0
    hostid: [snip]
    hostname: 'localhost'
    top_guid: 16873280761438265250
    guid: 7788381016733623247
    vdev_children: 1
    vdev_tree:
        type: 'mirror'
        id: 0
        guid: 16873280761438265250
        metaslab_array: 128
        metaslab_shift: 34
        ashift: 12
        asize: 8001548713984
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7788381016733623247
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            devid: 'usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:0'
            whole_disk: 1
            DTL: 5839
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 241061445970378625
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            devid: 'usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:1'
            whole_disk: 1
            DTL: 5838
            create_txg: 4
            expansion_time: 1745969723
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.klarasystems:vdev_zaps_v2
    labels = 2 3


root@localhost:~# zdb -l /dev/sdb
failed to unpack label 0
failed to unpack label 1
failed to unpack label 2
failed to unpack label 3
root@localhost:~# zdb -l /dev/sdb1
------------------------------------
LABEL 0
------------------------------------
    version: 5000
    name: 'zfspool0'
    state: 0
    txg: 29380
    pool_guid: 17328721603664047508
    errata: 0
    hostid: [snip]
    hostname: 'localhost'
    top_guid: 16873280761438265250
    guid: 241061445970378625
    vdev_children: 1
    vdev_tree:
        type: 'mirror'
        id: 0
        guid: 16873280761438265250
        metaslab_array: 128
        metaslab_shift: 34
        ashift: 12
        asize: 129986248053358592
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7788381016733623247
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            devid: 'usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:0'
            whole_disk: 1
            DTL: 5839
            create_txg: 4
            expansion_time: 1745969724
        children[1]:
            type: 'disk'
            id: 1
            guid: 241061445970378625
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            devid: 'usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:1'
            whole_disk: 1
            DTL: 5838
            create_txg: 4
            expansion_time: 1745969723
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.klarasystems:vdev_zaps_v2
    labels = 0 1
------------------------------------
LABEL 2
------------------------------------
    version: 5000
    name: 'zfspool0'
    state: 0
    txg: 29373
    pool_guid: 17328721603664047508
    errata: 0
    hostid: [snip]
    hostname: 'localhost'
    top_guid: 16873280761438265250
    guid: 241061445970378625
    vdev_children: 1
    vdev_tree:
        type: 'mirror'
        id: 0
        guid: 16873280761438265250
        metaslab_array: 128
        metaslab_shift: 34
        ashift: 12
        asize: 8001548713984
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7788381016733623247
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            devid: 'usb-External_USB3.0_DISK00_20170331000C3-0:0-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:0'
            whole_disk: 1
            DTL: 5839
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 241061445970378625
            path: '/dev/disk/by-id/usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            devid: 'usb-External_USB3.0_DISK01_20170331000C3-0:1-part1'
            phys_path: 'platform-xhci-hcd.1-usb-0:1:1.0-scsi-0:0:0:1'
            whole_disk: 1
            DTL: 5838
            create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.klarasystems:vdev_zaps_v2
    labels = 2 3
root@localhost:~# zdb -l /dev/sdb9
failed to unpack label 0
failed to unpack label 1
failed to unpack label 2
failed to unpack label 3
 
This is on a linux system
Rule #7:
We will not allow technical/support questions about any operating system other than FreeBSD anywhere on this forum. That includes the Off-Topic forum. Always ask technical/support questions about other operating systems on the forums or mailing lists associated with those operating systems.

 
Status
Not open for further replies.
Back
Top