当在 Linux 上使用 RSYNC、CP 或 DD 向 Windows SMB 共享传输文件时,文件大小会达到 6.3 GB 中的 2.0 GB,并且会显示错误提示“文件太大”。
自从禁用 Windows 共享上的 SMB1 以来,这种情况就开始了。我已在 Linux 上使用 SMB 2.1 重新映射共享fstab
。
Linux SERVERNAME 3.8.13-68.2.2.el6uek.x86_64 #2 SMP Tue May 12 15:10:51 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux
rsync version 3.0.6 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
我尝试过--partial-dir
,它确实将文件放在了部分目录中,但是当您尝试再次运行它以恢复它时,文件不会恢复。它重新开始。
[root@SERVERNAME dpdump]# rsync -av --progress --partial-dir=.rsync-partial /u01/dpdump /BackupFolder
sending incremental file list
dpdump/
dpdump/PD20181119.dmp
2084536320 31% 113.23MB/s 0:00:39
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/BackupFolder/dpdump/PD20181119.dmp": File too large (27)
rsync error: error in file IO (code 11) at receiver.c(301) [receiver=3.0.6]
rsync: connection unexpectedly closed (303 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
我曾尝试使用block-size
并protocol
来自另一篇 SO 帖子,但仍然不起作用。
[root@SERVERNAME dpdump]# rsync -av --progress --partial-dir=.rsync-partial --block-size=108485760 --protocol=29 /u01/dpdump /BackupFolder
building file list ...
220 files to consider
dpdump/
dpdump/PD20181119.dmp
1998913536 29% 187.58MB/s 0:00:24
rsync: writefd_unbuffered failed to write 4092 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/BackupFolder/dpdump/PD20181119.dmp": File too large (27)
rsync error: error in file IO (code 11) at receiver.c(301) [receiver=3.0.6]
rsync: connection unexpectedly closed (577 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
我已尝试append-verify
按照手册页的建议进行操作,但它并没有恢复文件,而是覆盖并从 0 开始。
[root@SERVERNAME dpdump]# rsync -av --progress --append-verify /u01/dpdump /BackupFolder
sending incremental file list
dpdump/
dpdump/PD20181119.dmp
2147549183 32% 33.88MB/s 0:02:10
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/BackupFolder/dpdump/PD20181119.dmp": File too large (27)
rsync error: error in file IO (code 11) at receiver.c(301) [receiver=3.0.6]
rsync: connection unexpectedly closed (302 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
尝试使用 处理 1GB 文件,成功了dd
。尝试使用 处理 3GB 文件,dd
失败了。它停在 2.1 GB 处。
# dd if=/dev/zero of=/BackupFoldertest.img count=1 bs=1G
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 13.8795 s, 77.4 MB/s
# dd if=/dev/zero of=/BackupFoldertest.img count=1 bs=3G
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB) copied, 28.625 s, 75.0 MB/s
#
显示的是之前运行正常的 rsync。当我在 Windows 共享上禁用 SMB1 时,它停止了。2018 年 12 月 10 日的 rsync 就坏了。
答案1
可能是目标磁盘上的文件系统问题(FAT16 格式?)。在磁盘上,卷或文件的最大大小以及每个卷的最大文件数取决于用于格式化卷的文件系统。https://www.genie9.com/Support/KB/KnowledgeArticle.aspx?KBID=113