Re: how to disable fsck when power failure

2011-11-08 Thread David Coppa
On Tue, 08 Nov 2011, co...@tetrachina.com wrote:

 misc#,Dz:C#!
 
 when the box with OpenBSD had a power failure and the system did not 
 unmount properly.
 it sometimes gets stuck.The system is asking me to RUN fsck MANUALLY.
 as a gateway ,so i can't go to fix it manually everytime.How do I advoid 
 this? 
 i want to disable it crumbling to single mode. thanks.
 
 /dev/rwd0e: UNEXPECTED INCONSISTENCY; RUN fsck_ffs MANUALLY.
 AUTOMATIC FILE SYSTEM CHECK FAILED; HELP!
 Enter pathname of shell or RETURN for sh:
 
 Best Regards

You can try something like this patch:

Index: rc
===
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.396
diff -u -p -r1.396 rc
--- rc  13 Oct 2011 07:54:06 -  1.396
+++ rc  8 Nov 2011 10:08:35 -
@@ -294,8 +294,16 @@ elif [ X$1 = Xautoboot ]; then
exit 1
;;
8)
-   echo Automatic file system check failed; help!
-   exit 1
+   echo File system check failed; trying fsck -y.
+   fsck -y
+   case $? in
+   0)
+   ;;
+   *)
+   echo Ok, now it's really fscked... 
+   exit 1
+   ;;
+   esac
;;
12)
echo Boot interrupted.



Re: how to disable fsck when power failure

2011-11-08 Thread Norman Golisz
On Tue Nov  8 2011 17:41, co...@tetrachina.com wrote:
 misc#,Dz:C#!
 
 
 
 when the box with OpenBSD had a power failure and the system did not 
 unmount properly.
 
 it sometimes gets stuck.The system is asking me to RUN fsck MANUALLY.
 
 as a gateway ,so i can't go to fix it manually everytime.How do I advoid 
 this? 

Disabling or skipping fsck(8)s is generally a very bad idea.
However, you could install a UPS. Further, partition your discs
properly and mount filesystems, if possible, read-only. This greatly
minimises the risk of filesystem inconsistencies/corruption.

Norman.



Re: how to disable fsck when power failure

2011-11-08 Thread Kevin Chadwick
On Tue, 8 Nov 2011 11:09:32 +0100
David Coppa dco...@gmail.com wrote:

 You can try something like this patch:
 
 Index: rc
 ===
 RCS file: /cvs/src/etc/rc,v
 retrieving revision 1.396
 diff -u -p -r1.396 rc
 --- rc13 Oct 2011 07:54:06 -  1.396
 +++ rc8 Nov 2011 10:08:35 -
 @@ -294,8 +294,16 @@ elif [ X$1 = Xautoboot ]; then
   exit 1
   ;;
   8)
 - echo Automatic file system check failed; help!
 - exit 1
 + echo File system check failed; trying fsck -y.
 + fsck -y
 + case $? in
 + 0)
 + ;;
 + *)
 + echo Ok, now it's really fscked... 
 + exit 1
 + ;;
 + esac
   ;;
   12)
   echo Boot interrupted.

It would depend on your purpose as to whether the above was the best
aproach or making the system read-only with an mfs /tmp /var? and
exported logs. Something which is far easier with OpenBSD than most OS.



Re: how to disable fsck when power failure

2011-11-08 Thread Matteo Leccardi
 Disabling or skipping fsck(8)s is generally a very bad idea.

 Norman.


@Norman: is it! BTW...
@Cosmo Wu
man 5 fstab  is your friend.
Quick and dirt: Edit /etc/fstab and change the last digit of the
corrispondent mount point line form [1|2] to 0
Ex.
default
515f3560ef6f35f5.a / ffs rw 1 1
to
515f3560ef6f35f5.a / ffs rw 1 0

Bye

Matteo



Re: how to disable fsck when power failure

2011-11-08 Thread Norman Golisz
On Tue Nov  8 2011 12:03, Matteo Leccardi wrote:
  Disabling or skipping fsck(8)s is generally a very bad idea.
 
  Norman.
 
 
 @Norman: is it! BTW...
 @Cosmo Wu
 man 5 fstab  is your friend.
 Quick and dirt: Edit /etc/fstab and change the last digit of the
 corrispondent mount point line form [1|2] to 0
 Ex.
 default
 515f3560ef6f35f5.a / ffs rw 1 1
 to
 515f3560ef6f35f5.a / ffs rw 1 0

It must be said again, it is absolutely risky and unsafe to skip
fsck(8)s for root filesystems in particular. If you have not taken any
precaution to prevent or to detect a filesystem corruption, then chances
are, you render your system non-operational very easily.

You have the choice.



Re: how to disable fsck when power failure

