大网数据广告活动
服务器运维问答

rsync : write failed - No space left on device (28)

· 52CE 我爱测

I want to rsync a folder from one server to another. But rsync synchronization fails: $ rsync -zr --compress-level=9 --delete /var/www/mywebsite/current/web/js [email omitted]:/srv/data2_http rsync: write failed on "/srv/data2_ht…

问题原文

原帖链接 · Bouffe · CC BY-SA 3.0

I want to rsync a folder from one server to another.

But rsync synchronization fails:

$ rsync -zr --compress-level=9 --delete /var/www/mywebsite/current/web/js [email omitted]:/srv/data2_http
rsync: write failed on "/srv/data2_http/js/8814c77.js": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(322) [receiver=3.0.9]
rsync: connection unexpectedly closed (21747 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]

But I have enough space !

$ du -h /var/www/mywebsite/current/web/js
2.4M    /var/www/mywebsite/current/web/js


df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          5.0G  3.0G  1.8G  64% /
/dev/root       5.0G  3.0G  1.8G  64% /
devtmpfs        2.0G     0  2.0G   0% /dev
tmpfs           395M  132K  395M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            24K   16K  8.0K  67% /var/gandi
tmpfs            24K   16K  8.0K  67% /var/gandi
tmpfs           789M     0  789M   0% /run/shm
/dev/xvdb       202G  168G   25G  88% /srv/data2_http

df -i
Filesystem       Inodes   IUsed    IFree IUse% Mounted on
rootfs           327680   67666   260014   21% /
/dev/root        327680   67666   260014   21% /
devtmpfs         504593     319   504274    1% /dev
tmpfs            504848     224   504624    1% /run
tmpfs            504848       2   504846    1% /run/lock
tmpfs            504848       5   504843    1% /var/gandi
tmpfs            504848       5   504843    1% /var/gandi
tmpfs            504848       2   504846    1% /run/shm
/dev/xvdb      13434880 2152940 11281940   17% /srv/data2_http

社区高分解答

原帖链接 · pedram bashiri · CC BY-SA 3.0

I had the same issue, the destination directory had enough space but I'd get "No space left on device". Turns out rsync copies the file to somewhere else first, then moves it to the destination directory. To change this behavior, use --inplace.

According to https://download.samba.org/pub/rsync/rsync.html "This option changes how rsync transfers a file when its data needs to be updated: instead of the default method of creating a new copy of the file and moving it into place when it is complete, rsync instead writes the updated data directly to the destination file."

 rsync --inplace source destination

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-05-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。