/bin/tar: Cannot utime: Read-only file system
While doing a tar backup on my servers, I get this error:
Code:
/bin/tar: /usr/local/bin/sendEmail: Cannot utime: Read-only file system I'd like to know why tar is trying to "utime" my files and how I can stop that behaviour if possible? This is my tar command: Code:
tar cjf /mnt/backup/backup.tar.bz2 --label='backup_090116' --atime-preserve --no-wildcards-match-slash --files-from=/root/backup.include --exclude-from=/root/backup.exclude |
I'd like to know the answer to this myself, so please post back when you find the solution. :)
|
The --atime-preserve defaults to --atime-preserve=replace, so that tar just remembers the previous access time and restore it after reading files. In this case the utime system call is attempted to change the access time of the inode. You can try the option --atime-preserve=system to avoid changes of the access time, but there are some caveats. Here an excerpt from the tar manual:
Quote:
|
Thansk for the answer colucix -- very comphrehensive :)
I've changed my script (Kernel 2.6.27 so I should be right) and see how it goes tonight. Otherwise I'll remove the option completely - I'm not that fussed about keeping the atime, so if it's going to cause errors, I'll leave it out Will report back after the next backup has run :) |
Quote:
--atime-preserve=replace (default) simply restores the previous access time, --atime-preserve=system does not change the access time at all. So if you leave it without the --atime-preserve option, the access time will be actually updated and most likely you will get the same error. I suggest to do a test in real time (without waiting for the scheduled job execution) and see if the suggested option works. Otherwise we should re-think the entire issue to find a workaround. |
try this
chmod 755 /bin/tar :$ |
Quote:
|
Quote:
As the file system is mounted read-only, nothing should be able to change any content or attribute. Specifically, tar's reading shouldn't change atime. Hence no need to "utime" it back to what it was before. /Quigi |
Changing --atime-preserve to --atime-preserve=system has solved the problem. I wanted to avoid removing it totally if possible because there's other path's not in /usr that aren't read-only.
Adding =system has solved the problem. Thank-you very much colucix :D |
[SOLVED] /bin/tar: Cannot utime: Read-only file system
Whoops, forgot to mark as solved. Done now :)
|
Quote:
|
All times are GMT -5. The time now is 09:35 AM. |