Re: fsck: broken file system with background check remains broken after bootup

2005-01-05 Thread Oliver Fromme
Craig Boston <[EMAIL PROTECTED]> wrote:
 > On Tuesday 04 January 2005 9:57 pm, Wilkinson, Alex wrote:
 > > How can I confirm that ACPI has been setup to do this ?
 > 
 > Hmm, well, the easiest thing to check is to run
 > 
 > sysctl hw.acpi.power_button_state
 > 
 > and see if that sysctl exists and if so, what it's set to (mine is S5, which 
 > IIRC is complete power-off).  Also, check dmesg and see if you see a line 
 > similar to
 > 
 > acpi_button0:  on acpi0
 > 
 > If both of those show up, chances are that your ASL has a power button entry 
 > and it should do the right thing.  Other than that, you could always wait 
 > until the system is idle and just try hitting the button to see what 
 > happens ;)

I'd recommend to quit all applications (particularly X11),
then forcibly re-mount all filesystems to read-only (using
"mount -ufo ro ..."), then press the power button.  That
way no harm will be done to the filesystems if it doesn't
work.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
-- Doug Gwyn
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-05 Thread Michael Nottebrock
On Wednesday, 5. January 2005 04:29, Wilkinson, Alex wrote:
> 0n Tue, Jan 04, 2005 at 02:01:22PM +0100, Oliver Fromme wrote:
> >By the way, you can map a key combination (Ctrl-Alt-Del or
> >something else) to the »halt« or »power-down« functions,
> >using kbdcontrol, so it's very easy and intuitive to shut
> >down the machine properly.  See the kbdmap(5) manpage for
> >details.
>
> This inspires me to ask this question:
>
> Is it possible to set up FreeBSD to do a clean shutdown upon a pressing
> the power button ?

It already does out of the box.

-- 
   ,_,   | Michael Nottebrock   | [EMAIL PROTECTED]
 (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org


pgpxrjgx3AfpI.pgp
Description: PGP signature


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Wilkinson, Alex
0n Tue, Jan 04, 2005 at 10:17:47PM -0600, Craig Boston wrote: 

>On Tuesday 04 January 2005 9:57 pm, Wilkinson, Alex wrote:
>> How can I confirm that ACPI has been setup to do this ?
>
>Hmm, well, the easiest thing to check is to run
>
>sysctl hw.acpi.power_button_state
>
>and see if that sysctl exists and if so, what it's set to (mine is S5, 
which 
>IIRC is complete power-off).  Also, check dmesg and see if you see a line 
>similar to
>
>acpi_button0:  on acpi0
>
>If both of those show up, chances are that your ASL has a power button 
entry 
>and it should do the right thing.  Other than that, you could always wait 
>until the system is idle and just try hitting the button to see what 
>happens ;)

Cool, thanks:

#sysctl hw.acpi.power_button_state
hw.acpi.power_button_state: S5

#grep acpi_button /var/run/dmesg.boot 
acpi_button0:  on acpi0

 - aW
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Craig Boston
On Tuesday 04 January 2005 9:57 pm, Wilkinson, Alex wrote:
> How can I confirm that ACPI has been setup to do this ?

Hmm, well, the easiest thing to check is to run

sysctl hw.acpi.power_button_state

and see if that sysctl exists and if so, what it's set to (mine is S5, which 
IIRC is complete power-off).  Also, check dmesg and see if you see a line 
similar to

acpi_button0:  on acpi0

If both of those show up, chances are that your ASL has a power button entry 
and it should do the right thing.  Other than that, you could always wait 
until the system is idle and just try hitting the button to see what 
happens ;)

Craig
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Wilkinson, Alex
0n Tue, Jan 04, 2005 at 09:50:10PM -0600, Craig Boston wrote: 

>Yes, in FreeBSD 5.3 if ACPI is enabled and working properly, pressing
>the power button will initiate a graceful shutdown (similar to shutdown
>-p).  This feature is enabled by default if it is available, so you
>don't have to do anything special to get it.

