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

Aug 6, 2012 8:31 AM in response to barttenbrinke

I wanted you to repair the disk too, not just repair the permissions. As I said, a symlink is just a text file, so there's not a whole lot to go wrong there. It's possible that Apple Raid is doing something funky with its file system (in which case you might want to try using aliases rather than symlinks) but I would suspect HFS corruption first.

Aug 6, 2012 10:15 AM in response to twtwtw

twtwtw wrote:


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.


Yes, every time this has happened I have booted to recovery and done both a repair disk as well as a repair permissions. The repair disk operation never found any errors, and while repair permissions does catch a few items, I would say it is no more so than one would usually see in a system that's been running for a while.


I have also tried booting single user and running /sbin/fsck -fy, and that doesn't find any errors either.

Aug 6, 2012 2:47 PM in response to barttenbrinke

I'm the guy running with Thunderbolt RAID and Google+.


My system is a Thunderbolt iMac with the single 1TB Western Digital Caviar Black internal disk and a Western Digital My Book Thunderbolt Duo upgraded with two 3TB Seagate Barracuda disks. I use Apple's software RAID to stripe the two disks in the Thunderbolt Duo.


What I have seen is the following:


1) Booting Snow Leopard and Lion off the internal disk does not lead to symlink corruption on the internal disk. Lion was installed by upgrading Snow Leopard.

2) Booting Lion off the Thunderbolt disks does lead to symlink corruption on the Thunderbolt disks. Lion was installed directly from DVD onto clean Thunderbolt disks.

3) Booting Mountain Lion off the Thunderbolt disks does not lead to symlink corruption on the Thunderbolt disks. Mountain Lion was installed directly from a USB disk onto clean Thunderbolt disks.


I have not looked for anything else symlink related. I have noticed problems under Lion with hardlinks though. When the system was under load, the link(2) system call would fail with an error code that it isn't supposed to be able to return indicating that there was a logical error in a data structure passed as a parameter to it. link(2) doesn't take any data structures as parameters, only simple strings. Lion just doesn't work quite right.


Cheers

Aug 6, 2012 2:53 PM in response to twtwtw

twtwtw wrote:


As I said, a symlink is just a text file,

I'm afraid that's not true. A symlink is a simple piece of text, but it is not a text file. I'm pretty sure that in many modern Unixes that short symlink texts are stored directly in the inode without any data space used in the file system at all.


The other thing to remember is that the Mac file system is HFS+, not the Unix file system and everything you (and I) know is wrong. This all smells to me like Apple have added some features to HFS+ to emulate POSIX file systems (maybe that's the + in HFS+) and they have got some of their code very wrong in Lion.


Cheers

Aug 6, 2012 3:27 PM in response to Eurymachos

point taken, but it doesn't really make much difference to my point. there's clearly something odd going on with the directory structure, and the first step in such a case is always to run disk utility.


and the '+' in HFS+ just refers to a file system revision they made a few years back (32-bit addressing, unicode support, etc.). It's been around a good long while and has always played nicely with POSIX.

Aug 6, 2012 4:34 PM in response to twtwtw

twtwtw wrote:


point taken, but it doesn't really make much difference to my point. there's clearly something odd going on with the directory structure, and the first step in such a case is always to run disk utility.

True enough. I'm pretty sure I tried that and it didn't help, but like you say, it is the first thing you should try.


Since only symlinks get corrupted, my guess is that they are stored somewhere special on the disk and they are getting overwritten. That is just a guess though.


Cheers

Aug 13, 2012 11:58 AM in response to ktwalker69

Glad to see I'm not alone. I've noticed in the /usr/ directory more so than anywhere else. Problem started with Mointain Lion upgrade. I'm running an iMac early 2008. Nothing fancy like RAID or JBOD. I was compiling some code with Xcode Command Line Tools and in the next minute my system couldn't find the compiler any more. Reinstalling the XCode Command Line tools fixes it temporarily but it keeps coming back.


Jeff

Aug 13, 2012 12:46 PM in response to Jmanis

Jmanis wrote:


Glad to see I'm not alone. I've noticed in the /usr/ directory more so than anywhere else. Problem started with Mointain Lion upgrade. I'm running an iMac early 2008. Nothing fancy like RAID or JBOD. I was compiling some code with Xcode Command Line Tools and in the next minute my system couldn't find the compiler any more. Reinstalling the XCode Command Line tools fixes it temporarily but it keeps coming back.


Jeff


For me, the symlink corruption occurs in areas of the filesystem related to software that I use frequently. Mail (which is probably my most-used application other than Finder) exhibits this symptom by having the Library/Containers/com.apple.mail/Data/Library/Mail and Library/Containers/com.apple.mail/Data/Library/Application Support/AddressBook links corrupt themselves. Also I see this happen a lot in the symlinks that live within Frameworks (/System/Library/Frameworks/*). This definitely started happening with Lion, and continues to occur in Mountain Lion; I do not remember this happening at all in Snow Leopard or earlier.

Aug 14, 2012 3:21 PM in response to ktwalker69

Interesting. I have SMARTreporter running and it popped up with a I/O error message. I checked Console and saw the following:


8/14/12 3:08:27.648 PM Mail[944]: [EGODatabase] sqlite3_step Failed: (10: disk I/O error) UNKNOWN_ERROR

INSERT INTO tagdata (LibraryID, tags, priority, notes,messageID,serverTagState) VALUES (?, ?, ?, ?, ?, ?)

8/14/12 3:08:27.648 PM Mail[944]: Err 10: disk I/O error

messageID: 44734

8/14/12 3:08:27.649 PM Mail[944]: [EGODatabase] sqlite3_step Failed: (1: cannot commit - no transaction is active) SQLITE_ERROR

COMMIT TRANSACTION


On a hunch I decided to see if Mail had corrupted its symlinks again, and sure enough, it had.


I ran a thorough check of my disk and found no errors. The drive is a few months old and I gave it a good long burn-in so I doubt that the actual drive is at fault. More likely SQlite is (mis)reporting its inability to access the database as an "I/O error."


I'm not sure what, if anything, this says, but it is another data point if nothing else.

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.