2

I am using Ubuntu to transfer data from an XFS-formatted drive to a HFS+ formatted drive over USB. Problem is whatever I do, these files get write-protected and I cannot change their permissions.

I am aware that the default UID of Ubuntu is 1000 where it is 501 on Mac, so I changed my Ubuntu UID to 501 as described in this guide.

Now the permissions seems right, and when I do a ls -n, I am told that the UID is 501 and the group is 20 and the permissions are rwxrwxrwx, which is exactly the same as on my other USB-drive which is working perfectly.

But for some reason I still cannot edit the files. I am told to authenticate and when I do so, nothing happens.

If I copy the files to some other volume in Finder, they are no longer write-protected, which makes me think that there could be something fishy about the USB-drive I am copying to. I had to format it HFS+ (non journaled) for Ubuntu to be able to write to it.

Could that mean something? Files copied to the volume from Finder on the Mac are not locked, but files copied through Ubuntu are.


Just did some further testing and realized that a sub-folder of one of the folders I had copied contained some pictures which I could write to without problems, but video-files at the same level as the original folder where all locked... both the video-files and the pictures had 501/20 as ownership/group. Also a few of the files which where locked actually had the "locked"-badge on them, and I was able to remove the checkmark in the properties of the file, but nothing happened and when I checked properties again, it was still there. But then again - other video-files which where locked did not have the badge in the first place... something is genuinely messed up here??!

Btw. I am regularly testing everything out on another Mac running Snow Leopard Server and the issues are the same.


Last update:

Tried doing rsync over ssh as suggested below, tried renaming the user in ubuntu so that both the username, the "long name" and the UID matches OSX - no progress.

Spent the last 14 hours trying to solve this - tired, going to bed now. Last resort is to copy everything of the ubuntu disk as it is now and then copy it to another USB-drive from the mac (when I copy back and forth between the desktop issues seems to be solved). Only drawback is that I need to go buy another hard drive to copy the 1.5TB off the ubuntu box and spend another 2 days copying files :-/


Final solution:

Since none of the suggestions people came up with here managed to solve the problem, I ended up buying another 2TB hard drive, copied the files from ubuntu to the HFS-formatted disk, connected 2 drives to my mac and copied the files again from the HFS-formatted disk to a HFS (journaled)-formatted disk. Problem solved. As I found the only way around this was to copy files around in the mac environment. Once a file had been copied once, the permission-issues where solved.

4
  • Did you check the permissions on the volume?
    – Yitzchak
    Jul 27, 2011 at 20:29
  • Most of the files I try to edit are rwxrwxrwx and they are all (apparently) owned by me and editable by my group (and others). But in reality I cannot edit them - that's what makes it so strange. It seems something is happening "beyond" the permissions system or that the permissions are in reality not what terminal or "get info" tells me?
    – zkwsk
    Jul 28, 2011 at 0:22
  • getfacl .? --
    – Hello71
    Jul 28, 2011 at 1:02
  • Consider posting this as answer to your question. While further information would be placed in yourpost, posting an answer and accepting it by clickingthe checkmark next to it is a good idea when the topic has no further use. Otherwise it'll get bumped to the frontpage for attention in the future.
    – Daniel Beck
    Aug 5, 2011 at 18:23

2 Answers 2

1

I suspect that Ubuntu treats files of UID < 1000 as system files.

I would transfer the files as root using rsync over ssh:

rsync -avp -e ssh root@srcmachine:/path/to/src/files destination/dir

If the user and group names are the same, then the uids will be remapped. uids may be transferred unchanged using --numeric-ids switch.

rsync will also work between file systems, and not just over the network.

1
  • I had some ssh-issues but I managed to solve those, so I deleted the comment, but now I did what you told me and the result is the same. Random files unresolvable locked - some with a lock icon in Finder - others without. All files still have UID/GID 501/20.
    – zkwsk
    Jul 27, 2011 at 22:43
1

Make yourself the owner of the files.

sudo chown -R ${LOGNAME}:${GROUPS} /path/to/copied/files
2
  • yes, at the end of the day this is the desired result. Jul 27, 2011 at 23:50
  • Problem is I am already the owner, but I still cannot delete or edit files, no matter if I sudo or not. Only way to get rid of them again is to format the volume. This is a short extract of what ls -l shows when copied to the external volume ("zaki" is my user and "zaki" (UID 501) is member of "staff" (GID 20): -rw-r--r-- 1 zaki staff 897 21 Nov 2010 kommandolinje.jar -rw-r--r-- 1 zaki staff 83 23 Nov 2009 nxj.cache -rw-r--r--@ 1 zaki staff 519192 28 Mar 16:36 src -rw-r--r--@ 1 zaki staff 24938 4 Jan 2011 template-b.html
    – zkwsk
    Jul 28, 2011 at 0:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .