symbolic links get corrupted by system process?

Greetings Folks,


This was posted in another forum, so I'm reposting two messages here:


I am having a problem with symbolic links getting corrupted. I have a new Mac Pro running 10.7.3. I have defined symbolic links


/Users/walker/G2S -> /Volumes/L2A/G2S [this is pointing to a different partition on the same JBOD RAID]

/home -> /Users


The second link was created after unmounting /home and removing it from the /etc/auto_master file.


Both symbolic links worked for several days. But then for some reason, without a reboot, the links became corrupted:


> pwd

/Users/walker

> ls -al G2S

lrwxr-xr-x 1 walker staff 16 Mar 24 03:08 G2S -> X??G???Gҡ?G???G

> cd G2S

G2S: No such file or directory.


Same nonsensical definition for /home link. I repeat, this did not happen after a reboot. It first happened on /home. I thought that might have been related to a new OS handling of the "/home" label. So I deleted the /home link and did a clean reboot. The G2S link was created after that reboot, not before.


After the above two problems happened, I created a new symbolic link


/Users/walker/G2S2 -> /Volumes/L2A/G2S


I then did not use this new symbolic link in any of my processing scripts. A few weeks went by, then this link somehow got corrupted too:


lrwxr-xr-x 1 walker staff 16 Apr 2 17:22 G2S2 -> 꺄G???Gĺ?Gú?G


Does anyone here know how symbolic links are managed on a Mac (any process that controls their linking?), or have any information to help me figure out how to fix this? For example, could it be due to bad RAM? I have 32 GB.


Thank you,

Kris Walker

Mac Pro, Mac OS X (10.7.3)

Posted on Apr 20, 2012 3:44 PM

Reply
233 replies

Jan 21, 2013 9:49 AM in response to agorstan

Partition your drive if it's 3TB or larger. I was having system problems constantly up until I partitioned the drive into smaller drives. My symbolic link corruption issues have disappeared. I haven't needed to reinstall OSX since I partitioned. The only problem I'm having now is related to Lightroom 4.2 where every 3-4 days the symbolic links are breaking for different files within the application. This has only been related to Lightroom and not the OS. Maybe it's time for a new disk.

Feb 17, 2013 7:08 PM in response to btcreeper

Partitioning my 3TB Seagate drive (ST3000DM001) did not work for me. Everything seemed fine for a few days, but then Mail.app beachballed while starting up. After that, I found that my Address Book would not autocomplete email addresses when creating a new email message.


I found that the symlink to the AddressBook at this location:

~/Library/Containers/com.apple.mail/Data/Library/Application\ Support was corrupt.


Instead of looking like this:

AddressBook -> ../../../../../Application Support/AddressBook


the symlink looked like this:

AddressBook -> O


This AddressBook symlink has been corrupted at least 3 times since installing Mountain Lion (and upgrading my boot drive to the 3TB Seagate). Interestingly, after the corruption today, I found three items in my trash that I think are related:

a 10 byte file named: O

a 10 byte file named: O 11-39-08-346

a 10 byte file named: O 15-20-04-863

There does not appear to be any content in any of these files (viewed with Textedit).


At this point my plan is to reinstall my old 1TB boot drive and reinstall Mountain Lion clean. I am wondering if Mountain Lion and the drive controllers on these big drives are not cooperating.


This in on a 2008 Mac Pro and I have found the corrupt symlinks problem in various other places in the filesystem. For example, I found several corrupt symlinks to the llvm libraries in this location: /usr/bin/

Feb 27, 2013 12:30 PM in response to jas0nfl0yd

I think I have resolved this issue on my 2008 Mac Pro. I think it was either a bad Mountain Lion install, or a conflict between the 3TB Seagate drive and Mountain Lion.


Here's what I did: I reinstalled my old 1TB drive, did a clean install of Mountain Lion on that drive, and then I used Migration Assistant to copy my data to the old drive. (My apologies to those of you hoping for a more technical solution.)


