[HN Gopher] Maintaining sufficient free space with ZFS ___________________________________________________________________ Maintaining sufficient free space with ZFS Author : DerekBickerton Score : 35 points Date : 2022-10-23 20:59 UTC (2 hours ago) (HTM) web link (taras.glek.net) (TXT) w3m dump (taras.glek.net) | londons_explore wrote: | I have certainly written code which consists of "while (free disk | space is less than X) {, delete oldest log file}". | | Such code would break on zfs. | | Is there even a better way to achieve "I want all spare space to | be filled with logfiles, but I never want to run out of space."? | nisa wrote: | `reservation` and `refreservation` might work. Set a high | default for the pool and a low override for the logfiles | dataset. | | Using this for several databases on a small SSD to avoid that | snapshots fill the disk and the least important database will | be out of space first. | londons_explore wrote: | One could imagine an "opportunistic storage" flag on a file | which means 'consider this file deletable if you ever need the | space'. | | It would be especially good for caches of remote files or data | that could be recalculated on demand. | | We already have lots of similar things for RAM - for example | Javas SoftReference. | [deleted] | lousken wrote: | is 90% used space even good with ZFS these days? I always reserve | 25% in order to keep fragmentation in check | mustache_kimono wrote: | I mean 5-10 seconds for the free space to be updated doesn't | sound extraordinary? With all the accounting ZFS has do, doesn't | this sound like something you would want running asynchronously | in the background? The blog makes a point (with references) of | ZFS being transactional, but, as a related matter, it's also COW, | one would assume finding/guaranteeing "free" space is much harder | than it would be on a traditional filesystem. | toast0 wrote: | It's clearly not extraordinary, it's normal for ZFS. UFS2 on | FreeBSD does is too, it also has snapshots, but isn't generally | COW. | | The first time you delete something bit and it doesn't show up | in df right away, it might be surprising though. Or this case | where automation deleted more than expected because the author | wasn't aware of the need to wait. ___________________________________________________________________ (page generated 2022-10-23 23:00 UTC)