Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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 the rsync starts complaining.

share|improve this answer
add comment

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).

share|improve this answer
    
The USB drive is formatted ext3. –  Stacey Richards Jul 9 '09 at 11:54
    
Hmmmm... I would look at dmesg as chaos said. Maybe something like a journal abort, very well could be a bad drive if you are getting those. Or maybe the USB cable keeps getting yanked. –  Kyle Brandt Jul 9 '09 at 11:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.