To anyone who is still experiencing the symlimk corruption, maybe you can try a clean install of Mountain Lion and then migrate your data using Migration Assistant. Since I changed two variables at the same time (hard drive and reinstall) I don't know which of the two solved my problem. Also, if you are finding 10 byte files with funny file names in your trash, you may be experiencing symlink corruption and not even know it (see my post above).


Good luck to everyone.

Feb 27, 2013 12:32 PM in response to sgirard

sgirard wrote:


I think I have resolved this issue on my 2008 Mac Pro. I think it was either a bad Mountain Lion install, or a conflict between the 3TB Seagate drive and Mountain Lion.


Here's what I did: I reinstalled my old 1TB drive, did a clean install of Mountain Lion on that drive, and then I used Migration Assistant to copy my data to the old drive. (My apologies to those of you hoping for a more technical solution.)


To anyone who is still experiencing the symlimk corruption, maybe you can try a clean install of Mountain Lion and then migrate your data using Migration Assistant. Since I changed two variables at the same time (hard drive and reinstall) I don't know which of the two solved my problem. Also, if you are finding 10 byte files with funny file names in your trash, you may be experiencing symlink corruption and not even know it (see my post above).


Good luck to everyone.

Unfortunately for me it definitely appears to be an incompatibility with >1.5 TB drives. I have tried multiple clean installs of both Lion and Mountain Lion, I have even tried running with no third party software/kernel extensions/drivers/etc., but the problem continues to crop up.

Feb 28, 2013 10:33 AM in response to dburr

dburr wrote:


Unfortunately for me it definitely appears to be an incompatibility with >1.5 TB drives. I have tried multiple clean installs of both Lion and Mountain Lion, I have even tried running with no third party software/kernel extensions/drivers/etc., but the problem continues to crop up.


I don't see the problem with a 2 TB drive, but did with a 4 TB drive. I just ordered a MacPro and am planning on running tests with a set of known good 1 TB drives using 2 or 4 drives in Raid 0. If the problem does not occur with either set of 2 drives but does occur with 4 drives that should definitely rule out a hardware issue with the drives.

Mar 10, 2013 1:13 AM in response to ktwalker69

