I am copying a number of large files (50-500MB each). What I'm observing is that rsync continues to think it's syncing files even when df reports no disk space left. (Or actually, it reports some amount less than the next file to be synced.) When I noticed this happening, I hit Control+C on the rsync process, and only then did it suddenly report it was out of disk space, reporting the file it ran out of disk space on was about 20 files back!

I've got a lot of RAM so I assume that everything is not getting synced to disk right away, but wouldn't the file system have to keep track of used space in RAM to know when it's out of space even though the actual data hadn't been written? The fact that df shows there is no disk space left would seem to support this assumption.

In case it makes a different, this is on a Linux box running rsync between two NTFS formatted drives.

How do I get rsync to immediately fail when I run out of disk space?


If there is no longer disk space, then rsync should report a failure.

If you are running rsync as root, you must know that on some systems, the root user benefits of disk space that is not available for the average user. The latter will get a 100% use with df while the root user will still have 1 to 5% available for their own use.

I cannot tell anything for NTFS. But, with ext4 for example, you can get the amount of reserved blocks with the dumpe2fs command:

dumpe2fs -h /dev/sd... | grep ^Reserved
  • I'm not running rsync as root, but strangely enough I do notice that I am able to use up to every available block... this may be because it's NTFS though. – Michael Feb 18 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.