I want to remove a directory that has large amounts of data on it. This is my backup array, which is a ZFS filesystem, linear span, single pool called "san". San is mounted on
so I want to bulk remove /san/thispc/certainFolder
$ du -h -d 1 certainFolder/ 1.2T certainFolder/
Rather than me have to wait for
rm -rf certainFolder/ can't I just destroy the handle to that directory so its overwrite-able(even by the same dir name if I chose to recreate it) ??
So for e.g. not knowing much about zfs fs internal mgmnt specifically how it maps directories, but if I found that map say for e.g., and removed the right entries for e.g., the directory would no longer display, and that space that the directory formerly held has to be removed from some kind of audit as well.
Is there an easy way to do this, even if on an ext3 fs, or is that already what the recursive remove command has to do in the first place, i.e. pilfer through and edit journals?
I'm just hoping to do something of the likes of
kill thisDir to where it simply removes some kind of ID, and poof the directory no longer shows up in
ls -la and the data is still there on the drive obviously, but the space will now be reused(overwritten), because ZFS is just that cool?
I mean I think zfs is really that cool, how can we do it? Ideally? rubbing hands together :-)
My specific use case (besides my love for zfs) is management of my backup archive. This backup dir is pushed to via freefilesync (AWESOME PROG) on my Windows box to an smb file-share, but also has a version directory where old files go. I'm deleting top level directories that reside in the main backup, which were copied to the version -- e.g.
/san/version/someStuff, as a bi-monthly cleanup of
rm -rf /san/version/someStuff/* from a putty terminal, now I have to open another terminal; don't want to do that every time, I'm tired of uselessly having to monitor rm -rf.
I mean, maybe I should set the command to just release the handle, then print to std out, that might be nice. More realistically, recreate the data-set in a few seconds
zfs destroy san/version; zfs create -p -o compression=on san/version after the thoughts from the response from @Gilles.