I have been using rsync over ssh (cygwin) for some time now from a Windows 2003 Server to back up files to a Debian box which has a USB hard drive attached.
The files are rsynced directly to the USB hard drive which is mounted as /media/backup on the Debian box.
The backup is run from a scheduled task on the Windows box and the stdout and stderr are output to files which are emailed to me after the backup completes.
Every now and again I see errors in the stderr file like:
rsync: failed to set times on "/media/backup/[some file name] ": Read-only file system (30)
for every file that has changed since the last backup.
When I see this error I unmount the drive and remount. That resolves the problem.
Can anyone enlighten me as to why this error occurs? i.e. Why would a USB drive become read-only once every couple of months?
The filesystem is being made read-only in response to some error in interacting with it. You should see something come up in
dmesg
and/or/var/log/messages
(or equivalent) before thersync
starts complaining.What file system is on the USB drive? If it is NTFS, it might not have been cleanly unmounted. So the default is generally to mount it read-only until you have run a disk check or until the unclean mount flag is cleared. (Not sure what the flag is actually called).