关于python:sparce zvol上的ZFS压缩-空间差异

关于python:sparce zvol上的ZFS压缩-空间差异

我正在将dd3TB 驱动器的 img 压缩到 Linux 的 ZFS 中的 zvol 上。我启用了压缩 (lz4) 并让它传输。该池仅由一个 3TB 驱动器组成(目前)。我预计会zfs list比实际多出 86Gigs。以下是一些数字:

$ zfs --version
zfs-0.8.3-1ubuntu12
zfs-kmod-0.8.3-1ubuntu12
$ zfs list
NAME                          USED  AVAIL     REFER  MOUNTPOINT
tank                         2.46T   176G       96K  /tank
tank/justin                   100K   176G      100K  /tank/justin
tank/seagate_3tb_01_20_2020  2.46T   176G     2.46T  -
$ zpool list
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
tank  2.72T  2.46T   263G        -         -     0%    90%  1.00x    ONLINE  -
$ zfs get all tank/seagate_3tb_01_20_2020 
NAME                         PROPERTY              VALUE                  SOURCE
tank/seagate_3tb_01_20_2020  type                  volume                 -
tank/seagate_3tb_01_20_2020  creation              Mon Apr 27  0:26 2020  -
tank/seagate_3tb_01_20_2020  used                  2.46T                  -
tank/seagate_3tb_01_20_2020  available             176G                   -
tank/seagate_3tb_01_20_2020  referenced            2.46T                  -
tank/seagate_3tb_01_20_2020  compressratio         1.08x                  -
tank/seagate_3tb_01_20_2020  reservation           none                   default
tank/seagate_3tb_01_20_2020  volsize               3T                     local
tank/seagate_3tb_01_20_2020  volblocksize          8K                     default
tank/seagate_3tb_01_20_2020  checksum              on                     default
tank/seagate_3tb_01_20_2020  compression           lz4                    local
tank/seagate_3tb_01_20_2020  readonly              off                    default
tank/seagate_3tb_01_20_2020  createtxg             10771                  -
tank/seagate_3tb_01_20_2020  copies                1                      default
tank/seagate_3tb_01_20_2020  refreservation        none                   local
tank/seagate_3tb_01_20_2020  guid                  17633099490469485439   -
tank/seagate_3tb_01_20_2020  primarycache          all                    default
tank/seagate_3tb_01_20_2020  secondarycache        all                    default
tank/seagate_3tb_01_20_2020  usedbysnapshots       0B                     -
tank/seagate_3tb_01_20_2020  usedbydataset         2.46T                  -
tank/seagate_3tb_01_20_2020  usedbychildren        0B                     -
tank/seagate_3tb_01_20_2020  usedbyrefreservation  0B                     -
tank/seagate_3tb_01_20_2020  logbias               latency                default
tank/seagate_3tb_01_20_2020  objsetid              906                    -
tank/seagate_3tb_01_20_2020  dedup                 off                    default
tank/seagate_3tb_01_20_2020  mlslabel              none                   default
tank/seagate_3tb_01_20_2020  sync                  standard               default
tank/seagate_3tb_01_20_2020  refcompressratio      1.08x                  -
tank/seagate_3tb_01_20_2020  written               2.46T                  -
tank/seagate_3tb_01_20_2020  logicalused           2.65T                  -
tank/seagate_3tb_01_20_2020  logicalreferenced     2.65T                  -
tank/seagate_3tb_01_20_2020  volmode               default                default
tank/seagate_3tb_01_20_2020  snapshot_limit        none                   default
tank/seagate_3tb_01_20_2020  snapshot_count        none                   default
tank/seagate_3tb_01_20_2020  snapdev               hidden                 default
tank/seagate_3tb_01_20_2020  context               none                   default
tank/seagate_3tb_01_20_2020  fscontext             none                   default
tank/seagate_3tb_01_20_2020  defcontext            none                   default
tank/seagate_3tb_01_20_2020  rootcontext           none                   default
tank/seagate_3tb_01_20_2020  redundant_metadata    all                    default
tank/seagate_3tb_01_20_2020  encryption            off                    default
tank/seagate_3tb_01_20_2020  keylocation           none                   default
tank/seagate_3tb_01_20_2020  keyformat             none                   default
tank/seagate_3tb_01_20_2020  pbkdf2iters           0                      default

我没有快照,已禁用保留和重新保留,但 zpool 和列表之间仍然存在某种空间差异。(是的,我已阅读文章,我知道它们不会相同,但这是池中的单个磁盘,肯定~86G 太多了)。看来我没有恢复压缩节省的空间以在其他地方重复使用(我只能使用 176G 而不是 263G)

我希望这是我所遗漏的配置更改。

编辑(zpool get all tank,仅用创建zpool create tank /dev/sda

$ zpool get all tank
NAME  PROPERTY                       VALUE                          SOURCE
tank  size                           2.72T                          -
tank  capacity                       90%                            -
tank  altroot                        -                              default
tank  health                         ONLINE                         -
tank  guid                           901113366047988914             -
tank  version                        -                              default
tank  bootfs                         -                              default
tank  delegation                     on                             default
tank  autoreplace                    off                            default
tank  cachefile                      -                              default
tank  failmode                       wait                           default
tank  listsnapshots                  on                             local
tank  autoexpand                     off                            default
tank  dedupditto                     0                              default
tank  dedupratio                     1.00x                          -
tank  free                           263G                           -
tank  allocated                      2.46T                          -
tank  readonly                       off                            -
tank  ashift                         0                              default
tank  comment                        -                              default
tank  expandsize                     -                              -
tank  freeing                        0                              -
tank  fragmentation                  0%                             -
tank  leaked                         0                              -
tank  multihost                      off                            default
tank  checkpoint                     -                              -
tank  load_guid                      9196014585464561985            -
tank  autotrim                       off                            default
tank  feature@async_destroy          enabled                        local
tank  feature@empty_bpobj            active                         local
tank  feature@lz4_compress           active                         local
tank  feature@multi_vdev_crash_dump  enabled                        local
tank  feature@spacemap_histogram     active                         local
tank  feature@enabled_txg            active                         local
tank  feature@hole_birth             active                         local
tank  feature@extensible_dataset     active                         local
tank  feature@embedded_data          active                         local
tank  feature@bookmarks              enabled                        local
tank  feature@filesystem_limits      enabled                        local
tank  feature@large_blocks           enabled                        local
tank  feature@large_dnode            enabled                        local
tank  feature@sha512                 enabled                        local
tank  feature@skein                  enabled                        local
tank  feature@edonr                  enabled                        local
tank  feature@userobj_accounting     active                         local
tank  feature@encryption             enabled                        local
tank  feature@project_quota          active                         local
tank  feature@device_removal         enabled                        local
tank  feature@obsolete_counts        enabled                        local
tank  feature@zpool_checkpoint       enabled                        local
tank  feature@spacemap_v2            active                         local
tank  feature@allocation_classes     enabled                        local
tank  feature@resilver_defer         enabled                        local
tank  feature@bookmark_v2            enabled                        local

答案1

我在 openzfs github 上问了这个确切的问题并得到了答案:

https://github.com/openzfs/zfs/issues/10260#issuecomment-620332829

TLDR:查看您的 spa_slop_shift 设置。

相关内容