ZFS - how to free missing space of root dataset

Discussion in 'Technical' started by teer26, Jan 29, 2020.

  1. teer26

    teer26 New Member

    I have a mirrored ZFS array on a FreeBSD that I used for home NAS, consisting of a 6TB internal drive and a 8TB external USB drive. I have 2TB of space occupied that should not be occupied, but I cannot delete or even see any of its contents.

    To sum: I have ~2TB of inaccessible space in each pool, space I think corresponds to a never-completed transfer of data. In other words, zfs_bk takes up 5.27 TB, but should be taking up only ~3 TB. However, there are no files in /zfs_bk; the only actual files that can be seen are in the datasets mounted in the subfolders of zfs_bk. Those datasets have sizes consistent with what is contained/displayed in their mountpoints, however.

    I suspect that this originated when I was transferring a lot of relatively large (>=10GB) files when I was initially setting up my ZFS array (a la send/receive snapshot), but kept getting the infamous broken pipe error when it was almost completed, and so it never finished. If so, how do I delete space referred to by a snapshot?

    Here is my output:
    #   zfs list
    NAME                   USED  AVAIL  REFER  MOUNTPOINT
    zfs_bk                5.27T   612K  2.28T  /zfs_bk
    zfs_bk/docs           1.23M   612K  1.23M  /zfs_bk/me/docs
    zfs_bk/me             12.1G   612K  8.38G  /zfs_bk/me
    zfs_bk/me/code        209M   612K   209M   /zfs_bk/me/code
    zfs_bk/me/files       77.2M   612K  77.2M  /zfs_bk/me/files
    zfs_bk/me/pictures    2.11G   612K  2.11G  /zfs_bk/me/pictures
    zfs_bk/me/robo        1.29G   612K  1.29G  /zfs_bk/me/robo
    zfs_bk/me/video         88K   612K    88K  /zfs_bk/me/video
    zfs_bk/shared          369G   612K    88K  /zfs_bk/shared
    zfs_bk/shared/images  2.10G   612K  2.10G  /zfs_bk/shared/images
    zfs_bk/shared/music    367G   612K   367G  /zfs_bk/shared/music
    zfs_bk/shared/video     88K   612K    88K  /zfs_bk/shared/video
    zfs_bk/unsorted       2.61T   612K  2.61T  /zfs_bk/unsorted
    zroot                 6.18G   101G    88K  /zroot
    zroot/ROOT            2.59G   101G    88K  none
    zroot/ROOT/default    2.59G   101G  2.59G  /
    zroot/tmp               88K   101G    88K  /tmp
    zroot/usr             3.58G   101G    88K  /usr
    zroot/usr/home         641M   101G   641M  /usr/home
    zroot/usr/ports       2.29G   101G  2.29G  /usr/ports
    zroot/usr/src          682M   101G   682M  /usr/src
    zroot/var             1.16M   101G    88K  /var
    zroot/var/audit         88K   101G    88K  /var/audit
    zroot/var/crash         88K   101G    88K  /var/crash
    zroot/var/log          736K   101G   736K  /var/log
    zroot/var/mail          88K   101G    88K  /var/mail
    zroot/var/tmp           96K   101G    96K  /var/tmp
    #   ls -a /zfs_bk
    .               ..              me             shared          unsorted
    #   du -h -d=1 /zfs_bk
    3.0T    /zfs_bk
    Thanks in advance for any help anyone can offer
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. teer26

    teer26 New Member

    It says that I have 2.28 TB used by the root dataset /zfs_bk itself. But how do I free this space? /zfs_bk is completely empty

    #   sudo zfs list -o space -r zfs_bk
    zfs_bk                 436K  5.27T         0   2.28T              0      2.98T
    zfs_bk/docs            436K  1.23M         0   1.23M              0          0
    zfs_bk/me              436K  12.1G         0   8.38G              0      3.68G
    zfs_bk/me/code         436K   209M         0    209M              0          0
    zfs_bk/me/files        436K  77.2M         0   77.2M              0          0
    zfs_bk/me/pictures     436K  2.11G         0   2.11G              0          0
    zfs_bk/me/robotics     436K  1.29G         0   1.29G              0          0
    zfs_bk/me/video        436K    88K         0     88K              0          0
    zfs_bk/shared          436K   369G         0     88K              0       369G
    zfs_bk/shared/images   436K  2.10G         0   2.10G              0          0
    zfs_bk/shared/music    436K   367G         0    367G              0          0
    zfs_bk/shared/video    436K    88K         0     88K              0          0
    zfs_bk/unsorted        436K  2.61T         0   2.61T              0          0
  4. teer26

    teer26 New Member

    Could I export all of the sub-pools (me, shared, unsorted), delete zfs_bk, remake it and then import the sub-pools? Or something similar?

Share This Page