I have a filesystem with many small files that I erase regularly (the files are a cache that can easily be regenerated). It's much faster to simply create a new filesystem rather than run
rm -rf or
rsync to delete all the files (i.e. Efficiently delete large directory containing thousands of files).
The only issue with creating a new filesystem to wipe the filesystem is that its UUID changes, leading to changes in e.g.
Is there a way to simply "unlink" a directory from e.g. an ext4 filesystem, or completely clear its list of inodes?