Re:A faster way to delete millions of files in a directory
by akeck on Friday May 31, 2013 @11:03PM
(#5802463)
Interesting. Some time ago we had to regularly clear a directory with many files in an ext2 file system. We ended up mounting a separate small volume at the point in the VFS. When we needed to clear it, we would just make a new file system on the volume.
[ Parent
| on HN ]
Re:A faster way to delete millions of files in a directory
by cnvogel on Saturday June 01, 2013 @06:31AM
(#5803469)
Yes, that's for sure the smartest way to deal with it, if you have such a specific requirement. New filesystems (zfs, btrfs) with their sub-volumes also make that much easier, because they can dispose of subvolumes, and recreate them very fast.
# btrfs subvolume create foobar Create subvolume '/btrfs/foobar'
### now do all kinds of atrocities in this filesystem
# btrfs subvolume delete foobar Delete subvolume '/btrfs/foobar'