PDA

View Full Version : Weird link behavior on my filesystem... Gulp!


jmd
05-21-2005, 01:17 AM
Running OS X 10.3.9, and just noticed some problematic looking links in /etc that Hayne suggested I make a post about. I noticed while doing an "ls -l" in /etc that a few files came back as "invalid arguments":

/etc % type ls
ls is /bin/ls
/etc % ls -la > /dev/null [print stderr only]
ls: ./aliases: Invalid argument
ls: ./daily: Invalid argument
ls: ./monthly: Invalid argument
ls: ./resolv.conf: Invalid argument
ls: ./rmt: Invalid argument
ls: ./weekly: Invalid argument

Those file do show up in the ls output, with empty contents:

/etc % ls -l aliases
ls: aliases: Invalid argument
lrwxr-xr-x 1 root wheel 0 13 Jan 11:36 aliases

Note how it has a 'l' in the first column, but no -> destination printed. The only symlink in /etc that isn't fubar'ed like this is localtime:

/etc % ls -l 2>/dev/null|grep '>' [ls all the files, skip error messages]
lrwxr-xr-x 1 root wheel 35 11 May 23:30 localtime -> /usr/share/zoneinfo/America/Chicago


Most frighteningly, I get a bus error trying to file(1) these six files:

/etc % /usr/bin/file resolv.conf
zsh: bus error /usr/bin/file resolv.conf

I'm not sure how Mac's DNS resolution works... from what I know of UNIX, I should be dead in the water without that file. But I see intermittent results from command line utilities:

/etc % host google.com
;; connection timed out; no servers could be reached
/etc % ping google.com
PING google.com (216.239.39.99): 56 data bytes
64 bytes from 216.239.39.99: icmp_seq=0 ttl=237 time=36.262 ms


Come to think of it, my Mac did crash last night, when I tried to plug it into an external monitor. And I noticed another file system oddity earlier, which could very well be nothing, but thought I might include it under the circumstances:

% find ~/Library/Mail/Mailboxes -name mbox -group jmd|wc -l
15
% find ~/Library/Mail/Mailboxes -name mbox -group wheel|wc -l
2

Two of my 17 mailboxes are owned by the wheel group. Only those two files, out of all 131 files in ~/Library/Mail.

Any suggestions?

*starts bailing out data to the old PC before the ship sinks any further*

jmd
05-21-2005, 02:20 AM
A (post-backup) reboot seems to have cleared up the weird symlinks... at least for now:

% ls -l|grep '>'
lrwxr-xr-x 1 root wheel 15 13 Jan 11:36 aliases -> postfix/aliases
lrwxr-xr-x 1 root wheel 24 13 Jan 11:35 daily -> periodic/daily/500.daily
lrwxr-xr-x 1 root wheel 35 11 May 23:30 localtime -> /usr/share/zoneinfo/America/Chicago
lrwxr-xr-x 1 root wheel 28 13 Jan 11:35 monthly -> periodic/monthly/500.monthly
lrwxr-xr-x 1 root wheel 20 13 Jan 11:35 resolv.conf -> /var/run/resolv.conf
lrwxr-xr-x 1 root wheel 13 12 Mar 22:29 rmt -> /usr/sbin/rmt
lrwxr-xr-x 1 root wheel 26 13 Jan 11:35 weekly -> periodic/weekly/500.weekly
% host google.com
google.com has address 216.239.39.99
google.com has address 216.239.37.99
google.com has address 216.239.57.99

Still a little unnerved. And the two mbox files are still owned by wheel.

The occasional hard disk close call is good though. Reminds you to keep up with those backups.

hayne
05-21-2005, 07:57 AM
The occasional hard disk close call is good though. Reminds you to keep up with those backups.
Indeed.
I would recommend a single-user mode boot (hold down Command-S after you hear the chime) and running '/sbin/fsck -fy' to see if any problems turn up.

jmd
05-21-2005, 09:51 PM
Thanks for the diagnostic info hayne. Good to know. fsck said that the "volume bit map" (I think it was) needed "minor repair". Not very informative. But all my data's still around, so it could be worse.

OS X continues to freeze every time I attempt to hook up an external display now. Never had this problem the first few months of ownership. Even if I put it to sleep first, as soon as I tap the keyboard to wake it up, it wakes the monitor for a second, and then the video signal goes dead.

Time to make use of the AppleCare plan I purchased, methinks.

hayne
05-21-2005, 10:00 PM
By the way, here's Apple's doc on filesystem repair:
http://docs.info.apple.com/article.html?artnum=106214

Note in particular the recommendation to immediately repeat the 'fsck' if it finds anything to fix.

As to your monitor problem, run the "Console" application (under /Applications/Utilities) and look for relevant error messages.
If no joy, I would call Apple.