Strange cp problem : cp: failed to extend ... permission denied
Hello All,
My wife has an external hard drive formatted as NTFS. I need to transfer the data on it to another drive. Most of the files are Word, PPT or PDF files and most of them copy without problem. However, several give an error (e.g.) "cp: failed to extend ‘./History Essay Outlines.docx’: Permission denied" I have spent hours on this! I have mounted the drive (on my Fedora 20 box). I have chmod'ed I have chown'ed. I have done this as me (user = mark) and as root. Always the same result Code:
[root@ArthurDent ~]# ls -la /mnt/tmp/School/IB\ Resources/Cold\ War/Essay\ Plans/ Thanks in advance... |
The first error "cp: error reading ‘/mnt/tmp/School/IB Resources/Cold War/Essay Plans/History Essay Outlines.docx’: Permission denied" should be the culprit.
This looks odd for root... But it is possible there is a quota restriction on the "mark" account that prevents the extension as the destination file belongs to mark. Perhaps running out of disk space? |
No, Disk space is not an issue. I have tried copying this file (and others like it) to my home drive, to a USB stick (and even another directory on the same NTFS dive). All of them have plenty of space (well, certainly enough for a 147k word document).
Any other ideas? |
Quote:
One way to avoid this would be to use the --sparse=never option with cp. Personally, I would be slightly suspicious as to the integrity of the source disk and/or filesystem and would (i) replicate the disk in case of data loss during phase ii (although that would need a lot of space), (ii) fsck the source disk, including searching for bad blocks. |
Thanks - Some useful info that I didn't know about. Unfortunately however that does not appear to be the problem:
Code:
[root@ArthurDent ~]# cp --sparse=never /mnt/tmp/School/IB\ Resources/Cold\ War/Essay\ Plans/Essay_Outlines_detailed.docx /home/mark/temp/ I don't think it is a disk integrity problem. This error occurs only on certain files, but I think all those files are originally from the same source (my wife thinks she got these while attending a conference several years ago). Could it be some sort of encryption? |
Quote:
Have you tried copying the file using rsync (I'm not sure whether this uses an underlying call to cp or not) or another Linux copy alternative? The idea would be to find a copy command that approaches the problem differently. Or perhaps try a Windows copy command? If disk integrity is a problem, it might only affect a few files. I would run a filesystem and badblock check on your source disk if I were you. An encrypted file is still just a file, so I'd wager that it isn't that. |
Ah yes - rsync - didn't think of that...
I'm not too familiar with rsync, but here goes... (is this the best syntax to use?) Code:
[root@ArthurDent ~]# rsync -a /mnt/tmp/School/IB\ Resources/Cold\ War/Essay\ Plans/ /home/mark/temp/ I'm going to try tar next... [edit] Nope... Code:
[root@ArthurDent ~]# tar -cf test.tar /mnt/tmp/School/IB\ Resources/Cold\ War/Essay\ Plans/* |
Well that takes us back to the Permission Denied problem. Can you try accessing the files from a Windows machine? (they could be locked, or I may have been wrong about the encryption possibility)
|
Well I don't have a Windows machine in the house, but the reason I am doing this is that yesterday I sat with my wife at her work (Windows 7) machine, trying to copy these files off the external HD and onto a USB stick.
We got the same error on the Windows machine (well, a similar error about permissions - I didn't write down the exact wording of the message). |
Well - that makes it sound like a media problem.
|
If you could find a Windows system to try the copy on, and post the exact error message here, then it may well cast light on the problem.
It may not be up your street, but running a Windows 7 VM on your Linux system is a great way to examine problems like this where a physical Windows machine isn't to hand. Also, run a read-only fsck on the external drive. |
All times are GMT -5. The time now is 06:25 PM. |