New Mac, Borked ZFS Permissions

Moderators: jhartley, MSR734, nola

New Mac, Borked ZFS Permissions

Post by shuman » Fri Jan 25, 2013 4:42 pm

I got a new mac yesterday and was excited about how easy it was going to be to boot it up, install ZEVO, plug in my drives and be up and running. I forgot about permissions. :(

I'm mostly up and running now, but I have two issues that are still befuddling me.

1. When I start iTunes I get an error message that says:
Screen Shot 2013-01-25 at 3.32.00 PM.png
Screen Shot 2013-01-25 at 3.32.00 PM.png (33.76 KiB) Viewed 114 times


After I click the OK button, everything seems to be fine. I'm not even sure what it is telling me I don't have privileges for. Permissions appear to be ok on the Music directory. Console only has some vague entries:
Code: Select all
1/25/13 3:32:07.101 PM iTunes[1146]:  AVF KeyExchange Version from driver for Certificates 1


2. I no longer have access to my snapshots. I can make it as far as
Code: Select all
/Volumes/zdata/Users/chris/.zfs/snapshot/2013-01-23-212659/

but then I don't have access. I have tried recursive chown commands, but just end up with a lot of failure messages regarding it being a read-only filesystem.
Screen Shot 2013-01-25 at 3.38.00 PM.png
Screen Shot 2013-01-25 at 3.38.00 PM.png (21.25 KiB) Viewed 114 times


Any ideas?

Machine specs are the same except it's now a Late 2012 Mac Mini
- Mac Mini (Late 2012), 10.8.5, 16GB memory, pool - 2 Mirrored 3TB USB 3.0 External Drives
shuman Offline

User avatar
 
Posts: 96
Joined: Mon Sep 17, 2012 8:15 am

user ID numbers

Post by grahamperrin » Fri Jan 25, 2013 5:01 pm

You'll probably find that on one Mac, your user ID number is different. To discover the number:

  1. System Preferences
  2. Users & Groups
  3. unlock
  4. Control-click the user
  5. Advanced Options…

– but please do not rush to change the number; doing so would require additional changes to the home directory, which should be performed whilst that user is logged out.

On the older of the two Macs, what's your user ID number?
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: New Mac, Borked ZFS Permissions

Post by shuman » Fri Jan 25, 2013 5:18 pm

First an update. I reinstalled iTunes and ran repair permissions. No help.

Graham, I don't know what the old user ID was as I have already wiped the machine and delivered it to it's new owner. Is there a place in my snapshots where I would be able to find the info?
- Mac Mini (Late 2012), 10.8.5, 16GB memory, pool - 2 Mirrored 3TB USB 3.0 External Drives
shuman Offline

User avatar
 
Posts: 96
Joined: Mon Sep 17, 2012 8:15 am

Re: New Mac, Borked ZFS Permissions

Post by shuman » Fri Jan 25, 2013 9:19 pm

Fixed issue #1 with
Code: Select all
sudo chmod -R 1777 /Users/Shared


Any other ideas for taking care of all the snapshots issue with a single command?
- Mac Mini (Late 2012), 10.8.5, 16GB memory, pool - 2 Mirrored 3TB USB 3.0 External Drives
shuman Offline

User avatar
 
Posts: 96
Joined: Mon Sep 17, 2012 8:15 am

mode of /Users/Shared

Post by grahamperrin » Sat Jan 26, 2013 12:49 am

The chmod that you performed on /Users/Shared will probably be corrected when you use Disk Utility to repair permissions.

First let's deal with ownership of the ZFS file system …
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Snapshots are read only

Post by grahamperrin » Sat Jan 26, 2013 1:05 am

shuman wrote:… recursive … commands, but just end up with a lot of failure messages regarding it being a read-only filesystem …


A ZFS snapshot is, by definition, read-only. It's proper for there to be no changes.

If the ZFS file system containing the snapshots is named chris – and if you wish to run commands with recursion on the root of that file system without snapshots – then you can prepare by commanding:

Code: Select all
zfs set snapdir=hidden chris


Hint: it's probably sane to unmount snapshots before attempting to hide things in that way.

At any time afterwards you can:

Code: Select all
zfs set snapdir=visible chris


----

First, though, let's discover the UniqueID number that you used on your previous Mac …
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Discovering the numeric user ID of an item in a snapshot

Post by grahamperrin » Sat Jan 26, 2013 1:16 am

shuman wrote:… the old user ID …


In the following example:

  • my home directory, a ZFS file system, is /Volumes/gjp22
  • the time stamp of the snapshot is 2012-12-08-081957
  • in that snapshot, I want to know the numeric user ID of the owner of ~/Documents

Code: Select all
sh-3.2$ ls -dln /Volumes/gjp22/.zfs/snapshot/2012-12-08-081957/Documents
drwx------  269 19236  0  332 24 Nov 19:28 /Volumes/gjp22/.zfs/snapshot/2012-12-08-081957/Documents


The numeric user ID of the owner of that directory is:

  • 19236
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: New Mac, Borked ZFS Permissions

Post by shuman » Sat Jan 26, 2013 2:17 am

I was 501 now I'm 502. I'll look into it more tomorrow. Thanks for the help so far.
- Mac Mini (Late 2012), 10.8.5, 16GB memory, pool - 2 Mirrored 3TB USB 3.0 External Drives
shuman Offline

User avatar
 
Posts: 96
Joined: Mon Sep 17, 2012 8:15 am

Plan of action

Post by grahamperrin » Sat Jan 26, 2013 6:54 am

OK, so essentially you'll need to do something like this:

  1. identify the current user of ID 501 (probably the first administrator, from when the new Mac was first set up)
  2. give a different ID number to that other user
  3. use an appropriate command (don't rush this) to change ownership of things previously owned by that user
  4. log out
  5. log in as that other user
  6. give 501 to yourself
  7. probably use an appropriate command to change ownership – from 502 to 501 – of things owned by 502.

Output please from the following command, this will help to construct the command for step (c) above:

Code: Select all
ls -ln /Users


Incidentally, there's no borking and issues of this type are not peculiar to ZFS …
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: New Mac, Borked ZFS Permissions

Post by shuman » Sun Jan 27, 2013 10:22 pm

Thanks, Graham. Your method mostly worked. User 501 was switched to a different UID. I then switched my UID to 501. It didn't seem to matter. I still didn't have access to the snapshots. I proceeded with completely deleting my user name from the computer and recreating it ensuring I used UID 501. I did have to run plenty of chowns -R in order to get the active filesystem for my user functioning properly. In the end all my data is fine and owned by me again, yay!

Lesson learned. Make note of UIDs before selling the old computer and make sure users are set up with the same UID on the new computer.

Side note. I understand that for the most part this had little to do with ZFS (which is why I posted in general), so is it acceptable to post questions like this here or should I take them to a different site?
- Mac Mini (Late 2012), 10.8.5, 16GB memory, pool - 2 Mirrored 3TB USB 3.0 External Drives
shuman Offline

User avatar
 
Posts: 96
Joined: Mon Sep 17, 2012 8:15 am

Next

Return to General Discussion

Who is online

Users browsing this forum: ilovezfs and 1 guest

cron