2

My macbook recently died and I am currently trying to figure out how to copy my data.

What I did was, I took out the hard drive, put it in an enclosure and plugged it in to my other laptop that runs linux.

The problem is, I cannot copy files from the hard drive due to file permissions. I tried to access the hard drive as root. But I still cannot copy files.

How do I remove file permissions from the harddrive?

6
  • Do you get a permission denied error or something else (i.e. does it look the same when you try to copy as regular user and root, what is/are the message(s)?)? Specific text may be helpful.
    – nerdwaller
    Jul 1, 2013 at 20:52
  • @nerdwaller The error message says "Error while copying "fileName". When I click on more details it says " Error opening file: Permission denied" Jul 1, 2013 at 20:54
  • 2
    What ls -l show (what I am getting at is permissions, owner, & group)? Does it allow you to chown?
    – nerdwaller
    Jul 1, 2013 at 21:42
  • how is it being mounted?
    – Logman
    Jul 1, 2013 at 22:42
  • Seems to me you want to add permissions, not remove them. Jul 1, 2013 at 22:53

1 Answer 1

0

Assuming that your file system is HFS or similar to other Unix filesystem, what you want to do is reset the permissions so that they are accessible. You can't remove permissions, but you can make them more accessible, with security implications of course.

Try the following to add read and execute permissions to all the subdirectories:

sudo find /path/to/external/drive -type d -print0 | sudo xargs -0 chmod ugo+rx

Now all the directories should be readable by all users. The original owner and write bit will be preserved.

Do a similar thing to make all the files readable by everyone and perserving the write/execute bits as well as original owner/group:

sudo find /path/to/external/drive -type f -print0 | sudo xargs -0 chmod ugo+r
2
  • gparted says that the path to the HFS+ parttion is /dev/sdc2. But when I typed in the first command you gave me in the terminal, it says that /dev/sdc2 is not a directory. Jul 1, 2013 at 23:45
  • @user2540416: You have to use the mount point. Type mount (if not found, try /etc/mount) and look for the line than mentions /dev/sdc2. (But surely you already know what the mount point is, if you were able to see the files.) Jul 2, 2013 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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