eza-community / eza-community/eza

bug: trycmd fails on zfs due to blocksize

Open
#613 0 comments 0 reactions 0 assignees View on GitHub
area: filesystem area: nix type: bug
Dominant language
Rust
Stars
23.3k
Forks
523
PR merge metrics
No merged PRs in 30d

Description

I can't speak for every ZFS filesystem but at least for mine the blocksize is always 1Kb bigger.
```sh
nix flake check
```
or run the trycmd tests manually from cargo with (maybe the syntax is slightly different)
```sh
cargo test --features nix
```
![image](https://github.com/eza-community/eza/assets/69043370/8d44791c-3de0-4ba9-b663-809c4cdeacd4)

## My zpool config
```raw

[glenda@laptop:~]$ sudo zpool history NIXROOT | head
History for 'NIXROOT':
2022-09-09.17:24:14 zpool create -f -o altroot=/mnt -o ashift=12 -o autotrim=on -O compression=lz4 -O acltype=posixacl -O xattr=sa -O relatime=on -O normalization=formD -O dnodesize=auto -O sync=disabled -O encryption=aes-256-gcm -O keylocation=prompt -O keyformat=passphrase -O mountpoint=none NIXROOT /dev/nvme0n1p2
2022-10-03.01:44:18 zfs allow sanoid snapshot,mount,destroy NIXROOT/home
```

## Tested on
To make sure it's a zfs issue I also tested touching a file on my boot drive (vfat) and got the expected blocksize of 0.
## How does ls handle the it?
Looks like ls shows the expected blocksize of 0.
```raw
[glenda@laptop:~]$ ls --block-size=K -lah projects/eza/tests/itest/
total 75K
drwxr-xr-x 4 glenda users 23 Nov 4 16:43 .
drwxr-xr-x 4 glenda users 5 Nov 4 13:43 ..
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 a
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 b
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 c
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 d
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 e
drwxr-xr-x 3 glenda users 4 Sep 20 20:38 exa
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 f
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 g
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 h
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 i
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 image.jpg.img.c.rs.log.png
-rw-r--r-- 1 glenda users 19 Sep 20 20:38 index.svg
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 j
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 k
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 l
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 m
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 n
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 o
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 p
-rw-r--r-- 1 glenda users 0 Sep 20 20:38 q
drwxr-xr-x 5 glenda users 5 Sep 20 20:38 vagrant
```

## Should the block size be 0?
It's always a good idea to follow ls, but I can't really answer that question but maybe this output helps.
```raw
[glenda@laptop:~]$ stat -f projects/eza/tests/itest/a
File: "projects/eza/tests/itest/a"
ID: 87664c6400ac0a14 Namelen: 255 Type: zfs
Block size: 131072 Fundamental block size: 131072
Blocks: Total: 1101972 Free: 684834 Available: 684834
Inodes: Total: 176499531 Free: 175317664
```
## Hotfix
Skip the failing test on zfs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.