Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
I tried fixing a problem with Compressor and in so doing messed up my Mac. The recommended solution was to rename the hostconfig file in /etc/ to hostconfig.old. I assume a new hostconfig file should have been created at boot but no luck. Now my Mac opens to a UNIX shell.

I tried going into /etc/ and renaming the hostconfig file but it won't let me as it is read-only. How can I rename this file? I'm not very familiar with Unix but I assume it's a chmode command. Also, I assume I'll need to log in as a root user but when I try that it won't accept my password.

Please help!
 

superbovine

macrumors 68030
Nov 7, 2003
2,872
0
mbuhmann said:
I tried fixing a problem with Compressor and in so doing messed up my Mac. The recommended solution was to rename the hostconfig file in /etc/ to hostconfig.old. I assume a new hostconfig file should have been created at boot but no luck. Now my Mac opens to a UNIX shell.

I tried going into /etc/ and renaming the hostconfig file but it won't let me as it is read-only. How can I rename this file? I'm not very familiar with Unix but I assume it's a chmode command. Also, I assume I'll need to log in as a root user but when I try that it won't accept my password.

Please help!

goto to terminal

Code:
cd /etc/
sudo mv hostconfig hostconfig.bak
 

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
superbovine said:
goto to terminal

Don't have access to Terminal. It boots directly to the UNIX command prompt.

Code:
cd /etc/
sudo mv hostconfig hostconfig.bak

I tried "sudo mv hostconfig.old hostconfig" as I want to rename the .OLD file. I get the error "mv: rename hostconfig.old to hostconfig: Read-only file system"

How do I change the permission of this file?
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
Ahhhh, it sounds like, when you say boots to UNIX, you mean it's in single user mode. And the disk is being mounted as read-only by the filesystem -- it's done this way so that fsck can fix disk problems.

First thing you should try is to run fsck -fy to make sure that it isn't really another filesystem problem that's causing this.

I dunno how to mount the disk read-write manually...

EDIT: if that doesn't help (you should do that anyway), then try this:

Use the command:

mount -u /

at the UNIX prompt, and then do the commands previously recommended. You might need to sudo mount instead.
 

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
mkrishnan said:
First thing you should try is to run fsck -fy to make sure that it isn't really another filesystem problem that's causing this.

I dunno how to mount the disk read-write manually...

I saw that command on another post somewhere and tried it. Nothing is wrong with the system so far as that command can tell. Tried rebooting and it just dropped to UNIX.

Well, thanks for trying to help. I can't even get my copy of Tiger to boot from the DVD. Sheesh.
 

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
mkrishnan said:
Eeep, you replied while I was editing. Please try what I wrote at the end of the previous message. :eek:

Yep... just sitting hear waiting for good folks like you to give suggestions. :) I need this computer back up.

Okay... did "sudo mount -u /"
Then... "fsck -fy"
Get the message everything appears to be okay.
Typed... "reboot"

Drops back to UNIX. I did those steps again minus the reboot and then did the "sudo mv hostconfig.old hostconfig" and get the same error as before: the file is read-only.
 

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
On a side note, I'm convinced it's because the "hostconfig" file is missing. Is there a way to recreate that file from within UNIX? If not, how can I change the "read-only" permission so I can rename the file?
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
mbuhmann said:
Yep... just sitting hear waiting for good folks like you to give suggestions. :) I need this computer back up.

Okay... did "sudo mount -u /"
Then... "fsck -fy"
Get the message everything appears to be okay.
Typed... "reboot"

Drops back to UNIX. I did those steps again minus the reboot and then did the "sudo mv hostconfig.old hostconfig" and get the same error as before: the file is read-only.

Eeep... no. I'm sorry, I'm not being clear. sudo mount the root partition. Then, you should be able to go in and use mv to put your old hostconfig back. Mount makes the disk read/write, which it wasn't, which is why you could not use mv to put your old hostconfig back. I don't think it was a permissions issue.

But if it is a permissions issue, try

sudo chmod 666 [filename]

on both of the files before you replace the file. It's overkill, but then permissions would definitely not be an isssue then.
 

thunderclap

macrumors 6502a
Original poster
Nov 8, 2003
641
1
mkrishnan said:
Eeep... no. I'm sorry, I'm not being clear. sudo mount the root partition. Then, you should be able to go in and use mv to put your old hostconfig back. Mount makes the disk read/write, which it wasn't, which is why you could not use mv to put your old hostconfig back. I don't think it was a permissions issue.

You're a genius Mkrishnan. It worked! Thanks for the tips on how to get my system back up and running. Much appreciated!
 

ITASOR

macrumors 601
Mar 20, 2005
4,398
3
I think you could also have tried booting it into firewire target mode maybe and accessing the HD from another Mac. Glad you got it working, that must have been scary!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.