Symptom
Uploading a file to SCP server on the router, it will fail with "error: Not enough space on device" despite having enough free space in the file system.
Conditions
This issue may occur on routers that have more than 2Gb free space on flash/bootflash.
Workaround
1. Use FTP/TFTP client on the router to transfer the file.
2. allocate space on bootflash, so free space would drop below 2Gb.
Further Problem Description
The issue is due to free space variable having 32bits (signed), thus having free space of (2Gb +1 byte or 4Gb +1 byte) would be reported as 1 byte.
Workaround #2 is based on changing the reported free space, so it would accomodate a file.