sh-2.05a# at startup??

lvlarc_uk

Registered
Hey please help I have no clue what to do here, first things first, I turned on iMac and went for a pee, came back and screen was black, said something like Darwin login or something, I can't remember as I panicked (never seen this before) think it said incorrect password.

So I restarted and now basically everytime I turn on my iMac after the mac loading screen appears, it freezes then I get a "sh-2.05a#" message top left of screen.

Last time I was on iMac was about a week ago, and it worked fine, all I did was copy a video file onto HD, and watched it then shutdown computer.

I've tried google, and came across commands such as "fsck -y" tried that, & it said hard disk appears to be ok. I've tried booting up OS on disc to use the repair drive feature but still I get problem, so do you have any idea how I can fix this as I really dont wanna have to do a system reboot :( :( thanks in advance.
 
This is the Darwin "shell prompt" and it should only be appearing if you hold down the "s" key during bootup to boot into the shell. When you say you copied a video file onto the HD and watched it then shutdown, do you mean that it shut *itself* down without you telling it to shutdown? If so, did you delete any files or folders to make room for the video file?

You may need to boot from CD and do an "archive & install" which will keep a backup of your previous system before installing a clean system.
 
So if you hold down the "c" key when you reboot with the system CD inserted, you _still_ get to the Darwin shell you mentioned?
 
No I don't get the Darwin message anymore, just the sh-025a# at every startup, and I'm not pressing any keys either also I didn't delete any files before copying the video to HD and yes I shut it down myself...
 
Try this;

type this at the sh-2.05a# prompt:

sh-2.05a# mount -u -o rw /

Then you can copy the /etc/hostconfig~ file to /etc/hostconfig

sh-2.05a# cp /etc/hostconfig~ /etc/hostconfig
sh-2.05a# exit
 
Wait, what's the answer to Fryke's question? What exactly happens when you boot up with the OS X disk inserted (and while holding down the "c" key)?
 
Yes I said I booted up from OS disc, tried the repair drive feature, it said this drive is ok but still at startup the sh-05a# message is there...OS booted off disc fine, didn't get the sh-05a' message, gave me choice if doing an install but chose not to.

Is there anything else I can do from OS disc, or are there any other imac programs I can download and burn onto disc to try and fix problem? Like a system mechanic (i don't use imac much)

I'll try what you said bob, will post results tomow.
 
Try this;

type this at the sh-2.05a# prompt:

sh-2.05a# mount -u -o rw /

Then you can copy the /etc/hostconfig~ file to /etc/hostconfig

sh-2.05a# cp /etc/hostconfig~ /etc/hostconfig
sh-2.05a# exit

Hey I tried that, nothing happens after I do the mount command, then tried the

cp /etc/hostconfig~ /etc/hostconfig

says no such file or directory.

Are you sure you typed commands right? cheers
 
When you're at the shell prompt, try

ls /etc/hostconfig*

Let us know what you see.

On a normal system you'd see /etc/hostconfig and its previous version, /etc/hostconfig~. Bob's suggestion is to copy the previous version to the current and try restarting.

/etc/hostconfig is a file specifies whether to start a lot of basic services on your machine. Mine, for instance, looks like this:

AFPSERVER=-NO-
AUTHSERVER=-NO-
AUTOMOUNT=-YES-
CUPS=-AUTOMATIC-
NFSLOCKS=-AUTOMATIC-
NISDOMAIN=-NO-
TIMESYNC=-YES-
QTSSERVER=-NO-
WEBSERVER=-YES-
SMBSERVER=-NO-
SNMPSERVER=-NO-
SPOTLIGHT=-YES-

#Added by me
FTPSERVER=-YES-
HOSTNAME=mattholford.com
SSHSERVER=-YES-
POSTGRESQL=-YES-
DNSUPDATE=-YES-

CRASHREPORTER=-YES-
MYSQLCOM=-YES-
ENCRYPTSWAP=-YES-
 
hmm ok I did that..it says...

/etc/hostconfig.applesaved /etc/hostconfig.old


then sh-2.05a# prompt again.

also i tried that "mount -u -o rw/" again and it said this..

root_device on / (local, read only)
devfs on /dev (local)
 
Interesting. Why don't you try this:

cp /etc/hostconfig.applesaved /etc/hostconfig
exit

If there's no file named /etc/hostconfig, then that's definitely going to cause a problem on startup. The one named /etc/hostconfig.applesaved was created by an Apple OS update process at some point, which should also have created a new /etc/hostconfig. But it didn't, apparently.
 
Thanks but did that and got...

cp: /etc/hostconfig: Read-only file system


Someone said it's possible to do a system reinstall, and still keep all my files and documents, is this true? Also whats the latest OS for iMac? cheers
 
Right. Because first you need to mount the filesystem. Look at bobw's first post. You should follow the three steps in the same order, but use my second step instead of his.

sh-2.05a# mount -u -o rw /
sh-2.05a# cp /etc/hostconfig.applesaved /etc/hostconfig
sh-2.05a# exit
 
When I do "mount -u -o rw /" nothing happens, however I tried it with no space.... "mount -u -o rw/" and it says this.

/dev/disk0s5 on / (local)
defs on /dev (local)

I then did the "sh-2.05a# cp /etc/hostconfig.applesaved /etc/hostconfig"

and got this.... disk0s5 I/O error.


Any idea?!? Also I heard about a programme called diskwarrior, do you think this could repair drive? thanks
 
You know what? I have to apologize, because I didn't double-check that mount command. The mount that's on my machine takes slightly different flags. Please try this, if you're willing to try again:

sh-2.05a# mount -u -w /
sh-2.05a# cp /etc/hostconfig.applesaved /etc/hostconfig
sh-2.05a# exit

Let's talk about the mount command for a sec, and what it's doing. What we want to do is mount your main disk to be readable and writable before you copy the hostconfig file. The mount command says this:

-u: Update the status of this disk
-w: Make this disk writable
/: Mount the disk usually located at "/" (the top-level directory)

There should be a space between each of these arguments: "mount SPACE -u SPACE /".

See if this works. If you don't want to mess with this anymore, Diskwarrior is effective at fixing most problems.
 
Thanks again but after typing the mount command, nothing happens, go on to type the cp command and it says I/O error.

I'm downloading diskwarrior now, it's a .dmg file so not sure how I'd go about burning that on a PC. I'll just try burning it as a data disc, as Nero doesn't support .dmg images. Cheers
 
Back
Top