Union remote doesn't switch when first remote is full

I think (ep)lfs in rclone isn't working as designed.

If you read the mergerfs docs then I think it can work exactly as the @Darato wanted.

However it has two very important options minfreespace which sets the minimum free space a drive can have and moveonenospc which moves the file from a full disk to an empty one if it gets an out of space error (ENOSPC)

  • minfreespace=SIZE: The minimum space value used for creation policies. Can be overridden by branch specific option. Understands 'K', 'M', and 'G' to represent kilobyte, megabyte, and gigabyte respectively. (default: 4G)
  • moveonenospc=BOOL|POLICY: When enabled if a write fails with ENOSPC (no space left on device) or EDQUOT (disk quota exceeded) the policy selected will run to find a new location for the file. An attempt to move the file to that branch will occur (keeping all metadata possible) and if successful the original is unlinked and the write retried. (default: false, true = mfs)

Unfortunately we don't have a standardised error code for disk full (maybe we should!) and reading partially written files is generally impossible in cloud storage so we can't implement moveonnospc easily without buffering the file locally.

However I think the minfreespace options is very implementable and provided it was set to bigger than the largest file you wanted to upload it would fix the problem.

What do you think?

2 Likes