Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Apr 20, 2012 5:22 PM in response to etresoft

Thanks for the quick response. I umounted /home before removing from automaster, deleting, and making the /home symbolic link point to /Users. After the signs of the first problem with home and G2S, I deleted the /home link.


Here is what it looks like now.


>cat /etc/auto_master

#

# Automounter master map

#

+auto_master # Use directory service

/net -hosts -nobrowse,hidefromfinder,nosuid

/Network/Servers -fstab

/- -static

mast:/Users/walker>mount

/dev/disk0s2 on / (hfs, local, journaled)

devfs on /dev (devfs, local, nobrowse)

/dev/disk4 on /Volumes/L2A (hfs, NFS exported, local, journaled)

map -hosts on /net (autofs, nosuid, automounted, nobrowse)


I did a reboot after all that, and before creating the latest G2S2 link that recently became corrupted.


Kris

Apr 21, 2012 12:51 PM in response to ktwalker69

ktwalker69 wrote:


I misspoke slightly. / is on its own disk, not the RAID that /Volumes/L2A is on. So I doubt the problem seen with /home -> /Users reflects a RAID issue.


/ is the root directory and has no disk. Any directories under / could be mount points for other volumes.


I did not execute that command.


It is not optional. Changing an active automount point without flushing the cache could lead to unpredictable results.


Does anyone know which process controls the symbolic linking on Macs? Is there a process, or is this a built-in kernel function?


There is no specific process. It is part of the HFS+ file system. Technically, symbolic links are just hacks in the HFS+ file system. It is quite old and was not designed for such things.


I say boot into your recovery volume and repair your file systems.

Apr 21, 2012 3:20 PM in response to etresoft

"Root directory" is unambiguous language. / is more descriptive, at least to me.


Your command is one way of achieving the same result as what I did with a reboot to follow. And no, the "-v" argument is not "critical" or "non-optional".


Symbolic links are very useful constructs that I'm thankful wise people at Apple decided not to hack away from the BSD core they used for OSX.


Thanks anyway for your text.


Kris

Apr 21, 2012 6:02 PM in response to ktwalker69

ktwalker69 wrote:


Your command is one way of achieving the same result as what I did with a reboot to follow. And no, the "-v" argument is not "critical" or "non-optional".

No, the "verbose" flag is not optional, but the rest of it is. Rebooting would do the same thing as long as you did everything in the proper sequence. You would have to change the config files, reboot, then change the directories. It is a risky operation anyway because any system update could reset those config files. It is best to define your own mount points.


Symbolic links are very useful constructs that I'm thankful wise people at Apple decided not to hack away from the BSD core they used for OSX.

Sorry, but here is not BSD core in MacOS X. There is a mach core and there is a BSD compatibility layer.

Aug 2, 2012 12:10 PM in response to ktwalker69

I am seeing the exact same problem on my Mac Pro Early 2008, and NO RAID or JBOD or other non-standard disk type is involved. Unfortunately there seems to be no rhyme or reason to the symlink corruption (at least none that I can detect). I remember it started happening right around the time I went from Snow Leopard to Lion (note I did a clean install, NOT an upgrade). I don't recall if this issue happened while running Snow Leopard. And unfortunately it is still happening in Mountain Lion (happened just this morning as a matter of fact).

Aug 2, 2012 1:04 PM in response to dburr

How clean is clean? I wrote a little diagnostic program to help show what might be causing some problems. Download EtreCheck from http://www.etresoft.com/download/EtreCheck.zip, run it, and paste the results here. Ideally, start your own thread and paste the results there.


Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

Aug 5, 2012 2:41 PM in response to ktwalker69

We are experiencing the exact same problems. A Mac pro with raid 0+1 configuration. We first noticed the problem with Lion. Then when Mountain Lion came out we did a complete clean install. (restored the install esd image to an external disk and booted from that, formatted the raid completely and installed mountain lion). Now it turns out we have the exact same symbolic link corruption going on again...


We are trying to narrow down the root cause. We have tried to create a disk image and formatted that hfs ( not hfs+ ) and mount that. On the disk image we do not get the corruption o.O this to me is kind of strange since the disk image is on the same file system / raid as the os. So far we are guessing it has to do with the raid and hfs+ but if that would be the case then a lot more people should have had this problem right ?


