Nov. 1
November 1st, 2008 -- 1:38 amThere was a tradition I had on the first of the month.
But starting with today, I’m going to be saying goodbye to those traditions and those reasons. October brought so much change in my life… and I think a real change in perspective along with many other things and a few select people that might never know how much they were the cause.
Today is another day like any other day for me now.
Never do I want days like so many of the ones that came before, and I am the only one that can choose for it to be this new, and better, way.
chflags
October 29th, 2008 -- 12:23 amIssues…
I’ve long held that despite “having more computer issues than one should ever have”, all of my issues are either self inflicted to discover how to recover from such an event, or, the are the truly random and annoying things that I wonder how folks ever figure out.
Such is my experience with chflags.
The symptom
My Mac Pro has a zpool with a couple filesystems on it. It also happens that I have reloaded my Mac Pro twice in as many days while playing around with Mac OS X Server (which I gave me grief, the least of which was chime to login screen went from no more than 20 secs to 5-10 minuets.) and then back to Mac OS X 10.5.5 doing a fresh install using the restore DVD that came with my “late-2008″ MacBook Pro (which oddly enough the “About this Mac” window still shows a different build despite identical installs from the same media).
So the filesystem has seen a lot of rather wild and carefree abuse such as:
sudo chown jason:staff /Volumes/Indigo/* sudo chmod -R 775 /Volumes/Indigo/*
Strange thing is, along the way. I got locked out of one of the directories on the drive. Now mind you, “directory” might be a bad term, as it really is just the ZFS mountpoint for a sub-filesystem. If you are familiar with ZFS then the following will explain my setup.
Indigo 961G 661G 658G /Volumes/Indigo Indigo/Aperture 97.2G 661G 97.2G /Volumes/Indigo/Aperture Indigo/Backups 14.6G 661G 447M /Volumes/Indigo/Backups Indigo/Backups/Jasons-MacBook-Pro 381M 661G 381M /Volumes/Indigo/Backups/Jasons-MacBook-Pro Indigo/Backups/ShilohG4 423M 661G 423M /Volumes/Indigo/Backups/ShilohG4 Indigo/Backups/jrm08 15.4M 661G 15.4M /Volumes/Indigo/Backups/jrm08 Indigo/Backups/macpro 7.70G 661G 7.70G /Volumes/Indigo/Backups/macpro Indigo/Backups/powerbookg4 5.51G 661G 5.51G /Volumes/Indigo/Backups/powerbookg4 Indigo/Backups/soekris 170M 661G 170M /Volumes/Indigo/Backups/soekris Indigo/Projects 23.6M 661G 23.6M /Volumes/Indigo/Projects
What does an ls show?
drwxr-xr-x 50 jason staff 1.7K Oct 27 21:37 localdir drw-r--r-- 2 jason staff 68B Oct 29 00:04 Aperture
Hmm, so the permissions are just wrong?
well…
Let’s try to make it right
I only showed above an example of what it looked like, but in my case, all of my ZFS sub-filesystems somehow had their permissions changed to something akin to 0644. The “obvious” fix is to chmod it and everything will be fine right? Ok, lets try that…
$chmod 0755 /Volumes/Indigo/Aperturechmod: /Volumes/Indigo/Aperture/: Operation not permitted
Hmm, thats weird… oh well big deal if I am root right?
$sudo chmod 0755 /Volumes/Indigo/Aperturechmod: /Volumes/Indigo/Aperture/: Operation not permitted
Snap.
Yeah. Maybe this was clear as day to you before reading this entry what I would have to use to solve my problem, but this one took a while. Not only that, but I ran into this a month or two ago, and then pretty much forgot about this issue. Hence, I’m writing this so that I don’t forget again. (or at least have something to refer back to)
The Fix
chflags
You knew that was coming, but how do you use it? Well, the man page will give you some detail but the jist of it is, that you can set flags on files and directories, one of which is a “unchangeable” flag. This flag somehow was getting set after my permission got messed up, and wasn’t being affected by anything that I was trying, terminal and finder.
To set the “unchangeable” flag type:
chflags uchg [filename]
And to remove the “unchangeable” flag type:
chflags nouchg [filename]
Once I unset the “unchangeable” flag I had no issues changing the permissions. Hard to find other folks who have seen this… just hope if you found this you didn’t have to search too hard, or maybe even better yet, maybe this is just a bug with the beta Mac OS X ZFS implementation that has been long since fixed.
What I learned
This goes back to what I started this entry with. My computers will be broken a lot, not because I lack the skills to keep them running all the time, rather I learn nothing with perfect computers (thou I do need something that works despite my best efforts so I use Mac OS X of course. Windows does all the breaking for me and that is just no fun! :P keep in mind I wanted to be a MCSE back in the day… anyhow…)
If nothing else, I now know how to change those flags, as well as other things I tried along the way that although they failed to fix my issues. For example I now know how to use chmod to remove all access control lists from files. I also can set the uchg flag to the GeekTook preference file because although I want most of my preferences to sync, I don’t want that particular one to sync, so if I lock it on each machine, i never have to worry about it changing.
Quite an interesting learning experience indeed… maybe sometime soon I’ll post on how I automate my EC2 recording and s3syncing and all things Amazon Web Services related… or not, depending on how much math and physics homework I have.
Till later!
iPod Ads on YouTube
October 28th, 2008 -- 9:21 pmI usually have adblock running so it’s by chance that I saw this, but I think this is a good use of flash transparency and breaking the border of an ad. It’s not done to be annoying, but it makes it “come alive” in a really nifty and unique way.

Beautiful Icons…
October 27th, 2008 -- 8:53 pmI love Apple designs… it’s not an afterthought even for icons that you only see in a 20×20 pixel section most times, but they started with a much larger image. Just because.
MacBook Pro

Mac Pro

Bad Apple AirPort Update 2008-003, go sit in a corner.
October 22nd, 2008 -- 11:35 pm[UPDATE: Apple AirPort Update 2008-004 seems to be better behaved for me...
but for others, maybe not so much?]
If you happened to install the AirPort Update 2008-003 in the short time it was available, your machine should should be in a useable state… unless you further try and go back to another older kext. I tried and it made it worse… as in it didn’t see my AirPort card at all.
Well, after a bit of messing around, here is what I did to go back…
I used the restore DVD for my late-2008 MacBook Pro, meaning that it includes 10.5.5 so if you are running something else, well, I have no idea if this will work.
1. Don’t know if this first part is required, but it’s part of what I did…
sudo rm /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist
2. What I am pretty certain is needed…
cd /System/Library/Extensions sudo rm -rf AppleAirPort.kext sudo rm -rf IO80211Family.kext sudo rm -rf IONetworkingFamily.kext
I don’t know if the below is the right path as I copy the whole DVD to a partition on my laptop HD for these very reasons So check to make sure it’s right…
sudo cp -R /Volumes/Mac\ OS\ X\ Install\ DVD/System/Library/Extensions/AppleAirPort.kext ./ sudo cp -R /Volumes/Mac\ OS\ X\ Install\ DVD/System/Library/Extensions/IO80211Family.kext ./ sudo cp -R /Volumes/Mac\ OS\ X\ Install\ DVD/System/Library/Extensions/IONetworkingFamily.kext ./ cd /System/Library sudo rm Extensions.mkext
and reboot…
The same thing is posted on the MacRumors Forums, so if the above isn’t working check there for more info…
ZFS Trash
October 21st, 2008 -- 11:06 pmLooking for a simple little shell script to clear out the trash for you since currently Leopard is unable to do so?
Well, don’t blame me if anything goes wrong… cause it works for me. So far…
#!/bin/sh list=`zfs list -o mountpoint -t filesystem | grep -o -E "/(.*)"` for filesystem in $list do rm -rf $filesystem/.Trashes/* rm -rf $filesystem/.Trash/* done
MacBook Pro with ZFS User Directories
October 21st, 2008 -- 12:46 amRequirements
• Two Macs
• The ZFS “target” one being an Intel Mac (might work on PPC, but performance tends to suck in my tests)
• The second being any Mac
• Both must have firewire (you can get around this requirement with external SATA/IDE docks, but that is an option left to the reader)
• Nothing to lose… cause you will likely be erasing the destination machines hard drive
Partition the drive
If you only have one hard drive in your laptop or desktop, you will need to partition it into at least two partitions.
On my MacBook Pro, I have made the internal 320GB into four.
• Mac OS X System & Boot
• ZFS
• Vista
• 9GB for the Mac OS X Install DVD in case of emergency
Once the first stage of installation is complete don’t let it restart and finish the setup process just yet. Instead let the machine restart, but go into target mode by holding down the “T” key until the FireWire logo is displayed.
Prepare the target machine
Copy over the current version of the ZFS files to the new machines HD.
cd /Volumes/{BOOT DRIVE OF MBP}
mkdir ZFS-119
cd ZFS-119/
tar xfvz ~/Downloads/zfs-119bin.tgz
As I hate to modify commands that I already know to work, let us chroot into the folder that “is” the new computer.
sudo chroot /Volumes/{BOOT DRIVE OF MBP}
cd ZFS-119/
Now install the read/write ZFS build. These should always be the same commands as you should find on the wiki. (I’ll try and keep these updated)
sudo cp build/Leopard_Release/zfs /usr/sbin/zfs sudo cp build/Leopard_Release/zpool /usr/sbin/zpool sudo cp build/Leopard_Release/libzfs.dylib /usr/lib/libzfs.dylib sudo /bin/rm -rf /System/Library/Filesystems/zfs.fs /System/Library/Extensions/zfs.kext sudo cp -R build/Leopard_Release/zfs.fs /System/Library/Filesystems/zfs.fs sudo cp -R build/Leopard_Release/zfs.kext /System/Library/Extensions/zfs.kext sudo chown -R root:wheel /System/Library/Extensions/zfs.kext sudo chown -R root:wheel /System/Library/Filesystems/zfs.fs sudo chown -R root:wheel /usr/sbin/zpool sudo chown -R root:wheel /usr/sbin/zfs sudo chown -R root:wheel /usr/lib/libzfs.dylib
Setting up the zpool and filesystems
Run the diskutil command below and make note of what drive and partition you are wanting to make the ZFS zpool with.
diskutil list
Replace the {NN} and {N} with the correct numbers.
sudo diskutil eraseVolume ZFS %noformat% /dev/disk{NN}s{N}
Create the zpool. I don’t want this new filesystem to mount anywhere just yet, so the mount point will be none for now. I think we do this to prevent the “automount on create”, but we shall set the true mount point in the next step.
zpool create -m none Dawson /dev/disk{NN}s{N}
Set the compression, mount point, and optionally then create your home directory. You don’t have to create a new home filesystem, I just do for greater flexibility.
sudo zfs set compression=on Dawson sudo zfs set mountpoint=/Users Dawson zfs create Dawson/jason
Finally, export the pool.
sudo zpool export -f Dawson
Issues & Notes
• There seems to be some oddness when you then continue the install process where some directories aren’t created automatically? I don’t know. Once I created them I haven’t had any issues.
• I don’t know yet what happens if you try and start from the Leopard install DVD which only has read only drivers for the older versions of zfs and zpools. I upgraded mine to the latest versions, but didn’t include those steps above just in case it causes issues down the road.
• So far so good, but there are issues I think. Mostly with emptying the trash, as well as the “all filesystems are named after the root filesystem” strangeness.