How can I confirm that ACPI has been setup to do this ? 

# acpidump -d | grep 

 - aW
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Craig Boston
On Wed, Jan 05, 2005 at 01:59:01PM +1030, Wilkinson, Alex wrote:
> This inspires me to ask this question:
> 
> Is it possible to set up FreeBSD to do a clean shutdown upon a pressing
> the power button ? i.e. in the same fashion as Solaris does out of the
> box.  Is this an ATX feature or a kernel feature in the PC world ?

Yes, in FreeBSD 5.3 if ACPI is enabled and working properly, pressing
the power button will initiate a graceful shutdown (similar to shutdown
-p).  This feature is enabled by default if it is available, so you
don't have to do anything special to get it.

The usual "if you have weird hardware there are no guarantees"
disclaimer applies, but I've never had a problem with the software
controlled power button on any fairly recent hardware.

Craig
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Wilkinson, Alex
0n Tue, Jan 04, 2005 at 02:01:22PM +0100, Oliver Fromme wrote: 

>By the way, you can map a key combination (Ctrl-Alt-Del or
>something else) to the »halt« or »power-down« functions,
>using kbdcontrol, so it's very easy and intuitive to shut
>down the machine properly.  See the kbdmap(5) manpage for
>details.

This inspires me to ask this question:

