我应该如何从 FreeNAS 中删除古老的档案?

我应该如何从 FreeNAS 中删除古老的档案?

我从一位离职同事那里继承了一套 FreeNAS 安装。该安装用于保存我们遍布全球的众多 Web 服务器的内部 rsync 备份。

FreeNAS 盒中的存储空间即将用完,我发现我们仍然有早在 2013 年就已退役的服务器的备份。我们不再需要这些旧档案,所以我想删除它们以释放一些空间。

初步结果df -h如下:

...
raid-1                                283G    261G     22G    92%    /mnt/raid-1
raid-1/clone-auto-20140925.0800-2m    283G    261G     22G    92%    /mnt/raid-1/clone-auto-20140925.0800-2m
...

因此,我天真地删除了旧的 rsync 快照,即rm -rf /mnt/raid-1/backups/old.server.1 /mnt/raid-1/backups/old.server.2。之后,df -h现在看起来像这样:

...
raid-1                                266G    244G     22G    92%    /mnt/raid-1
raid-1/clone-auto-20140925.0800-2m    283G    261G     22G    92%    /mnt/raid-1/clone-auto-20140925.0800-2m
...

噢噢噢

我把问题缩小到我对 ZFS 缺乏了解。显然,它df并没有以我期望的传统方式报告磁盘使用情况,简单的删除也无法解决我的问题。

如果有人能做到,我将非常感激:

  1. 请为我指明正确的方向,以便我了解 FreeNAS 如何利用 ZFS,并且
  2. 提供一些关于如何通过删除那些古老备份的副本来释放一些空间的指导。

编辑1

我一直在阅读,现在我明白由于 ZFS 的 CoW,空间没有被释放。

输出zfs list

NAME                                 USED  AVAIL  REFER  MOUNTPOINT
raid-1                              1.76T  21.5G   245G  /mnt/raid-1
raid-1/clone-auto-20140925.0800-2m  34.8G  21.5G   261G  /mnt/raid-1/clone-auto-20140925.0800-2m

编辑2

`zfs list -t snapper` 的输出

NAME                                                       USED  AVAIL  REFER  MOUNTPOINT
[email protected]                              91.0G      -   261G  -
[email protected]                              9.13G      -   301G  -
[email protected]                              4.68G      -   301G  -
[email protected]                              4.70G      -   302G  -
[email protected]                              4.63G      -   302G  -
[email protected]                              15.5G      -   297G  -
[email protected]                              15.6G      -   297G  -
[email protected]                              15.7G      -   297G  -
[email protected]                              16.0G      -   297G  -
[email protected]                              15.9G      -   297G  -
[email protected]                              16.2G      -   298G  -
[email protected]                              15.2G      -   297G  -
[email protected]                              13.8G      -   297G  -
[email protected]                              14.1G      -   298G  -
[email protected]                              19.1G      -   298G  -
[email protected]                              19.3G      -   299G  -
[email protected]                              16.6G      -   299G  -
[email protected]                              16.7G      -   300G  -
[email protected]                              15.7G      -   299G  -
[email protected]                              16.3G      -   300G  -
[email protected]                              16.6G      -   300G  -
[email protected]                              19.5G      -   300G  -
[email protected]                              19.8G      -   299G  -
[email protected]                              17.4G      -   299G  -
[email protected]                              17.6G      -   300G  -
[email protected]                              16.4G      -   299G  -
[email protected]                              16.9G      -   300G  -
[email protected]                              17.5G      -   297G  -
[email protected]                              20.0G      -   297G  -
[email protected]                              20.2G      -   297G  -
[email protected]                              5.43G      -   297G  -
[email protected]                              5.46G      -   302G  -
[email protected]                              16.7G      -   307G  -
[email protected]                              16.8G      -   308G  -
[email protected]                              17.2G      -   309G  -
[email protected]                              20.5G      -   309G  -
[email protected]                              17.4G      -   309G  -
[email protected]                              17.7G      -   310G  -
[email protected]                              17.8G      -   311G  -
[email protected]                               575M      -   310G  -
[email protected]                               575M      -   310G  -
[email protected]                              20.9G      -   309G  -
[email protected]                              21.0G      -   309G  -
[email protected]                              20.6G      -   306G  -
[email protected]                              17.8G      -   306G  -
[email protected]                              18.1G      -   308G  -
[email protected]                               561M      -   307G  -
[email protected]                               561M      -   307G  -
[email protected]                              20.7G      -   308G  -
[email protected]                              21.3G      -   308G  -
[email protected]                              21.6G      -   308G  -
[email protected]                              18.9G      -   309G  -
[email protected]                              19.1G      -   310G  -
[email protected]                              18.0G      -   309G  -
[email protected]                              18.2G      -   309G  -
[email protected]                              18.6G      -   310G  -
[email protected]                              19.1G      -   310G  -
[email protected]                              22.1G      -   238G  -
[email protected]                              19.4G      -   238G  -
[email protected]                              12.2G      -   239G  -
[email protected]                               314M      -   245G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   584M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   584M      -   261G  -
raid-1/[email protected]   584M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   584M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   585M      -   261G  -
raid-1/[email protected]   584M      -   261G  -

答案1

看起来您正在定期拍摄 ZFS 数据集的快照。任何删除的数据都将保留在快照中。要删除快照,请运行 zfs destroy raid-1@[snapshotname] 有关快照的完整说明,请查看文档

如果你想一次性删除一堆快照,请查看这个答案

答案2

以下是我目前使用过的内容:

  1. zfs list- 识别体积/数据集
  2. zfs list -H -t snapshot -o name -S creation -r volume/dataset | tail -10- 用你自己的信息替换volume/dataset,tail XX menas list xx olders
  3. zfs list -H -t snapshot -o name -S creation -r volume/dataset | tail -10 | xargs -n 1 zfs  destroy- 再次用你的替换卷/数据集。

相关内容