I have an rsync.net account that has hit its quota and I'm trying to remove (rm -rf) a directory to clean up space. However all the remove commands I can think of to try (rm, truncate, find -delete, etc.) give me an error related to "Disc quota exceeded".

The only method I've found is to scp an empty file in and overwrite every file in the directory.

Is there any better way to approach this? Ideally a one liner?

1 Answer 1


Have you tried anything with fallocate?

The following will have the same net effect as truncate, but uses a different calling sequence and only works on ext4 and XFS with files that are a multiple of the filesystem block size:

fallocate -c 0 -l `wc -c <file>` <file>

And this will make the file a sparse file of the same (apparent) length as the original file (but only works on ext4, XFS, BTRFS, and tmpfs):

fallocate -p 0 -l `wc -c <file>` <file>

Aside from that, the unlink command might work (but I doubt it as you commented find -delete doesn't work.

Based on what you're saying though, it sounds to me like they're using BTRFS for backend storage, which they should probably not be doing if they need to use quotas (quotas on BTRFS work differently than they do on most other filesystems, and have some pretty significant scalability and usability issues right now).

  • Does allocate work on a directory though? The directory aspect of the question is what's most important to me. I know that scp'ing a zero length file will work. Dunno if it makes any difference but they say their underlying filesystem is ZFS.
    – mpr
    Commented Jan 15, 2018 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .