Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Country Specific / Australian Mac Group / August 2004



Tip: Looking for answers? Try searching our database.

OS X glitch and UNIX command

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Denis Wright - 19 Aug 2004 08:32 GMT
Having successfully reinstalled OSX (latest) on a friend's computer,
she wished to use 9.2.2 until she got familiar with the OSX
environment. I restarted the computer for her in 9.2.2 and all was
well. Apparently at one point she ran Norton's in 9.2.2 and heaven
knows what "fixes" she did at its bidding. I am blaming that (probably
unjustly) for what followed subsequently. When I went to boot up the
computer in OSX, the UNIX screen came up and said the following:

/etc/master.passwd: not a directory
/etc/master.passwd: not a directory
-sh: /etc/profile: Not a directory
-sh-2.05b#

That's where it stopped. Exiting simply returned to this command. I
could not get an option to restart in 9.2.2 and certainly not to get
into the OSX I installed successfully a few days ago. Trying fsck -y
said that the volume was journaled and  it would need -f to force the
check, which I did, but that didn't clear it.

How do I deal with the command above and regain control of the
computer? This is the second time this has happened. What I don't know
about UNIX fills large manuals....

Denis
Sean McNamara - 20 Aug 2004 00:25 GMT
> Having successfully reinstalled OSX (latest) on a friend's computer,
> she wished to use 9.2.2 until she got familiar with the OSX
[quoted text clipped - 18 lines]
> computer? This is the second time this has happened. What I don't know
> about UNIX fills large manuals....

Hi Denis,

Seen this before - this is not a fix that Apple will tell you (well,
they haven't told my customers who have had this problem)...

You're at the single-user command line when you see the sh-2.05b# but
not quite the same single-user command line you get by holding down
Apple-S on startup. You can still fix this problem, though (this has
worked for me 3 times now - twice with a customer who kept using
Norton's after the first problem, once just last Tuesday where we don't
know what caused it).

The problem is that the symbolic links (read, aliases) that point to the
/private/etc directory (and some others) that normally reside in the
root level of the hard disk have gone AWOL.

Type this command at that prompt:

ls -l /

And look lines that look like

lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 etc -> private/etc
lrwxr-xr-x    1 root  admin          9 18 Aug 13:33 mach -> /mach.sym
lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 tmp -> private/tmp
lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 var -> private/var

If any of those are gone, you'll need to recreate them, which we can
easily do with the following commands:

/sbin/fsck -y
/sbin/mount -uw /
ln -s /private/etc etc
ln -s /mach.sym mach
ln -s /private/tmp tmp
ln -s /private/var var

The first line checks the hard disk, the second mounts it as read and
write so you can create files on the disk (first two lines are mentioned
in a "normal" single-user boot). This is the dangerous part, because you
now have complete access to the HD and can wreck it with a bad rm
command - only use the above commands.

The third to sixth lines recreate the links - only use the lines which
create the links which are missing from the ls -l command before. This
is something I figured out when the first customer had this problem -
they'd already spoken to Apple who only suggested a complete re-install
(thanks but no thanks, Apple). This method is much quicker and easier
and you keep everything else on the HD.

Once that's all done, type this command:

/sbin/reboot

That should be it!

Hope that's of use,

Sean

------------------------------------------------------------------------
Sean McNamara                               mailto:sean@macassist.com.au
MacAssist                                             Ph: (02) 8920 0866
Authorised Apple Solutions Reseller                  Fax: (02) 8920 0877
ABN 95 758 412 281                                  Mobile: 0414 270 132
Denis Wright - 22 Aug 2004 14:23 GMT
> Hi Denis,
>
> Seen this before - this is not a fix that Apple will tell you (well,
> they haven't told my customers who have had this problem)...

Sean - just got home after being away for the weekend - I am very
pleased that you are offering what seems to be the solution for this
problem. I won't be able to check it till tomorrow, but it's the most
promising one I've seen so far.

Many thanks for taking the time and trouble to provide a clear method
of dealing with it. I'll let you know how it goes. If you have had
several cases of this happening then it is very likely there are
others with no idea about how to tackle it.

Much appreciated.

Denis
Denis Wright - 23 Aug 2004 02:44 GMT
Not successful so far, Sean. Here's what happened, step by step.

> > Having successfully reinstalled OSX (latest) on a friend's computer,
> > she wished to use 9.2.2 until she got familiar with the OSX
[quoted text clipped - 27 lines]
> not quite the same single-user command line you get by holding down
> Apple-S on startup.

OK. What I have done as described below was tried both from the
original sh-2.05b# prompt and by rebooting using Apple-S. No luck....

> Type this command at that prompt:
 
> ls -l /
 
> And look lines that look like
>
> lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 etc -> private/etc
> lrwxr-xr-x    1 root  admin          9 18 Aug 13:33 mach -> /mach.sym
> lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 tmp -> private/tmp
> lrwxr-xr-x    1 root  admin         11  2 Jun 23:49 var -> private/var

Mine doesn't look quite like that. Unfortunately, things disappear off
the top of the screen before I can see the first ones (how do you stop
scrolling in UNIX? - I used to know but don't have a clue now.) Any
line beginning with lr looks like this:

lrwxr-xr-x 1 0 80   9 14 August 13.58 mach -> /mach.sym

I don't seem to be at an administrator's prompt. I do notice before
they shoot off the top of the screen that these directories are
preceded with at least 20 lines that say something about master.passwd
- perhaps that it's not a directory....
 
> If any of those are gone, you'll need to recreate them, which we can
> easily do with the following commands:
>
> /sbin/fsck -y

When I do this, the text comes up

** /dev/rdisk0s5
** Root file system
** Checking HFS Plus volume
fsck_hfs: Volume is journaled. No checking performed.
fsck_hfs: Use the -f option to force checking

and then back to the prompt. I have the feeling that this journalling
is the key to the problem here. I have used the -f option before on
this machine, and it says there's no problem.

> /sbin/mount -uw /
> ln -s /private/etc etc
[quoted text clipped - 7 lines]
> now have complete access to the HD and can wreck it with a bad rm
> command - only use the above commands.

I did follow these ln commands above through and it said all those
files were present.

> The third to sixth lines recreate the links - only use the lines which
> create the links which are missing from the ls -l command before.

I'm not exactly sure I follow you here.

> This
> is something I figured out when the first customer had this problem -
> they'd already spoken to Apple who only suggested a complete re-install
> (thanks but no thanks, Apple). This method is much quicker and easier
> and you keep everything else on the HD.

That's what I'd like to do. This has got to have a simple solution.
 
> Once that's all done, type this command:
>
> /sbin/reboot

Rebooting brought me back to the same screen from which I can't
proceed.

Is there perhaps some little step that would be obvious to a
programmer but which I've missed?

As I said before, I am very grateful for what help you have given so
far. Nice to know someone else out there had the same problem!

Denis
Sean McNamara - 23 Aug 2004 09:55 GMT
> Not successful so far, Sean. Here's what happened, step by step.

I'll leave my originals in there for context, sorry for the resultant
padding, folx.

> > > Having successfully reinstalled OSX (latest) on a friend's computer,
> > > she wished to use 9.2.2 until she got familiar with the OSX
[quoted text clipped - 53 lines]
> preceded with at least 20 lines that say something about master.passwd
> - perhaps that it's not a directory....

Rereading your original post, I think this is a variation of the problem
I've already seen - I think that the symlinks have been corrupted by
NUM, and are no longer valid symplink - the similar problem I've seen is
where the symlinks have been deleted by NUM.

Try this

ls -l / | /usr/bin/grep lrw

That should just bring up the symbolic link files ro seeing if they're
all there already.

> > If any of those are gone, you'll need to recreate them, which we can
> > easily do with the following commands:
[quoted text clipped - 12 lines]
> is the key to the problem here. I have used the -f option before on
> this machine, and it says there's no problem.

OK, so we'll accept that's OK for now. I don't think the jorunalling is
the problem.

> > /sbin/mount -uw /
> > ln -s /private/etc etc
[quoted text clipped - 10 lines]
> I did follow these ln commands above through and it said all those
> files were present.

I would then rm the 4 symlinks (after doing the mount command) - they
sound like they're already present (and you can confirm by the above
grep'ed ls -l command):

rm etc
rm mach
rm temp
rm var

This won't remove the actual files pointed to by the symplinks, as
confirmed by rm's man page ("The rm utility removes symbolic links, not
the files referenced by the links").

You can then use my original ln -s commands to recreate the links.

> > The third to sixth lines recreate the links - only use the lines which
> > create the links which are missing from the ls -l command before.
>
> I'm not exactly sure I follow you here.

I just meant that if there was a tmp symlink already present, don't
recreate it. Given they're all there but non-functional, the above
deletion will prevent an "already present" error message.

> > This
> > is something I figured out when the first customer had this problem -
[quoted text clipped - 16 lines]
> As I said before, I am very grateful for what help you have given so
> far. Nice to know someone else out there had the same problem!

No, no step you've missed, just a variation on my original procedure to
suit your circumstances, which were different to what I thought they
were.

Hope that works - let me know how it goes.

Regards

Sean

------------------------------------------------------------------------
Sean McNamara                               mailto:sean@macassist.com.au
MacAssist                                             Ph: (02) 8920 0866
Authorised Apple Solutions Reseller                  Fax: (02) 8920 0877
ABN 95 758 412 281                                  Mobile: 0414 270 132
Denis Wright - 24 Aug 2004 04:09 GMT
...attempted to give advice which was greatly appreciated, but which
didn't do the trick.

Hi Sean. The problem seems to be in the

/etc/master.password: Not a directory

part of it. When I started to follow through your next set of
instructions, the grep command turned up two files, preceded by about
60 identical lines that read /etc/master.passwd: Not a Directory. Any
attempt to make the subsequent changes seems blocked by this command.
I think that if that master.passwd function can't be detoured around
or zapped, I can't proceed. Do you have any ideas on that? I can
detail the sequence of responses by the computer to your last set of
instructions if you like, but they all boiled down to that things
couldn't be removed.

ls -l / | /usr/bin/grep lrw  resulted in

/etc/master.password: Not a directory  [repeated approx 60 times]
lrwxr-xr-x   1 0    80     15 22 Oct  2003  Desktop (Mac OS 9) ->
/Desktop Folder
lrwxr-xr-x   1 0    80      9 14 Aug 13:58 mach ->  /mach.sym

Running the mounting commands tells me that all 4 files exist.

Running the rm commands brings up the following:

/etc/master.password: Not a directory
override rwxr -xr-x  0/80 for etc?

I said y and the line comes up
rm: etc: Read-only file system

ditto for the others. That's why I think that master.passwd problem is
causing it. Trying to recreate the links using ln -s thus doesn't
work, and a reboot brings me back to the same ole problem!

Can't tell you how much I appreciate your advice so far. I am sure if
you had the computer in front of you you'd have it sorted in ten
minutes, but I am grateful for your going through these laborious
hoops to try to hep.

With best wishes,

Denis
Eric Hood - 24 Aug 2004 23:31 GMT
If the items in question look like aliases when in OS 9 what you can do
is easy if you have access to another computer with the same version of
OS X on it.

Delete the items that look like aliases and copy them from the second
computer to the original.

You will need to be booted into OS 9 to make it easy to see the files
if you don't want to use the terminal to copy the files.

Once you drag the files over then reboot the computer and all will be
well.

You will notice the new files will not be aliases when copied.

Burn the norton disc. This is probably why they are not making
Utilities for macintosh any more.

You can use target disc mode to mount the faulty drive.

or you could reinstall X after deletingthe faulty items.
Sean McNamara - 24 Aug 2004 23:47 GMT
> If the items in question look like aliases when in OS 9 what you can do
> is easy if you have access to another computer with the same version of
[quoted text clipped - 17 lines]
>
> or you could reinstall X after deletingthe faulty items.

Overall, I find it much more reliable to recreate the links in Mac OS X,
even if it is in the command line and single user mode. It makes sure
everything is "just right".

I also prefer recreating the links to re-installing OS X, which is way
overkill for this problem.

Some versions of Norton's are fine - but in this case, I agree that the
Norton's disk used should be remove from the computer in question.

Sean

------------------------------------------------------------------------
Sean McNamara                               mailto:sean@macassist.com.au
MacAssist                                             Ph: (02) 8920 0866
Authorised Apple Solutions Reseller                  Fax: (02) 8920 0877
ABN 95 758 412 281                                  Mobile: 0414 270 132
Currawong - 29 Aug 2004 00:35 GMT
> Having successfully reinstalled OSX (latest) on a friend's computer,
> she wished to use 9.2.2 until she got familiar with the OSX
[quoted text clipped - 20 lines]
>
> Denis

Your friend probably used an old version of nortons that changes the
names of all files that start with a period ".".  Best to re-install
OSX and burn the Norton's disk.  I say, forget the gradual "getting
familiar with osx" thing and switch over in one hit.  It'll take her a
month or two to get entirely used to it, but it will save the pain of
problems if running OS9 causes damage to the OSX files while running
(eg: by crashing and stuffing up the file system, specially as OSX
filesystems are now journalled).

Amos
Sean McNamara - 29 Aug 2004 02:12 GMT
> Your friend probably used an old version of nortons that changes the
> names of all files that start with a period ".".

I disagree - the problem is with broken symbolic links, not the name of
files.

> Best to re-install OSX and burn the Norton's disk.

I disagree with this, too - remedial steps are possible which maintain
the existing OS X installed. It's just a matter of fine-tuning the
steps. Re-installing OS X can be a real pain in the arse.

> I say, forget the gradual "getting
> familiar with osx" thing and switch over in one hit.  It'll take her a
> month or two to get entirely used to it, but it will save the pain of
> problems if running OS9 causes damage to the OSX files while running
> (eg: by crashing and stuffing up the file system, specially as OSX
> filesystems are now journalled).

I agree with this, although for different reasons. Not had much problem
with OS 9 spoiling an OS X installation (except, as previously noted, by
older versions of Nortons). Just from a user experience point of view,
it's better to make the break and switch entirely to OS X.

Regards

Sean

------------------------------------------------------------------------
Sean McNamara                               mailto:sean@macassist.com.au
MacAssist                                             Ph: (02) 8920 0866
Authorised Apple Solutions Reseller                  Fax: (02) 8920 0877
ABN 95 758 412 281                                  Mobile: 0414 270 132
Denis Wright - 29 Aug 2004 12:57 GMT
> In article <413116cb@duster.adelaide.on.net>,

> I agree with this, although for different reasons. Not had much problem
> with OS 9 spoiling an OS X installation (except, as previously noted, by
> older versions of Nortons). Just from a user experience point of view,
> it's better to make the break and switch entirely to OS X.

Once again, thanks for the advice from all quarters. Someone suggested
starting in OS 9 but I repeat that this option is now blocked. The
irony is that the person I was helping wanted to make a clean break
with OS9 but is not particularly computer savvy, and once I installed
OSX decided she'd better finish doing some work in OS 9 over the
weekend before I gave her lessons in OSX, because she was a bit fazed
by the new look of OSX. What I didn't know or expect at the time was
that she would decide to run Nortons - God knows why! - on OS 9, and I
am willing to bet that she did indeed allow Nortons to mess with the
hidden files with dot extensions.

When I solve this problem (and regrettably, in spite of your good
advice, none of the suggestions have worked), Nortons will be removed
entirely from the computer, you can be certain of that!

Denis
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.