Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"zpool create" does not create gpt or any other kind of partition table on hp smartarray CCISS drives #3478

Closed
mailinglists35 opened this issue Jun 7, 2015 · 4 comments

Comments

@mailinglists35
Copy link

in fact, i don't even know what the !&#%!&#%!&#! it creates, as no partition tool is able to decode what's on that drive, except "zdb -l" and "zpool import"

take a clean drive with first and last 8MiB wiped (i previously ran several other creation/deletes so I wiped the beginning and the end of the drive)

additionally, the pool won't import after export unless I provide the -d path to dev disks by id even if /etc/default/zfs explicitely says USE_DISK_BY_ID='yes'

root@voyage:/tmp# ls /dev/disk/by-id/cciss-3600508b100104539535645303747000a
/dev/disk/by-id/cciss-3600508b100104539535645303747000a

root@voyage:/tmp# parted /dev/disk/by-id/cciss-3600508b100104539535645303747000a p
Error: /dev/cciss/c0d2: unrecognised disk label
Model: Compaq Smart Array (cpqarray)
Disk /dev/cciss/c0d2: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

root@voyage:/tmp# sgdisk -p /dev/disk/by-id/cciss-3600508b100104539535645303747000a
Creating new GPT entries.
Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 976707632 sectors, 465.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 60816642-8D96-4001-B30C-2DC697272398
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976707598
Partitions will be aligned on 2048-sector boundaries
Total free space is 976707565 sectors (465.7 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name

root@voyage:/tmp# sfdisk -d /dev/disk/by-id/cciss-3600508b100104539535645303747000a

root@voyage:/tmp# sfdisk -l /dev/disk/by-id/cciss-3600508b100104539535645303747000a

Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 119694 cylinders, 255 heads, 32 sectors/track
root@voyage:/tmp# fdisk -l /dev/disk/by-id/cciss-3600508b100104539535645303747000a

Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 465.7 GiB, 500074307584 bytes, 976707632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

root@voyage:/tmp# zpool create test /dev/disk/by-id/cciss-3600508b100104539535645303747000a

root@voyage:/tmp# zpool export test

root@voyage:/tmp# fdisk -l /dev/disk/by-id/cciss-3600508b100104539535645303747000a

Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 465.7 GiB, 500074307584 bytes, 976707632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

root@voyage:/tmp# sfdisk -l /dev/disk/by-id/cciss-3600508b100104539535645303747000a

Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 119694 cylinders, 255 heads, 32 sectors/track

root@voyage:/tmp# sfdisk -d /dev/disk/by-id/cciss-3600508b100104539535645303747000a

root@voyage:/tmp# sgdisk -p /dev/disk/by-id/cciss-3600508b100104539535645303747000a
Creating new GPT entries.
Disk /dev/disk/by-id/cciss-3600508b100104539535645303747000a: 976707632 sectors, 465.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9631EAB7-A4CF-41C6-9462-F38450EC4C65
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976707598
Partitions will be aligned on 2048-sector boundaries
Total free space is 976707565 sectors (465.7 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name

root@voyage:/tmp# parted /dev/disk/by-id/cciss-3600508b100104539535645303747000a p
Error: /dev/cciss/c0d2: unrecognised disk label
Model: Compaq Smart Array (cpqarray)
Disk /dev/cciss/c0d2: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

root@voyage:/tmp# disktype /dev/disk/by-id/cciss-3600508b100104539535645303747000a

--- /dev/disk/by-id/cciss-3600508b100104539535645303747000a
Block device, size 465.7 GiB (500074307584 bytes)

root@voyage:/tmp# zdb -l /dev/disk/by-id/cciss-3600508b100104539535645303747000a
--------------------------------------------
LABEL 0
--------------------------------------------
    version: 5000
    name: 'test'
    state: 1
    txg: 9
    pool_guid: 4754816708306918549
    errata: 0
    hostname: 'voyage'
    top_guid: 9277063563828554439
    guid: 9277063563828554439
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 9277063563828554439
        path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000a'
        whole_disk: 0
        metaslab_array: 34
        metaslab_shift: 32
        ashift: 9
        asize: 500069564416
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 1
--------------------------------------------
    version: 5000
    name: 'test'
    state: 1
    txg: 9
    pool_guid: 4754816708306918549
    errata: 0
    hostname: 'voyage'
    top_guid: 9277063563828554439
    guid: 9277063563828554439
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 9277063563828554439
        path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000a'
        whole_disk: 0
        metaslab_array: 34
        metaslab_shift: 32
        ashift: 9
        asize: 500069564416
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 2
--------------------------------------------
    version: 5000
    name: 'test'
    state: 1
    txg: 9
    pool_guid: 4754816708306918549
    errata: 0
    hostname: 'voyage'
    top_guid: 9277063563828554439
    guid: 9277063563828554439
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 9277063563828554439
        path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000a'
        whole_disk: 0
        metaslab_array: 34
        metaslab_shift: 32
        ashift: 9
        asize: 500069564416
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 3
--------------------------------------------
    version: 5000
    name: 'test'
    state: 1
    txg: 9
    pool_guid: 4754816708306918549
    errata: 0
    hostname: 'voyage'
    top_guid: 9277063563828554439
    guid: 9277063563828554439
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 9277063563828554439
        path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000a'
        whole_disk: 0
        metaslab_array: 34
        metaslab_shift: 32
        ashift: 9
        asize: 500069564416
        is_log: 0
        create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data

root@voyage:/tmp# zpool import
no pools available to import

root@voyage:/tmp# zpool import -d /dev/disk/by-id/
   pool: test
     id: 4754816708306918549
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        test                                       ONLINE
          cciss-3600508b100104539535645303747000a  ONLINE

root@voyage:/tmp# egrep -v '^#|^ *$' /etc/default/zfs
ZFS_MOUNT='yes'
ZFS_UNMOUNT='yes'
ZFS_SHARE='yes'
ZFS_UNSHARE='yes'
USE_DISK_BY_ID='yes'
VERBOSE_MOUNT='no'
DO_OVERLAY_MOUNTS='no'
MOUNT_EXTRA_OPTIONS=""
ZFS_DKMS_ENABLE_DEBUG='no'
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'
ZFS_DKMS_DISABLE_STRIP='no'
ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'
ZFS_INITRD_POST_MODPROBE_SLEEP='0'
LOCKDIR=/run/lock
@mailinglists35
Copy link
Author

using 0.6.4-1.1-2 on debian jessie

@mailinglists35
Copy link
Author

however, if i do this, I get partitioning ok

root@voyage:/# cd /dev/disk/by-id/

root@voyage:/dev/disk/by-id# ls -l cciss-3600508b100104539535645303747000a
lrwxrwxrwx 1 root root 16 Jun  7 18:34 cciss-3600508b100104539535645303747000a -> ../../cciss/c0d2

root@voyage:/dev/disk/by-id# ls -l ../../cciss/c0d2
brw-rw---- 1 root disk 104, 32 Jun  7 18:34 ../../cciss/c0d2

root@voyage:/dev/disk/by-id# mknod /dev/sdb b 104 32

root@voyage:/dev/disk/by-id# zdb -l /dev/sdb
--------------------------------------------
LABEL 0
--------------------------------------------
failed to unpack label 0
--------------------------------------------
LABEL 1
--------------------------------------------
failed to unpack label 1
--------------------------------------------
LABEL 2
--------------------------------------------
failed to unpack label 2
--------------------------------------------
LABEL 3
--------------------------------------------
failed to unpack label 3

root@voyage:/dev/disk/by-id# zpool create test /dev/sdb
invalid vdev specification
use '-f' to override the following errors:
/dev/sdb does not contain an EFI label but it may contain partition
information in the MBR.

root@voyage:/dev/disk/by-id# zpool create -f test /dev/sdb
cannot label 'sdb': failed to detect device partitions on '/dev/sdb1': 2

root@voyage:/dev/disk/by-id# ls -l /dev/cciss/c0d2*
brw-rw---- 1 root disk 104, 32 Jun  7 18:37 /dev/cciss/c0d2
brw-rw---- 1 root disk 104, 33 Jun  7 18:37 /dev/cciss/c0d2p1
brw-rw---- 1 root disk 104, 41 Jun  7 18:37 /dev/cciss/c0d2p9

root@voyage:/dev/disk/by-id# zpool list
no pools available

#(If I create NOW using cciss-3600508b100104539535645303747000a, it will delete the partitions it just created, so I continue mknodding)

root@voyage:/dev/disk/by-id# mknod /dev/sdb1 b 104 33
root@voyage:/dev/disk/by-id# mknod /dev/sdb9 b 104 41
root@voyage:/dev/disk/by-id# ls -l /dev/sdb*
brw-r--r-- 1 root root 104, 32 Jun  7 18:40 /dev/sdb
brw-r--r-- 1 root root 104, 33 Jun  7 18:41 /dev/sdb1
brw-r--r-- 1 root root 104, 41 Jun  7 18:41 /dev/sdb9

root@voyage:/dev/disk/by-id# zpool create test /dev/sdb

root@voyage:/dev/disk/by-id# zpool status test
  pool: test
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        test        ONLINE       0     0     0
          sdb       ONLINE       0     0     0

errors: No known data errors

@mailinglists35 mailinglists35 changed the title zpool create does not create gpt nor any other kind of partition table on hp smartarray CCISS drives zpool create does not create gpt or any other kind of partition table on hp smartarray CCISS drives Jun 7, 2015
@mailinglists35 mailinglists35 changed the title zpool create does not create gpt or any other kind of partition table on hp smartarray CCISS drives "zpool create" does not create gpt or any other kind of partition table on hp smartarray CCISS drives Jun 7, 2015
@mailinglists35
Copy link
Author

so in the end i scripted the mknod for all 12 drives, then exported and reimported using disk/by-id.
now i have on each disk this, does it look like it should be?

root@voyage:/dev/cciss# sgdisk -p c0d9
Disk c0d9: 976707632 sectors, 465.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8599C078-7AD6-7B48-9BD1-2C019286ED4A
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976707598
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048       976691199   465.7 GiB   BF01  zfs
   9       976691200       976707583   8.0 MiB     BF07

and

root@voyage:/dev/cciss# zdb -l c0d9p1
--------------------------------------------
LABEL 0
--------------------------------------------
    version: 5000
    name: 'big'
    state: 0
    txg: 30
    pool_guid: 2511880599611440630
    errata: 0
    hostname: 'voyage'
    top_guid: 10580517074630390673
    guid: 7480546760541277976
    vdev_children: 1
    vdev_tree:
        type: 'raidz'
        id: 0
        guid: 10580517074630390673
        nparity: 3
        metaslab_array: 36
        metaslab_shift: 35
        ashift: 9
        asize: 4000481017856
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7392790834476296029
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470008-part1'
            whole_disk: 1
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 9400406838033274994
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470009-part1'
            whole_disk: 1
            create_txg: 4
        children[2]:
            type: 'disk'
            id: 2
            guid: 10823004750151606053
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000c-part1'
            whole_disk: 1
            create_txg: 4
        children[3]:
            type: 'disk'
            id: 3
            guid: 7129191442423220330
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000d-part1'
            whole_disk: 1
            create_txg: 4
        children[4]:
            type: 'disk'
            id: 4
            guid: 13814952219234920272
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000e-part1'
            whole_disk: 1
            create_txg: 4
        children[5]:
            type: 'disk'
            id: 5
            guid: 18239569050806217802
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000f-part1'
            whole_disk: 1
            create_txg: 4
        children[6]:
            type: 'disk'
            id: 6
            guid: 7480546760541277976
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470011-part1'
            whole_disk: 1
            create_txg: 4
        children[7]:
            type: 'disk'
            id: 7
            guid: 13990482628415507355
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470013-part1'
            whole_disk: 1
            create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 1
--------------------------------------------
    version: 5000
    name: 'big'
    state: 0
    txg: 30
    pool_guid: 2511880599611440630
    errata: 0
    hostname: 'voyage'
    top_guid: 10580517074630390673
    guid: 7480546760541277976
    vdev_children: 1
    vdev_tree:
        type: 'raidz'
        id: 0
        guid: 10580517074630390673
        nparity: 3
        metaslab_array: 36
        metaslab_shift: 35
        ashift: 9
        asize: 4000481017856
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7392790834476296029
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470008-part1'
            whole_disk: 1
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 9400406838033274994
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470009-part1'
            whole_disk: 1
            create_txg: 4
        children[2]:
            type: 'disk'
            id: 2
            guid: 10823004750151606053
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000c-part1'
            whole_disk: 1
            create_txg: 4
        children[3]:
            type: 'disk'
            id: 3
            guid: 7129191442423220330
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000d-part1'
            whole_disk: 1
            create_txg: 4
        children[4]:
            type: 'disk'
            id: 4
            guid: 13814952219234920272
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000e-part1'
            whole_disk: 1
            create_txg: 4
        children[5]:
            type: 'disk'
            id: 5
            guid: 18239569050806217802
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000f-part1'
            whole_disk: 1
            create_txg: 4
        children[6]:
            type: 'disk'
            id: 6
            guid: 7480546760541277976
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470011-part1'
            whole_disk: 1
            create_txg: 4
        children[7]:
            type: 'disk'
            id: 7
            guid: 13990482628415507355
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470013-part1'
            whole_disk: 1
            create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 2
--------------------------------------------
    version: 5000
    name: 'big'
    state: 0
    txg: 30
    pool_guid: 2511880599611440630
    errata: 0
    hostname: 'voyage'
    top_guid: 10580517074630390673
    guid: 7480546760541277976
    vdev_children: 1
    vdev_tree:
        type: 'raidz'
        id: 0
        guid: 10580517074630390673
        nparity: 3
        metaslab_array: 36
        metaslab_shift: 35
        ashift: 9
        asize: 4000481017856
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7392790834476296029
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470008-part1'
            whole_disk: 1
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 9400406838033274994
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470009-part1'
            whole_disk: 1
            create_txg: 4
        children[2]:
            type: 'disk'
            id: 2
            guid: 10823004750151606053
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000c-part1'
            whole_disk: 1
            create_txg: 4
        children[3]:
            type: 'disk'
            id: 3
            guid: 7129191442423220330
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000d-part1'
            whole_disk: 1
            create_txg: 4
        children[4]:
            type: 'disk'
            id: 4
            guid: 13814952219234920272
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000e-part1'
            whole_disk: 1
            create_txg: 4
        children[5]:
            type: 'disk'
            id: 5
            guid: 18239569050806217802
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000f-part1'
            whole_disk: 1
            create_txg: 4
        children[6]:
            type: 'disk'
            id: 6
            guid: 7480546760541277976
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470011-part1'
            whole_disk: 1
            create_txg: 4
        children[7]:
            type: 'disk'
            id: 7
            guid: 13990482628415507355
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470013-part1'
            whole_disk: 1
            create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
--------------------------------------------
LABEL 3
--------------------------------------------
    version: 5000
    name: 'big'
    state: 0
    txg: 30
    pool_guid: 2511880599611440630
    errata: 0
    hostname: 'voyage'
    top_guid: 10580517074630390673
    guid: 7480546760541277976
    vdev_children: 1
    vdev_tree:
        type: 'raidz'
        id: 0
        guid: 10580517074630390673
        nparity: 3
        metaslab_array: 36
        metaslab_shift: 35
        ashift: 9
        asize: 4000481017856
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7392790834476296029
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470008-part1'
            whole_disk: 1
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 9400406838033274994
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470009-part1'
            whole_disk: 1
            create_txg: 4
        children[2]:
            type: 'disk'
            id: 2
            guid: 10823004750151606053
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000c-part1'
            whole_disk: 1
            create_txg: 4
        children[3]:
            type: 'disk'
            id: 3
            guid: 7129191442423220330
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000d-part1'
            whole_disk: 1
            create_txg: 4
        children[4]:
            type: 'disk'
            id: 4
            guid: 13814952219234920272
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000e-part1'
            whole_disk: 1
            create_txg: 4
        children[5]:
            type: 'disk'
            id: 5
            guid: 18239569050806217802
            path: '/dev/disk/by-id/cciss-3600508b100104539535645303747000f-part1'
            whole_disk: 1
            create_txg: 4
        children[6]:
            type: 'disk'
            id: 6
            guid: 7480546760541277976
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470011-part1'
            whole_disk: 1
            create_txg: 4
        children[7]:
            type: 'disk'
            id: 7
            guid: 13990482628415507355
            path: '/dev/disk/by-id/cciss-3600508b1001045395356453037470013-part1'
            whole_disk: 1
            create_txg: 4
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data

and

root@voyage:/dev/cciss# zpool status
  pool: big
 state: ONLINE
  scan: none requested
config:

        NAME                                         STATE     READ WRITE CKSUM
        big                                          ONLINE       0     0     0
          raidz3-0                                   ONLINE       0     0     0
            cciss-3600508b1001045395356453037470008  ONLINE       0     0     0
            cciss-3600508b1001045395356453037470009  ONLINE       0     0     0
            cciss-3600508b100104539535645303747000c  ONLINE       0     0     0
            cciss-3600508b100104539535645303747000d  ONLINE       0     0     0
            cciss-3600508b100104539535645303747000e  ONLINE       0     0     0
            cciss-3600508b100104539535645303747000f  ONLINE       0     0     0
            cciss-3600508b1001045395356453037470011  ONLINE       0     0     0
            cciss-3600508b1001045395356453037470013  ONLINE       0     0     0
        spares
          cciss-3600508b100104539535645303747000a    AVAIL
          cciss-3600508b100104539535645303747000b    AVAIL
          cciss-3600508b1001045395356453037470010    AVAIL
          cciss-3600508b1001045395356453037470012    AVAIL

errors: No known data errors

@igrekster
Copy link

I've also encountered this issue on a ASUS laptop with NVMe SSD. The drive name is /dev/nvme0n1.
I've tried v0.6.5.8 and v0.7.0-rc2, both exhibit the same behavior. I guess it has something to do with device naming.
@mailinglists35, thank you very much for the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@igrekster @mailinglists35 and others