We also got into contact with apple enterprise about this but they have never encountered this problem before and have no idea what to do about it.


To exclude faulte memory we did run several mem tests and they all turn out successfull.


Anyways please let us know if you want us to test something to get to the bottom of this problem so we can solved it not only for us but for all other people having the same problem.

Aug 6, 2012 12:59 AM in response to Smeevil

Hardware Information:

Mac Pro - model: MacPro5,1

2 2.93 GHz 6-Core Intel Xeon CPUs: 12 cores

32 GB RAM


System Software:

OS X 10.8 (12A269) - Uptime: 4 days 8:54


Disk Information:

HL-DT-ST DVD-RW GH61N


USB Information:

Apple Inc. BRCM2046 Hub

Apple Inc. Bluetooth USB Host Controller


FireWire Information:


Kernel Extensions:


Problem System Launch Daemons:

[failed] com.apple.emond.aslmanager.plist

[failed] com.apple.xprotectupdater.plist


Problem System Launch Agents:

[failed] com.apple.afpstat.plist


Launch Daemons:

[loaded] homebrew.mxcl.memcached.plist

[loaded] homebrew.mxcl.redis.plist

[loaded] org.macosforge.xquartz.privileged_startx.plist


Launch Agents:

[loaded] org.macosforge.xquartz.startx.plist


User Launch Agents:


User Login Items:

None


3rd Party Preference Panes:

None

Internet Plug-ins:

JavaAppletPlugin.plugin

QuickTime Plugin.plugin


User Internet Plug-ins:


Bad Fonts:

None


Top Processes:

6.9 % screensharingd

6.7 % ScreensharingAgent

1.5 % WindowServer

0.9 % opendirectoryd

0.5 % fontd

0.5 % CoreRAIDServer

0.5 % EtreCheck

0.3 % mds

0.2 % redis-server

0.2 % ps



The broken symlink results are for example :


osxsrv:/usr/local/Cellar/Cellar admin$ sudo find -L . -type l

./bazaar/2.5.1/bin/bzr

./rbenv/0.3.0/bin/rbenv



lrwxr-xr-x 1 admin admin 42 Aug 2 11:50 bzr -> ?????]i????????]i????????]i????????]i?????

lrwxr-xr-x 1 admin wheel 16 Dec 26 2011 rbenv -> %?%

Aug 6, 2012 7:12 AM in response to Smeevil

Just out of curiosity, have you booted into the recovery partition and run Disk Utility to verify the disk and its permissions? Symkbolic links are just files (small files that contain a POSIX path to the target), so if a symlink is corrupted it suggests that the symlink file is corrupted, which in turn suggests some more pervasive HFS corruption.

Aug 6, 2012 7:26 AM in response to twtwtw

Verifying permissions for “server”

Permissions differ on “System/Library/Frameworks/CoreGraphics.framework/Headers”; should be lrwxrwxrwx ; they are lrwxr-xr-x .

Permissions differ on “usr/include/arpa/nameser.h”; should be lrw-r--r-- ; they are lrwxr-xr-x .

Group differs on “Library/Java”; should be 0; group is 80.

Permissions differ on “Library/Java”; should be drwxr-xr-x ; they are drwxrwxr-x .

Group differs on “Library/Preferences/com.apple.alf.plist”; should be 80; group is 0.

Permissions differ on “System/Library/Frameworks/CoreGraphics.framework/CoreGraphics”; should be lrwxrwxrwx ; they are lrwxr-xr-x .

Permissions differ on “System/Library/Frameworks/CoreGraphics.framework/Resources”; should be lrwxrwxrwx ; they are lrwxr-xr-x .

Permissions differ on “System/Library/Frameworks/CoreGraphics.framework/Versions/Current”; should be lrwxrwxrwx ; they are lrwxr-xr-x .

Permissions differ on “usr/bin/what”; should be -rwxr-xr-x ; they are -r-xr-xr-x .

Permissions verification complete


So nothing strange going on there either, so I just went ahead and fixed these permissions.

My guess is that it there is some problemen somewhere in HFS+ / Kernel / Raid controller firmware combination.


This is becomming a very expensive problem for us. We cant use our new Mac Pro server in production as it 'randomly' garbles it's symlinks.

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 ID.