2011-11-08 Thread Jan Stary
On Nov 08 12:03:33, Matteo Leccardi wrote:
 Quick and dirt: Edit /etc/fstab and change the last digit of the
 corrispondent mount point line form [1|2] to 0
 Ex.
 default
 515f3560ef6f35f5.a / ffs rw 1 1
 to
 515f3560ef6f35f5.a / ffs rw 1 0

and run with an unclean root filesystem. Way to go!



Re: how to disable fsck when power failure

2011-11-08 Thread Matteo Leccardi
Curiosity killed the cat
What I wrote is (totally unwise and)  wrong. Setting

515f3560ef6f35f5.a / ffs rw 1 0
result is a system with an unclean root filesystem, mounted read-only
booting in single user mode.
Btw; from fstab(5)

 If the sixth field is not present or is zero, a value of zero is returned
and fsck(8) will assume that the filesystem does not need to be checked.

Fall back to previuos post: properly partition your drive and mount
filesystems, if possible, read-only.

for i in 1 2 3 4 5; do echo I'm sorry  sleep 2; done

Matteo



2011/11/8 Matteo Leccardi m.lecca...@gmail.com


  Disabling or skipping fsck(8)s is generally a very bad idea.

 Norman.


 @Norman: is it! BTW...
 @Cosmo Wu
 man 5 fstab  is your friend.
 Quick and dirt: Edit /etc/fstab and change the last digit of the
 corrispondent mount point line form [1|2] to 0
 Ex.
 default
 515f3560ef6f35f5.a / ffs rw 1 1
 to
 515f3560ef6f35f5.a / ffs rw 1 0

 Bye

 Matteo



Re: how to disable fsck when power failure

2011-11-08 Thread co...@tetrachina.com
Hi,Matteo Leccardi 



ccThanks guys for all your replys. appreciate it. Matteo , before i maned  the 
fstab ,and found it '

If the sixth field is not present or is zero, a value of zero is returned

 and fsck(8) will assume that the filesystem does not need to be checked.







but it didn't works ,there something funny came across . after the failure ,the 
OpenBSD system repeated rebooting.

so i had to boot into single mode ,and edited it again to the default setting 
,then it recovered.





i can't transfer the /var to mfs ,because i have to accumulate some logs ,such 
as mrtg/trafd logs .--would you mind



telling how to transfer the /var/ to MFS ? thank you very much .





@Norman Golisz  , thanks your suggesting . but the little box with OpenBSD like 
Soekris works under mal-condition



, i don't intend to suply a UPS.





could any ways be done to avoid /disable fsck and jump to single user mode ? 
thanks.





@David Coppa , thanks for your patch , i will try that .did it work for you now 
?









Disabling or skipping fsck(8)s is generally a very bad idea.



Norman.





@Norman: is it! BTW...

@Cosmo Wu

man 5 fstab  is your friend. 

Quick and dirt: Edit /etc/fstab and change the last digit of the corrispondent 
mount point line form [1|2] to 0

Ex.

default

515f3560ef6f35f5.a / ffs rw 1 1

to

515f3560ef6f35f5.a / ffs rw 1 0



Bye



Matteo







= = = = = = = = = = = = = = = = = = = = = = 

h4

g$o



ccco...@tetrachina.com

ccco...@tetrachina.com

c2011-11-09




Re: how to disable fsck when power failure

2011-11-08 Thread Nick Holland
On 11/08/11 04:41, co...@tetrachina.com wrote:
 misc#,Dz:C#!
 
 when the box with OpenBSD had a power failure and the system did not 
 unmount properly.
 it sometimes gets stuck.The system is asking me to RUN fsck MANUALLY.
 as a gateway ,so i can't go to fix it manually everytime.How do I advoid 
 this? 
 i want to disable it crumbling to single mode. thanks.
 
 /dev/rwd0e: UNEXPECTED INCONSISTENCY; RUN fsck_ffs MANUALLY.
 AUTOMATIC FILE SYSTEM CHECK FAILED; HELP!
 Enter pathname of shell or RETURN for sh:
 
 Best Regards
 
 Cosmo Wu

I have run a lot of OpenBSD gateway machines, I almost always power them
down by wacking the power switch, not by orderly shutdown, and yet, only
a very few times has one not come back up well and on their own.  I tend
to use very small (by modern standards) partitions (i.e., only a small
part of a modern disk.  No one says you have to allocate all 250G of a
250G disks.  You can leave 246G unallocated!), so the fsck times will be
tolerable.

So, I suspect you are doing something OTHER than running just a gateway,
something that is causing more disk activity than a typical gateway does.

After your first post, you mentioned mrtg.  Ah-hah.  I think the answer
is, move mrtg to another machine, let your gateway be a gateway.  I
think that will reduce your problem to manageable levels.

The few times I had an OpenBSD gateway not come up on their own at a
customer site (I can think of once), I had no trouble walking
non-technical people through fsck over the phone.

Nick.