无法将含*.EXE/*.DLL的SVN代码检出至USB存储设备
Alright, let's dig into this tricky SVN checkout issue you're facing with USB drives and executable files. Based on all the details you've shared, here's a structured breakdown of the problem and actionable steps to fix it:
Core Issue Summary
You're hitting a misleading "invalid cross-device link" error when checking out SVN repos with .EXE or .DLL files to USB drives—even though the source and target paths are on the same device. The checkout works flawlessly on local C: drives or network drives, and the problem is isolated to USB storage across Windows 7 Pro and 10. Oddly, two identical Windows 7 Pro machines using the same enterprise account show inconsistent behavior (one works, one fails).
Key Observations
- Both Cygwin SVN and TortoiseSVN throw identical error messages
- Checkout succeeds when targeting local C: drives or network drives mapped via
net use - Problem occurs on both Windows 7 Pro and Windows 10
- Inconsistent results on two identical Windows 7 Pro machines with the same account
- Only
.EXE/.DLLfiles trigger the error; all other files/directories checkout normally - Issue persists across multiple USB flash drives and external hard drives
- Antivirus logs show no interference (ruled out since local drive checkout works)
- No relevant events appear in Windows Event Log after the failure
Error Details
Cygwin SVN Error
svn: E155009: Failed to run the WC DB work queue associated with '/cygdrive/d/BT_HEATSHRINK_000003_0.3.1/test', work item 1 (file-install test/heatshrink.exe 1 0 1 1) svn: E000018: Can't move '/cygdrive/d/BT_HEATSHRINK_000003_0.3.1/.svn/tmp/svn-1AtIka' to '/cygdrive/d/BT_HEATSHRINK_000003_0.3.1/test/heatshrink.exe': Invalid cross-device link
TortoiseSVN Error
Error: Failed to run the WC DB work queue associated with Error: 'D:\BT_HEATSHRINK_000003_0.3.1\test', work item 1 (file-install Error: test/heatshrink.exe 1 0 1 1) Error: Can't move 'D:\BT_HEATSHRINK_000003_0.3.1\.svn\tmp\svn-35B5CA2A' to Error: 'D:\BT_HEATSHRINK_000003_0.3.1\test\heatshrink.exe': The system cannot move Error: the file to a different disk drive.
Critical Note
The error falsely claims a cross-device link, but manual file moves between the same USB drive paths work without issue. The problem is exclusive to USB storage—local and network drives function normally.
Version Info
- Cygwin SVN: 1.10.0 (r1827917)
- TortoiseSVN: 1.10.0, Build 28176 - 64-bit (updated 2018/04/14 08:00:32)
Troubleshooting & Fix Recommendations
Adjust USB Drive Write Caching
- Open Device Manager → Expand "Disk Drives" → Right-click your USB drive → Properties → Policies tab
- Switch to "Quick removal" mode (or uncheck "Enable write caching on the device" if using "Better performance")
- This resolves filesystem-level inconsistencies that SVN might misinterpret as cross-device issues.
Verify USB Drive Filesystem
- Ensure your USB drives are formatted with NTFS (not FAT32 or exFAT). SVN's working copy database has known issues with FAT filesystems, especially when handling executable files with special attributes.
- To reformat: Right-click the USB drive in File Explorer → Format → Select NTFS → Check "Quick Format" → Start.
Disable SVN Atomic Writes
- SVN uses atomic file moves (via
MoveFileExon Windows) which can fail on some USB storage drivers even for same-device operations. - For TortoiseSVN: Go to Settings → General → Subversion configuration file → Edit
- For Cygwin SVN: Edit
~/.subversion/config - Add this line under the
[miscellany]section:use-atomic-writes = false - This forces SVN to use non-atomic file operations, bypassing the false cross-device error.
- SVN uses atomic file moves (via
Update SVN Versions
- Your SVN version (1.10.0) is quite old (2018). Later versions (1.14+) include fixes for Windows filesystem edge cases, especially with USB storage. Try updating to the latest stable release of both TortoiseSVN and Cygwin SVN.
Check Enterprise Group Policy Differences
- Since one Windows 7 machine works and the other doesn't with the same account, compare applied group policies:
- Run
gpresult /h gpresult.htmlon both machines to generate policy reports - Look for policies related to USB storage, file permissions, or executable file restrictions (e.g., blocking .EXE writes to removable media)
- Run
- Since one Windows 7 machine works and the other doesn't with the same account, compare applied group policies:
Test with a Clean Working Copy
- Delete any partial working copies on the USB drive, then try a fresh checkout with the
--no-auto-propsflag to rule out interfering automatic property settings:svn checkout --no-auto-props <repo-url> <usb-target-path>
- Delete any partial working copies on the USB drive, then try a fresh checkout with the
内容的提问来源于stack exchange,提问作者Steven Christensen

