Bug 284087 - ZFS: empty usage when -o readonly set on import
Summary: ZFS: empty usage when -o readonly set on import
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-15 18:15 UTC by Dmitry Morozovsky
Modified: 2025-01-17 16:52 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Morozovsky freebsd_committer freebsd_triage 2025-01-15 18:15:56 UTC
mostly, subject said it all

found while reviving pool on a dying HDD: alloc and other related statistics are zero:

# zpool import -o readonly=on -R /mnt bext bext-old

# zpool list
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
bext-old  3.62T      0  3.62T        -         -     0%     0%  1.00x    ONLINE  /mnt
# df -h | grep bext-old
bext-old/p/distfiles       3.1T    175G    3.0T     5%    /mnt/p/distfiles
bext-old/p/packages        3.3T    349G    3.0T    10%    /mnt/p/data/packages
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2025-01-17 16:51:03 UTC
I see the same thing, it works fine if "-o readonly=on" is omitted:

> zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data   10.9T  4.40T  6.47T        -         -     9%    40%  1.00x    ONLINE  -
zroot  1.80T   111G  1.69T        -         -     0%     6%  1.00x    ONLINE  -

with "data" imported using readonly=on:

> zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data   10.9T      0  10.9T        -         -     0%     0%  1.00x    ONLINE  -
zroot  1.80T   111G  1.69T        -         -     0%     6%  1.00x    ONLINE  -

This might be worth reporting in the openzfs bug tracker as well.