Is it possible to set up FreeBSD to do a clean shutdown upon a pressing
the power button ? i.e. in the same fashion as Solaris does out of the
box.  Is this an ATX feature or a kernel feature in the PC world ?

 - aW
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Freddie Cash
On January 4, 2005 03:25 am, Rob wrote:
> Thanks for your replies, but apparently I didn't make my point
> clearly. Let me try again:
>
> If the system ends with a bad filesystem, the background check may
> leave the system unusable after bootup. For a FreeBSD guru this is
> indeed easy to fix (single user mode, rescue floppies, live CDs
> bootup etc.).
>
> However, the main user of this particular PC is not at all a guru; on
> 4.10 I had rc.conf configured such that at bootup all filesystems
> would be automatically fixed with: fsck_y_enable="YES".
> With 4.10, this always worked nicely, whatever sudden power cut have
> happened.
>
> However, with 5.3, a recent powercut crippled  the /usr filesystem
> such that X11 hanged. The user of this PC was convinced that FreeBSD
> was infected by a virus :(.
>
> An automatic fsck could have fixed the system (I eventually did it
> manually in single user mode), but the background check left the
> system broken.
>
> So I want to configure 5.3 similar to former 4.10: a full automatic
> fix of all filesystems at bootup, in case the system was not properly
> shutdown. How can I do that?

As with FreeBSD 4.x, all rc.conf options are listed 
in /etc/defaults/rc.conf.  Read /etc/defaults/rc.conf and put the 
appropriate fsck options into /etc/rc.conf.

What you want to do is disable background fsck, giving you the same 
behaviour as with 4.x,
-- 
Freddie Cash, CCNT CCLPHelpdesk / Network Support Tech.
School District 73 (250) 377-HELP [377-4357]
[EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Matthias Andree
Matthias Andree <[EMAIL PROTECTED]> writes:

> OTOH, I am not convinced that fsck (particularly bgfsck) is bug-free,
> I

Make that "fsck and ufs are bug-free"...

-- 
Matthias Andree
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Oliver Fromme
Rob <[EMAIL PROTECTED]> wrote:
 > [...]
 > However, the main user of this particular PC is not at all a guru; on 4.10
 > I had rc.conf configured such that at bootup all filesystems would be
 > automatically fixed with: fsck_y_enable="YES".
 > With 4.10, this always worked nicely, whatever sudden power cut have 
 > happened.
 > 
 > However, with 5.3, a recent powercut crippled  the /usr filesystem such that
 > X11 hanged. The user of this PC was convinced that FreeBSD was infected by a
 > virus :(.

I would strongly advise you to teach that user to properly
shut down the machine instead of just pressing the power
button, thus eliminating the real cause of the problem.
(If you're suffering from frequent power outages, then a
UPS should be installed.)

By the way, you can map a key combination (Ctrl-Alt-Del or
something else) to the »halt« or »power-down« functions,
using kbdcontrol, so it's very easy and intuitive to shut
down the machine properly.  See the kbdmap(5) manpage for
details.

Apart from that, I suggest you simply disable background
fsck.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

We're sysadmins.  To us, data is a protocol-overhead.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Matthias Andree
Rob <[EMAIL PROTECTED]> writes:

> I had following situation:
>
>   Someone suddenly cut the power of a FreeBSD 5.3 PC, leaving the /usr
>   filesystem in a very broken state. During next bootup, there was indeed
>   the message telling 'not properly unmounted', but boot continued with
>   background fsck after 60 seconds; although I have
>  fsck_y_enable="YES"
>   in /etc/rc.conf.

That is the one that may cause problems. The default fsck settings are
conservative so as to only make "safe" changes. fsck -y also makes more
radical changes to your file system.

OTOH, I am not convinced that fsck (particularly bgfsck) is bug-free, I
have seen file system corruption on a FreeBSD 4.10 system that went with
the write caches disabled.

> This scared me. What if /usr was such broken that even single user mode
> would hang!?!

Don't worry as long as /usr is separate from /.

> Moreover, the main user of this PC is not a Unix guru and I hoped that
> the configuration setting in /etc/rc.conf of fsck_y_enable would do an
> automatic fix at bootup, like it used to do with 4.10. However, that
> apparently does not happen anymore.
>
> What can I do to enforce an immediate fix of the filesystems at bootup
> with FreeBSD 5.3, when a filesystem is not properly unmounted at shutdown?
>
> I suppose I should not change default background_fsck ("YES"). How about
> the background_fsck_delay? Should I set this to "0"?

Setting background_fsck=NO should be safe and cause the fsck to run in
foreground - exactly your desire. I would avoid touching the
background_fsck_delay.

If, as you say, the main user of the PC is not a guru and shuts down the
machine improperly, consider disabling the write cache. For ATA drives,
place hw.ata.wc="0" into /etc/loader.conf.local and reboot, for SCSI
drives, use "camcontrol modepage da0 -m8 -e -P3" and change the figure on
the WCE: line to 0, then save and exit; repeat for all further da*
drives if you have more than one.

That will limit the potential damage on the disk to one block rather
than the whole of the cache, which is between 2 and 8 MB on the common
drives sold today.

-- 
Matthias Andree
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Rob
Ceri Davies wrote:
On Tue, Jan 04, 2005 at 08:25:20PM +0900, Rob wrote:

An automatic fsck could have fixed the system (I eventually did it manually 
in single user mode), but the background check left the system broken.

So I want to configure 5.3 similar to former 4.10: a full automatic fix of 
all filesystems at bootup, in case the system was not properly shutdown.
How can I do that?
Turn off background_fsck.
Thanks.
Rob.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Ceri Davies
On Tue, Jan 04, 2005 at 08:25:20PM +0900, Rob wrote:

> An automatic fsck could have fixed the system (I eventually did it manually 
> in single user mode), but the background check left the system broken.
> 
> So I want to configure 5.3 similar to former 4.10: a full automatic fix of 
> all filesystems at bootup, in case the system was not properly shutdown.
> How can I do that?

Turn off background_fsck.

Ceri
-- 
Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former.-- Einstein (attrib.)


pgpTKNUJOmsuS.pgp
Description: PGP signature


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Boris B. Samorodov
Hi!

On Tue, Jan 04, 2005 at 08:25:20PM +0900, Rob wrote:

> So I want to configure 5.3 similar to former 4.10: a full automatic fix of 
> all
> filesystems at bootup, in case the system was not properly shutdown.
> How can I do that?

You already mention it -- backgroung_fsck="NO" at /etc/rc.conf.local.

> Thanks,
> Rob.

WBR
-- 
bsam
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Rob
Godwin Stewart wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tue, 4 Jan 2005 10:26:27 +, Dick Davies <[EMAIL PROTECTED]>
wrote:

That won't happen, since /usr isn't mounted in single user mode.

Even if it were, there are always "Live BSD" CDROMs which should allow you
to boot and then fsck your disk partitions.
Thanks for your replies, but apparently I didn't make my point clearly.
Let me try again:
If the system ends with a bad filesystem, the background check may leave the
system unusable after bootup. For a FreeBSD guru this is indeed easy to fix
(single user mode, rescue floppies, live CDs bootup etc.).
However, the main user of this particular PC is not at all a guru; on 4.10
I had rc.conf configured such that at bootup all filesystems would be
automatically fixed with: fsck_y_enable="YES".
With 4.10, this always worked nicely, whatever sudden power cut have happened.
However, with 5.3, a recent powercut crippled  the /usr filesystem such that
X11 hanged. The user of this PC was convinced that FreeBSD was infected by a
virus :(.
An automatic fsck could have fixed the system (I eventually did it manually in
single user mode), but the background check left the system broken.
So I want to configure 5.3 similar to former 4.10: a full automatic fix of all
filesystems at bootup, in case the system was not properly shutdown.
How can I do that?
Thanks,
Rob.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Godwin Stewart
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 4 Jan 2005 10:26:27 +, Dick Davies <[EMAIL PROTECTED]>
wrote:

> That won't happen, since /usr isn't mounted in single user mode.

Even if it were, there are always "Live BSD" CDROMs which should allow you
to boot and then fsck your disk partitions.

- -- 
G. Stewart - [EMAIL PROTECTED]

The only person to get all of his work done by Friday
was Robinson Crusoe
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQFB2nIXK5oiGLo9AcYRAremAJ4y79SBTaD47wUHIu7Q77zQ2u3htwCghB/m
s59RUGwBo+b04fzZOiR8N54=
=2/DX
-END PGP SIGNATURE-
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Dick Davies
* Rob <[EMAIL PROTECTED]> [0123 10:23]:
> This scared me. What if /usr was such broken that even single user mode
> would hang!?!

That won't happen, since /usr isn't mounted in single user mode.
 

-- 
'common sense is what tells you that the world is flat.'
-- Principia Discordia
Rasputin :: Jack of All Trades - Master of Nuns
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


fsck: broken file system with background check remains broken after bootup

2005-01-04 Thread Rob
Hi,
I had following situation:
  Someone suddenly cut the power of a FreeBSD 5.3 PC, leaving the /usr
  filesystem in a very broken state. During next bootup, there was indeed
  the message telling 'not properly unmounted', but boot continued with
  background fsck after 60 seconds; although I have
 fsck_y_enable="YES"
  in /etc/rc.conf. Because /usr was bad, the system hang immediately after
  bootup. I had to hit the power button (grump) to get a rebootcausing
  possibly more problems.
  I fixed it, by going into single user mode and do a manual fsck on all
  the filesystems. This way /usr got fixed and the system rebooted fine.
This scared me. What if /usr was such broken that even single user mode
would hang!?!
Moreover, the main user of this PC is not a Unix guru and I hoped that
the configuration setting in /etc/rc.conf of fsck_y_enable would do an
automatic fix at bootup, like it used to do with 4.10. However, that
apparently does not happen anymore.
What can I do to enforce an immediate fix of the filesystems at bootup
with FreeBSD 5.3, when a filesystem is not properly unmounted at shutdown?
I suppose I should not change default background_fsck ("YES"). How about
the background_fsck_delay? Should I set this to "0"?
Thanks,
Rob.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"