I experience the problem with volumes > 2TB, regardless of RAID configuration. I've tried RAID 0, RAID 1, and no RAID, and the problem keeps coming back if the volume is bigger than 2 TB. I've also tried replacing the drives, and reinstalling Mountain Lion, and changing RAID configurations, many times; the only thing that works for me is having the volume (which may span multiple drives, or not, doesn't matter for me) <= 2TB.

But I want to be more precise: 2TB configurations don't exhibit symlink corruption, and 3TB and 4TB configurations do exhibit symlink corruption. I don't know the exact boundary between "working" and "not" in terms of disk size.


I have a MacPro4,1 (from 2009), and I'm on Mountain Lion.

Mar 10, 2013 12:40 PM in response to marcosw

I wrote:


I don't see the problem with a 2 TB drive, but did with a 4 TB drive. I just ordered a MacPro and am planning on running tests with a set of known good 1 TB drives using 2 or 4 drives in Raid 0. If the problem does not occur with either set of 2 drives but does occur with 4 drives that should definitely rule out a hardware issue with the drives.


Running Mountain Lion on a MacPro3,1 with 4x1TB drives in RAID 0 showed problems within a couple of days:


16 lrwxr-xr-x 1 root wheel 12 Mar 7 15:21 /usr/bin/gcc@ -> m/??S?/.&H?w


I originally ran into this issue several months ago on my iMac when upgrading the 2TB internal drive to 4TB. Since there is nothing duplicated between the two machines, as far as I'm concerned this cannot be a hardware issue.


marcos

Mar 13, 2013 3:57 PM in response to ktwalker69

The problem has come back, very frustrating.


I run this command periodically to see what's broken in the System directory:


sudo find -L /System -type l -print0 |xargs -0 ls -l


Then recreate the symbolic link using:


ln -sf {source} {link}



Lately it's been the java and diskimage frameworks that are screwed up. Does anyone know of a way to monitor a directory or file for changes? For now I'm going to setup a cronjob that checks every 5 minutes to see if I can narrow down the times when this happens then search the logs for activity.


😠@OSX

Mar 14, 2013 9:48 AM in response to btcreeper

My experience is that the only links which become corrupted are those which are read. I.e. on my iMac it was links related to Aperture and Mail and on my MacPro it was gcc and other links related to compiling code. This is precisely what those two machines were used for.


As further evidence I switched to an SSD boot volume and am using the same 4x1TB RAID 0 array that I had problems with for /User and haven't had any problems for 3 days.


btcreeper wrote:

Does anyone know of a way to monitor a directory or file for changes?


You can add the -maxdepth option to find to not search subdirectories, i.e.


sudo find -L /usr/bin -maxdepth 1 -type l -print0 |xargs -0 ls -l


only checks the /usr/bin directory and


sudo find -L /usr/bin/gcc -maxdepth 0 -type l -print0 |xargs -0 ls -l

only check that one file.


I don't think find with -maxdepth 0 is very resource intensive, but if you prefer not using find an alternative for monitoring a single link would be to use ls and grep for the expected link, i.e.:


ls -l /usr/bin/gcc | grep -q llvm-gcc-4.2


This returns an exit status of 0 if the link is okay and 1 otherwise.

Mar 14, 2013 10:28 AM in response to marcosw

My symlink corruption followed the same pattern as yours: links that were read (Address Book) and links used in compiling code (llvm).


It's been almost a month since I went back to my 1TB boot drive and I have not experienced any more symlink corruption.


When I experienced symlink corruption, it was only on the internal boot volume. However just because I didn't notice it anywhere else, doesn't mean it didn't or couldn't happen; I am just not aware of it ever happening on any external drives or internal non-boot drives. I am using several large external drives for backup and file storage. I have done a quick look on those drives for symlinks and didn't find many, so maybe that explains the lack of symptoms on those drives.


Another strange result of the symlink corruption was the appearance of the (3) empty 10 byte files in my trash when corruption occurred (see my post above). I saw this consistently. Has anyone else seen this behavior/symptom? I have not found any more of these files in my trash since downgrading my boot drive to the older 1TB device.


The 3TB drive that exhibited symlink corruption was Seagate model number ST30000DM001 with firmware CC43.

The Mac is a 2008 Mac Pro running Mountain Lion 10.8.2

Mar 14, 2013 3:04 PM in response to ktwalker69

I have a very similar problem, which I posted on the iTunes forum.


On a fairly frequent basis, something on my system is changing this link, which is supposed to point to this:


Syd-Polks-Mac-Pro:~ jazzman$ cd /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/

Syd-Polks-Mac-Pro:Versions jazzman$ ls -l Current

lrwxr-xr-x 1 root wheel 1 Mar 6 21:43 Current -> A

Syd-Polks-Mac-Pro:Versions jazzman$


to something like this:


Syd-Polks-Mac-Pro:~ jazzman$ cd /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/

Syd-Polks-Mac-Pro:Versions jazzman$ ls -l Current

lrwxr-xr-x 1 root wheel 1 Mar 6 21:43 Current -> r

Syd-Polks-Mac-Pro:Versions jazzman$


This produces a Console messge:


03/06/13 9:43:01.186 PM iTunes[533]: Cannot find executable for CFBundle 0x7fa71385e850 </System/Library/PrivateFrameworks/MobileDevice.framework> (not loaded)


The result is that iTunes never sees any connected devices. When I manually change the link back:


Syd-Polks-Mac-Pro:Versions jazzman$ sudo rm Current

Password:

Syd-Polks-Mac-Pro:Versions jazzman$ sudo ln -s A Current

Syd-Polks-Mac-Pro:Versions jazzman$ ls -l

total 16

drwxr-xr-x 9 root wheel 306 Mar 3 00:54 A

lrwxr-xr-x 1 root wheel 1 Mar 6 21:43 Current -> A


things work again for a while, but at some point, it will get corrupted again.


/S/L/PF/AirTrafficHost.framework also had similar corruption.


Any idea what is causing this? It is infuriating!


Also, did Apple address this issue in the 10.8.3 software update?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

symbolic links get corrupted by system process?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.