Create a ZFS stripe of mirrors on whole devices
The following steps are taken to create a zpool on whole devices on FreeNAS. The FreeNAS web UI likes to partition devices and add swap.
Note: The Intel SSD used for the ZIL report 512byte physical and logical block size (ashift 9). To keep things simple ensure that all vdevs have an ashift of 12.
# sysctl vfs.zfs.min_auto_ashift=12
Either create the device in bits:
zpool create puddle mirror da6 da7 zpool add puddle mirror da8 da9 zpool add puddle mirror da10 da11 zpool add puddle mirror da12 da13 zpool add puddle log mirror ada1 ada2 zpool add puddle cache ada0
Or in one go:
# zpool create puddle mirror da6 da7 mirror da8 da9 mirror da10 da11 mirror da12 da13 log mirror ada1 ada2 cache ada0
Note: To import the pool into FreeNAS, the pool must be exported so that FreeNAS can import it.
Verify
status
# zpool status puddle pool: puddle state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM puddle ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 da6 ONLINE 0 0 0 da7 ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 da8 ONLINE 0 0 0 da9 ONLINE 0 0 0 mirror-2 ONLINE 0 0 0 da10 ONLINE 0 0 0 da11 ONLINE 0 0 0 mirror-3 ONLINE 0 0 0 da12 ONLINE 0 0 0 da13 ONLINE 0 0 0 logs mirror-4 ONLINE 0 0 0 ada1 ONLINE 0 0 0 ada2 ONLINE 0 0 0 cache ada0 ONLINE 0 0 0 errors: No known data errors
ashift
The disks have 4k logical blocks. Ensure the zpool has been created with an ashift of 12:
# zdb | grep ashift
Links
Appendices
camcontrol devlist
- da6-da13 used for the stripes
- ada0 used for cache
- ada1 and ada2 used for log
# camcontrol devlist <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 2 lun 0 (pass0,da0) <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 3 lun 0 (pass1,da1) <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 4 lun 0 (pass2,da2) <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 5 lun 0 (pass3,da3) <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 6 lun 0 (pass4,da4) <ATA WDC WD30EFRX-68E 0A80> at scbus0 target 7 lun 0 (pass5,da5) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 0 lun 0 (pass6,da6) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 1 lun 0 (pass7,da7) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 2 lun 0 (pass8,da8) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 3 lun 0 (pass9,da9) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 6 lun 0 (pass10,da10) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 7 lun 0 (pass11,da11) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 8 lun 0 (pass12,da12) <ATA WDC WD30EFRX-68A 0A80> at scbus1 target 9 lun 0 (pass13,da13) <INTEL SSDSC2BB160G4 D2010355> at scbus3 target 0 lun 0 (pass14,ada0) <INTEL SSDSC2BA100G3 5DV10250> at scbus5 target 0 lun 0 (pass15,ada1) <INTEL SSDSC2BA100G3 5DV10250> at scbus6 target 0 lun 0 (pass16,ada2) <KINGSTON SMS200S330G 524ABBF0> at scbus7 target 0 lun 0 (pass17,ada3) <KINGSTON SMS200S330G 524ABBF0> at scbus8 target 0 lun 0 (pass18,ada4)
zdb ashift
puddle: version: 5000 name: 'puddle' state: 0 txg: 4 pool_guid: 16743933400717346583 hostid: 1527999924 hostname: 'lust.lucidsolutions.co.nz' vdev_children: 5 vdev_tree: type: 'root' id: 0 guid: 16743933400717346583 create_txg: 4 children[0]: type: 'mirror' id: 0 guid: 9347171221701713581 metaslab_array: 41 metaslab_shift: 34 ashift: 12 asize: 3000588042240 is_log: 0 create_txg: 4 children[0]: type: 'disk' id: 0 guid: 8210833198348662132 path: '/dev/da6' whole_disk: 1 create_txg: 4 children[1]: type: 'disk' id: 1 guid: 13263273714700669449 path: '/dev/da7' whole_disk: 1 create_txg: 4 children[1]: type: 'mirror' id: 1 guid: 9757361997344248124 metaslab_array: 39 metaslab_shift: 34 ashift: 12 asize: 3000588042240 is_log: 0 create_txg: 4 children[0]: type: 'disk' id: 0 guid: 8475625892716657904 path: '/dev/da8' whole_disk: 1 create_txg: 4 children[1]: type: 'disk' id: 1 guid: 6806990800266546406 path: '/dev/da9' whole_disk: 1 create_txg: 4 children[2]: type: 'mirror' id: 2 guid: 3792610231202561515 metaslab_array: 38 metaslab_shift: 34 ashift: 12 asize: 3000588042240 is_log: 0 create_txg: 4 children[0]: type: 'disk' id: 0 guid: 9423451777464359734 path: '/dev/da10' whole_disk: 1 create_txg: 4 children[1]: type: 'disk' id: 1 guid: 7213106225546705914 path: '/dev/da11' whole_disk: 1 create_txg: 4 children[3]: type: 'mirror' id: 3 guid: 13160743252116342935 metaslab_array: 36 metaslab_shift: 34 ashift: 12 asize: 3000588042240 is_log: 0 create_txg: 4 children[0]: type: 'disk' id: 0 guid: 12171590736149067634 path: '/dev/da12' whole_disk: 1 create_txg: 4 children[1]: type: 'disk' id: 1 guid: 13855520172667006807 path: '/dev/da13' whole_disk: 1 create_txg: 4 children[4]: type: 'mirror' id: 4 guid: 4798060137509538786 metaslab_array: 35 metaslab_shift: 29 ashift: 12 asize: 100025499648 is_log: 1 create_txg: 4 children[0]: type: 'disk' id: 0 guid: 7437717646651978446 path: '/dev/ada1' whole_disk: 1 create_txg: 4 children[1]: type: 'disk' id: 1 guid: 6125376594851186985 path: '/dev/ada2' whole_disk: 1 create_txg: 4 features_for_read: com.delphix:hole_birth com.delphix:embedded_data
Remove log
# zpool remove puddle mirror-4