From: laredotornado on
On May 2, 10:25 pm, Barry Margolin <bar...(a)alum.mit.edu> wrote:
> In article
> <fad896ad-af67-4839-bf37-8b1978b10...(a)h9g2000yqm.googlegroups.com>,
>
>  laredotornado<laredotorn...(a)zipmail.com> wrote:
> > Hi,
>
> > I'm using Mac 10.6.3.  I'm logged in as the "davea" user who has sudo
> > privileges.  However, I have corrupted my /etc/sudoers file and
> > accidentally given it 710 permissions.  I'm trying to change it back
> > to 440, but I repeatedly get
>
> > davea-mbp2:apache2 davea$ sudo chmod 440 /etc/sudoers
> > sudo: /etc/sudoers is mode 0710, should be 0440
> > Segmentation fault
>
> > Any ideas how to restore the perms?  Thanks,  - Dave
>
> Boot into single-user mode, by pressing Cmd-S when you reboot. You have
> root permissions then, so you can just use chmod.
>
> --
> Barry Margolin, bar...(a)alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***

Barry, I booted into single user mode per your suggestion but when I
ran the command "chmod 440 /etc/sudoers", I got the error

chmod: Unable to change /etc/sudoers: Read-only file system

JF, found what you were talking about but the "Local" checkbox (which
was checked) was grayed out and I was unable to access it, even when
the lock was unlocked. - Dave
From: David Empson on
laredotornado <laredotornado(a)zipmail.com> wrote:

> On May 2, 10:25 pm, Barry Margolin <bar...(a)alum.mit.edu> wrote:
> > In article
> > <fad896ad-af67-4839-bf37-8b1978b10...(a)h9g2000yqm.googlegroups.com>,
> >
> > laredotornado<laredotorn...(a)zipmail.com> wrote:
> > > Hi,
> >
> > > I'm using Mac 10.6.3. I'm logged in as the "davea" user who has sudo
> > > privileges. However, I have corrupted my /etc/sudoers file and
> > > accidentally given it 710 permissions. I'm trying to change it back
> > > to 440, but I repeatedly get
> >
> > > davea-mbp2:apache2 davea$ sudo chmod 440 /etc/sudoers
> > > sudo: /etc/sudoers is mode 0710, should be 0440
> > > Segmentation fault
> >
> > > Any ideas how to restore the perms? Thanks, - Dave
> >
> > Boot into single-user mode, by pressing Cmd-S when you reboot. You have
> > root permissions then, so you can just use chmod.
> >
> Barry, I booted into single user mode per your suggestion but when I
> ran the command "chmod 440 /etc/sudoers", I got the error
>
> chmod: Unable to change /etc/sudoers: Read-only file system

When you get to the command prompt in single user mode, the text just
before that explains that the hard drive is mounted read-only, and gives
instructions on how to mount it with read/write access.

The recommended method is to run fsck (File System ChecK) first, to
ensure nothing is corrupted (with -fy options, which force a check even
if journalling is enabled, and answers yes to any requests to fix
problems it finds), then use the mount command to enable write.

fsck -fy
mount -uw /

After doing those two, you should be able to do the chmod.

> JF, found what you were talking about but the "Local" checkbox (which
> was checked) was grayed out and I was unable to access it, even when
> the lock was unlocked. - Dave

You misunderstood JF's instructions. Repeated here:

> JF Mezei wrote:
> > Click on the lock to authenticate. then select "Local". Then, in the
> > EDIT menu, you will have options to enable the root account and/or
> > chsnge its passowrd. You can disable it there once you are done.

You aren't supposed to uncheck Local, just click on the word "Local" to
select that line. Only the checkbox is disabled, not the rest of the
line.

It appears that step isn't necessary - I have an "Enable Root User" in
my Edit menu after unlocking the padlock. I didn't need to select Local.

--
David Empson
dempson(a)actrix.gen.nz
From: =?ISO-8859-1?Q?Kir=E1ly?= on
Lewis <g.kreme(a)gmail.com.dontsendmecopies> wrote:
> Since OS X uses a journaled file system and has for quite a while this
> step is not needed.

Journaling may indeed reduce the chance of corruption of the directory
or the filesystem, but it certainly does not guarantee against it.

--
K.

Lang may your lum reek.
From: David Empson on
Lewis <g.kreme(a)gmail.com.dontsendmecopies> wrote:

> In message <1jhy2dq.1d3l5ivkrv39iN%dempson(a)actrix.gen.nz>
> David Empson <dempson(a)actrix.gen.nz> wrote:
> > The recommended method is to run fsck (File System ChecK) first, to
> > ensure nothing is corrupted (with -fy options, which force a check even
> > if journalling is enabled, and answers yes to any requests to fix
> > problems it finds), then use the mount command to enable write.
>
> Since OS X uses a journaled file system and has for quite a while this
> step is not needed.

One would think so, but on occasion it (or the equivalent "Repair Disk"
in Disk Utility) has found and fixed a problem.

--
David Empson
dempson(a)actrix.gen.nz
From: D Finnigan on
Lewis wrote:
> In message <1jhy2dq.1d3l5ivkrv39iN%dempson(a)actrix.gen.nz>
> David Empson <dempson(a)actrix.gen.nz> wrote:
>> The recommended method is to run fsck (File System ChecK) first, to
>> ensure nothing is corrupted (with -fy options, which force a check even
>> if journalling is enabled, and answers yes to any requests to fix
>> problems it finds), then use the mount command to enable write.
>
> Since OS X uses a journaled file system and has for quite a while this
> step is not needed.
>

I run my hard drive 90% or more full nearly all of the time. Once a month I
do a fsck and there's nearly always the wrong free block count. Fortunately,
it's always been too low rather than too high. I shudder to think if it ever
were the opposite...

--
Mac GUI Vault - A source for retro Apple II and Macintosh
computing.
http://macgui.com/vault/