Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#314014 - 13/09/2008 00:04 Something erased some of my terminal commands (Mac OS)
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
So I've installed over the past few days XCode 3.1 and iTunes 8. Today I installed the iPhone Configuration Utility (an enterprise config app which I believe is useless for what I wanted it for - another topic).

This last installer, like so many from Apple, obliterates symbolic links for paths it wants to use and replaces them with real folders. Arrrgh, when are they going to fix their POS installer...

I keep apps on a volume other than my boot and in trying to fix my Applications link I was getting errors on the command line. So I list the contents of /bin and this is what I see:

Code:
-r-xr-xr-x      1 root  wheel    46720 Nov 28  2007 [
-rwxr-xr-x      1 root  wheel  1244928 Mar  5  2008 bash
-r-xr-xr-x      1 root  wheel    43296 Mar  5  2008 cat
-r-xr-xr-x      1 root  wheel    56720 Apr 20 14:32 chmod
-r-xr-xr-x      1 root  wheel    56208 Apr 20 14:32 cp
-rwxr-xr-x      1 root  wheel   610864 Sep 23  2007 csh
-r-xr-xr-x      1 root  wheel    56096 Nov 28  2007 date
-r-xr-xr-x      1 root  wheel    59776 Apr 20 14:32 dd
-r-xr-xr-x      1 root  wheel    51424 Apr 20 14:32 df
-r-xr-xr-x      1 root  wheel    38336 Nov 28  2007 domainname
-r-xr-xr-x      1 root  wheel    38320 Nov 28  2007 echo
-r-xr-xr-x      1 root  wheel   114000 Mar  5  2008 ed
-r-xr-xr-x      1 root  wheel    46944 Nov 28  2007 expr
-r-xr-xr-x      1 root  wheel    38416 Nov 28  2007 hostname
-r-xr-xr-x      1 root  wheel    38640 Nov 28  2007 kill
-r-xr-xr-x      1 root  wheel  2103664 Sep 24  2007 ksh
-rwxr-xr-x      1 root  wheel   133312 Apr  3 20:48 launchctl
-r-xr-xr-x@ 65465 root  wheel        0 Dec 11  2007 link
-r-xr-xr-x@ 65465 root  wheel        0 Dec 11  2007 ln
-r-xr-xr-x      1 root  wheel    73696 Apr 20 14:33 ls
-r-xr-xr-x      1 root  wheel    38640 Apr 20 14:33 mkdir
-r-xr-xr-x      1 root  wheel    47696 Apr 20 14:33 mv
-r-xr-xr-x@ 65471 root  wheel        0 Dec 11  2007 pax
-rwsr-xr-x      1 root  wheel    85536 Mar  5  2008 ps
-r-xr-xr-x      1 root  wheel    38400 Nov 28  2007 pwd
-r-sr-xr-x      1 root  wheel    56208 Nov 28  2007 rcp
-r-xr-xr-x@ 65472 root  wheel        0 Dec 11  2007 rm
-r-xr-xr-x      1 root  wheel    38352 Apr 20 14:34 rmdir
-r-xr-xr-x      1 root  wheel  1244960 Mar  5  2008 sh
-r-xr-xr-x      1 root  wheel    38464 Nov 28  2007 sleep
-r-xr-xr-x      1 root  wheel    55744 Sep 23  2007 stty
-r-xr-xr-x      1 root  wheel    38128 Apr  8 22:54 sync
-rwxr-xr-x      1 root  wheel   610864 Sep 23  2007 tcsh
-r-xr-xr-x      1 root  wheel    46720 Nov 28  2007 test
-r-xr-xr-x@ 65472 root  wheel        0 Dec 11  2007 unlink
-rwxr-xr-x      1 root  wheel    38544 Oct  1  2007 wait4path
-rwxr-xr-x      1 root  wheel   982000 Sep 23  2007 zsh
-rwxr-xr-x      1 root  wheel   982000 Sep 23  2007 zsh-4.3.4


It was actually a bit more obscure with 858162 and similar numbers for either owner or group for the files you see that seem to have something wrong with them.

Of course the MAJOR problem is that these files are EMPTY. ln and rm being the two I was trying to use when I noticed the issue.

I have a backupof my complete system I can pull these files from, plus they may also be on the install DVD, but what else is messed up on the system that I don't yet know about?

I know that repair permissions takes some 30 hours to complete on my system due to pretty much ever file on the boot volume firing up an Access Control List error. There are also a lot of files which report some SUID setting that's incorrect but won't be repaired. Ugh.

Leopard has been nothing but a nightmare from day one. I should probably make another backup and then do a clean install without migrating any settings. Then just set everything I need to manually. This is starting to feel like the Windows days.

Any advice? It doesn't help that I'm sleepy as hell right now and can barely keep my eyes open... This will be looked at tomorrow which leaves lots of time for helpful comments. wink
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#314016 - 13/09/2008 00:52 Re: SOmething erased some of my terminal commands (Mac OS) [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
That's wacky. That second column is the number of hard links to that inode. Having over 65000 seems unlikely. I think you have some filesystem corruption.

Try booting into single-user mode (Cmd-S during boot) and running an fsck against your root partition. (Type "mount" in a terminal before you reboot to find out the device name. It'll look like /dev/disk0s2) In fact, I'm pretty sure you definitely need to do this. Your filesystem is almost certainly corrupt.

I'd also download SMART Utility (I'm pretty sure you can run it as a trial) or install smartmontools (MacPorts is probably the easiest method) and see if your hard drive is failing.


Edited by wfaulk (13/09/2008 01:01)
_________________________
Bitt Faulk

Top
#314018 - 13/09/2008 01:11 Re: Something erased some of my terminal commands (Mac OS) [Re: hybrid8]
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5549
Loc: Ajijic, Mexico
Quote:
Leopard has been nothing but a nightmare from day one.


You'd almost think that Leopard was some kind of secret code word for, ummm, distant scenery, no that's not it, oh, yeah, Vista!

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#314023 - 13/09/2008 01:44 Re: SOmething erased some of my terminal commands (Mac OS) [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
The SMART utility claims my disk is failing based on having 8 reallocated sectors and that it's reached 43c (of a max 45) at some point "in the past"

Disk Utility sees the hard link error. I'll reboot from DVD to get that fixed. I hate accessing the drive in this PowerBook. I'm confident the drive is still under warranty as it's probably under a year old, but I have no idea is Seagate does an advance replacement on it. If not I'd have to buy another drive and then use the replacement for something else when I finally get it. frown

Of course they may not even want to replace anything until it actually dies....

_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#314024 - 13/09/2008 01:45 Re: Something erased some of my terminal commands (Mac OS) [Re: tanstaafl.]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
I'm really starting to suspect hardware as well based on your comments here and elsewhere compared to others experiences. Or something really odd that you are doing based on your symbolic links comment.

I do remember getting really strange issues with my old Powerbook when the IDE controller was going out. It was very hard to detect, and a replacement mainboard fixed it. Initially, under certain load, the drive would get remounted read only due to errors detected. The hard drive was replaced, and the system was checked for errors for a while and came up clean. I took the system back, and began having similar issues again.

In the end, the combination of trying to install World of Warcraft off disc, along with being plugged in, and energy saver set to highest performance would reproduce the problem every time. Nothing else, including diagnostic programs found a problem. Something about the high CPU usage along with heavy IO induced the issue. WoW install discs use quite a bit of compression, so the CPU was busy during install.

It's possible your problems started with Leopard doe to a similar issue. Leopard does generally use more CPU time then Tiger with the additional thing added into the OS, and maybe it was enough to trigger the problem.

For the record, this is ny /bin on a 10.5.4 install on an Intel mac:
Code:
-r-xr-xr-x   1 root  wheel    46720 Nov 28  2007 [
-rwxr-xr-x   1 root  wheel  1244928 Mar  4  2008 bash
-r-xr-xr-x   1 root  wheel    43296 Mar  5  2008 cat
-r-xr-xr-x   1 root  wheel    56720 Apr 20 13:32 chmod
-r-xr-xr-x   1 root  wheel    56208 Apr 20 13:32 cp
-rwxr-xr-x   1 root  wheel   610864 Sep 23  2007 csh
-r-xr-xr-x   1 root  wheel    56096 Nov 28  2007 date
-r-xr-xr-x   1 root  wheel    59776 Apr 20 13:32 dd
-r-xr-xr-x   1 root  wheel    51424 Apr 20 13:32 df
-r-xr-xr-x   1 root  wheel    38336 Nov 28  2007 domainname
-r-xr-xr-x   1 root  wheel    38320 Nov 28  2007 echo
-r-xr-xr-x   1 root  wheel   114000 Mar  5  2008 ed
-r-xr-xr-x   1 root  wheel    46944 Nov 28  2007 expr
-r-xr-xr-x   1 root  wheel    38416 Nov 28  2007 hostname
-r-xr-xr-x   1 root  wheel    38640 Nov 28  2007 kill
-r-xr-xr-x   1 root  wheel  2103664 Sep 24  2007 ksh
-rwxr-xr-x   1 root  wheel   133312 Apr  3 19:48 launchctl
-r-xr-xr-x   1 root  wheel    38752 Apr 20 13:33 link
-r-xr-xr-x   1 root  wheel    38752 Apr 20 13:33 ln
-r-xr-xr-x   1 root  wheel    73696 Apr 20 13:33 ls
-r-xr-xr-x   1 root  wheel    38640 Apr 20 13:33 mkdir
-r-xr-xr-x   1 root  wheel    47696 Apr 20 13:33 mv
-r-xr-xr-x   1 root  wheel   218640 Apr 20 13:33 pax
-rwsr-xr-x   1 root  wheel    85536 Mar  4  2008 ps
-r-xr-xr-x   1 root  wheel    38400 Nov 28  2007 pwd
-r-sr-xr-x   1 root  wheel    56208 Nov 28  2007 rcp
-r-xr-xr-x   1 root  wheel    47616 Apr 20 13:34 rm
-r-xr-xr-x   1 root  wheel    38352 Apr 20 13:34 rmdir
-r-xr-xr-x   1 root  wheel  1244960 Mar  4  2008 sh
-r-xr-xr-x   1 root  wheel    38464 Nov 28  2007 sleep
-r-xr-xr-x   1 root  wheel    55744 Sep 23  2007 stty
-r-xr-xr-x   1 root  wheel    38128 Dec 10  2007 sync
-rwxr-xr-x   1 root  wheel   610864 Sep 23  2007 tcsh
-r-xr-xr-x   1 root  wheel    46720 Nov 28  2007 test
-r-xr-xr-x   1 root  wheel    47616 Apr 20 13:34 unlink
-rwxr-xr-x   1 root  wheel    38544 Nov 20  2007 wait4path
-rwxr-xr-x   1 root  wheel   982000 Sep 23  2007 zsh
-rwxr-xr-x   1 root  wheel   982000 Sep 23  2007 zsh-4.3.4

Top
#314031 - 13/09/2008 02:49 Re: Something erased some of my terminal commands (Mac OS) [Re: drakino]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Disk Utility claimed to have fixed the errors. Rebooting showed the /bin file list the same as I posted. I deleted the corrupted files and replaced them (using the commands on the DVD).

Checking the disk with Disk Utility still reported the hard link problems.

I've booted in Safe Mode (am here now) and tried fsck with no luck. Here's the error I'm getting:

Quote:
$ fsck /dev/disk0s3
** /dev/rdisk0s3
BAD SUPER BLOCK: MAGIC NUMBER WRONG

LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y

SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).


Any suggestions? The next web page I open will probably be the local computer shop to check current notebook drive prices. If I have to install a new drive I'm definitely doing a clean Leopard install and will set everything up again manually, copying my data files and applications back manually as well. Joy.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#314032 - 13/09/2008 03:52 Re: Something erased some of my terminal commands (Mac OS) [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Type "mount". If the list of options after "/dev/disk0s3 on /" does not include "read-only", that's your problem. I'm pretty sure you really need to boot into single-user mode in order to do this. And I assume safe-mode isn't single-user mode, as, IIRC, single-user mode puts you at a CLI-only interface and I doubt there's a CLI web browser available. Or network access, for that matter.

If you have another Mac available, you might be able to do it by booting into Firewire target mode and doing an fsck from that machine. The device will be different. You'll probably have to umount the filesystem once MacOS mounts it automatically for you.

If it is already mounted read-only, let us know and we can try to figure out what your alternate superblocks might be, but I don't want to head down that path unless we're sure we need to.
_________________________
Bitt Faulk

Top
#314035 - 13/09/2008 10:26 Re: Something erased some of my terminal commands (Mac OS) [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I'm going to give this another go. I said I was sleepy last night, didn't I? smile I pressed SHIFT-S instead of CMD-S during startup. That's why I was in Safe mode. Didn't do it on purpose obviously.

Supposing the fsck clears up the issues... How much credence should I put in that report from SMART Utility? I don't want the downtime installing a new drive if I can avoid it, but I also don't want my drive to blow up all of a sudden a week or month down the line.

Incidentally, this is the output of mount right now:

Quote:
$ mount
/dev/disk0s3 on / (hfs, local, journaled)
devfs on /dev (devfs, local)
fdesc on /dev (fdesc, union)
/dev/disk0s5 on /Volumes/Play (hfs, local, journaled)
map -hosts on /net (autofs, automounted)
map auto_home on /home (autofs, automounted)


Off to reboot...
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#314036 - 13/09/2008 10:35 Re: Something erased some of my terminal commands (Mac OS) [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Originally Posted By: wfaulk
If it is already mounted read-only, let us know and we can try to figure out what your alternate superblocks might be, but I don't want to head down that path unless we're sure we need to.


Ok, booting in Single User mode did show the mount as read-only. Issuing "fsck /dev/disk0s3" produced the exact same error output as I quoted earlier about the super-block.

How do I go on from here? I do think (from a quick google) that the correct fsck command is /sbin/fsck_hfs for HFS disks though. Let me quickly give that a try...

EDITED/ADDED:

Using the hfs fsck worked - at least it says it checked and repaired. I had to also specify the "-f" flag to force the operation. It first detected it was a journaled filesystem and didn't bother to check it.

A check with Disk Utility still reports an error. "Invalid directory item count" it should be 827 instead of 829. That is the same problem fsck repaired except it said it was repairing a should be 825 instead of 827.

Now I need to go get some breakfast, but I'm starting to prepare myself for having to open up the machine and replace the drive.


Edited by hybrid8 (13/09/2008 11:19)
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#314037 - 13/09/2008 11:46 Re: Something erased some of my terminal commands (Mac OS) [Re: hybrid8]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Quote:
How much credence should I put in that report from SMART Utility?

Treat it as the gospel truth (or better). That information is what the drive firmware records, and there is no better source for accuracy about disk health than the drive firmware itself.

New drive is NEEDED.

Cheers

Top
#314040 - 13/09/2008 14:51 Re: Something erased some of my terminal commands (Mac OS) [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I have occasionally had to run an fsck on a filesystem multiple times before it fixed everything. You might want to try the same. But, really, at this point, you're going to need to replace the drive anyway, and the original data is corrupted, so you'll need a new install, too. There's probably not a lot of point.

Also, I should have told you to run it against /dev/rdisk0s3. It's possible that that's relevant, too.


Edited by wfaulk (13/09/2008 14:53)
_________________________
Bitt Faulk

Top
#314041 - 13/09/2008 17:00 Re: Something erased some of my terminal commands (Mac OS) [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I just did a safety backup and will now start taking apart the machine. Picked up an identical Seagate Momentus 5400.3 160GB drive this morning.

Anyone have any tips about getting quick turn-around from Seagate on a warranty issue like this? I can't really use the "failing" drive for much of anything if I know (or suspect) it can die spontaneously - or for that matter corrupt data without actually dying.

I don't know of any way I'll be able to check the SMART status of any disks that aren't installed in the machine in the future...


Edited by hybrid8 (13/09/2008 17:00)
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top