Re: recovering from a power outage

2009-02-16 Thread Mel
On Thursday 12 February 2009 16:24:25 A. Wright wrote:

> Can anyone corroborate that?  If so, does anyone know when
> ed started wanting to make a temp file even before any edits
> are made?  I am sure that ed has gotten me out of similar jams
> in the past, when I wanted to see part of a file in an unchecked
> root fs, and cat wouldn't fit the bill because the file was
> too long (and more and friends are far away on /usr, and therefore
> not available if still patching up the root).

From ed(1):
FILES
 /tmp/ed.*  buffer file

Solution:
mdconfig -a -t swap -s 64m -o reserve -u 0
newfs -U /dev/md0
mount /dev/md0 /tmp
chmod 1777 /tmp

Also, there's /rescue/vi (since 7.0 I believe), which will complain 
about /var/tmp/vi.recover, which you can a) ignore or b) use above procedure 
with -u 1 to create /var/tmp.
-- 
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread David Newman
On 2/13/09 7:22 AM, Robert Huff wrote:
> 
>>IMHO, if you are running a system where 'power outages' cannot
>>be tolerated, why not install a UPS, they are really quite
>>cheap, and be done with it? I cannot imagine any high end,
>>mission critical system not employing one.
> 
>   Power outages are not the only thing which can cause (directly
> or indirectly) file system corruption.

Hi, I'm the OP :-)

To that point, the system in question is attached to a 5000VA UPS. I did
something stupid with the UPS control software that caused an, er,
unscheduled shutdown. No UPS can help Mr. Fat Finger!

Thanks for all your replies.

dn

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Polytropon
On Fri, 13 Feb 2009 10:22:55 -0500, Robert Huff  wrote:
>   Power outages are not the only thing which can cause (directly
> or indirectly) file system corruption.

Oh yes, that's so true - I experienced it in July 2008, and I still
think it was a software problem...


-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Jerry
On Fri, 13 Feb 2009 10:22:55 -0500
Robert Huff  wrote:

>> IMHO, if you are running a system where 'power outages' cannot
>> be tolerated, why not install a UPS, they are really quite
>> cheap, and be done with it? I cannot imagine any high end,
>> mission critical system not employing one.  
>
> Power outages are not the only thing which can cause (directly
> or indirectly) file system corruption.

I agree, a sledge hammer applied to the HD could also cause irreparable
harm; however, the subject of this thread referred to 'power outages'.
The use of UPS, RAID, backups, etc. all tend to insure the safety of
data. In this case, the OP only referenced 'power outages'.

-- 
Jerry
ges...@yahoo.com

People that can't find something to live for always seem to find
something to die for.  The problem is, they usually want the rest of us
to die for it too.


signature.asc
Description: PGP signature


Re: recovering from a power outage

2009-02-13 Thread Robert Huff


>IMHO, if you are running a system where 'power outages' cannot
>be tolerated, why not install a UPS, they are really quite
>cheap, and be done with it? I cannot imagine any high end,
>mission critical system not employing one.

Power outages are not the only thing which can cause (directly
or indirectly) file system corruption.


Robert Huff

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Wojciech Puchar

One of my machines has a pair of 50gb SCSI disks; running two
full passes takes about 7 minutes.
I have no idea how long it might take to check a multi-terabyte
RAID- set-up.


depends of how filesystem was created.
multiterabyte arrays are usually used for large files, and filesystem with 
64K blocks and 8K fragments and say one inode/megabyte is checked VERY 
quickly.



Still worth waiting ... in my opinion.


Robert Huff






___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Jerry
On Fri, 13 Feb 2009 14:16:13 +0100
Polytropon  wrote:

> On Fri, 13 Feb 2009 08:11:56 -0500, Robert Huff 
> wrote:
>> One of my machines has a pair of 50gb SCSI disks; running two
>> full passes takes about 7 minutes.
>> I have no idea how long it might take to check a
>> multi-terabyte RAID- set-up.
>
> It's not *that* hard to wait for an fsck. I have 2 x 500 GB here at
> home, you're right, it takes several minutes for fsck to check both
> disks, but in the end, you're happy that either everything turns out
> to be okay or, if problems occured, you see these problems and can
> decide how to handle them.
>
>> Still worth waiting ... in my opinion.
>
> I'd rather wait than lose data.
> 
> But as you said, it's very individual how you think about this. If
> backups are done properly, sometimes it might even be easier *not* to
> repair data, but to put back the backups on the newly initialized
> disks...

IMHO, if you are running a system where 'power outages' cannot be
tolerated, why not install a UPS, they are really quite cheap, and be
done with it? I cannot imagine any high end, mission critical
system not employing one.

-- 
Jerry
ges...@yahoo.com

Your temporary financial embarrassment will
be relieved in a surprising manner.


signature.asc
Description: PGP signature


Re: recovering from a power outage

2009-02-13 Thread Polytropon
On Fri, 13 Feb 2009 08:11:56 -0500, Robert Huff  wrote:
>   One of my machines has a pair of 50gb SCSI disks; running two
> full passes takes about 7 minutes.
>   I have no idea how long it might take to check a multi-terabyte
> RAID- set-up.

It's not *that* hard to wait for an fsck. I have 2 x 500 GB here at home,
you're right, it takes several minutes for fsck to check both disks, but
in the end, you're happy that either everything turns out to be okay or,
if problems occured, you see these problems and can decide how to handle
them.



>   Still worth waiting ... in my opinion.

I'd rather wait than lose data.

But as you said, it's very individual how you think about this. If backups
are done properly, sometimes it might even be easier *not* to repair data,
but to put back the backups on the newly initialized disks...



-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Robert Huff

Wojciech Puchar writes:

>  background_fsck="NO"
>  
>  in rc.conf
>  
>  unix doesn't crash every few hours so it's really not a problem
>  to wait a bit more

Cases and personal tolerance may vary.
One of my machines has a pair of 50gb SCSI disks; running two
full passes takes about 7 minutes.
I have no idea how long it might take to check a multi-terabyte
RAID- set-up.
Still worth waiting ... in my opinion.


Robert Huff




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Wojciech Puchar

seeing fsck checking partitions after unclean shutdown, but when everything's
okay, there's no problem running into MUM *afterwards*.


exactly like me i have
background_fsck="NO"

in rc.conf

unix doesn't crash every few hours so it's really not a problem to wait a 
bit more

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-13 Thread Polytropon
On Thu, 12 Feb 2009 23:00:16 -0500, Robert Huff  wrote:
>   1) It was my understanding one has to force-mount a dirty
> filesuystem.  IF this sounds like a practice best left to senior
> Jedi Masters ... it porbably is.

Mounting possibly defective file systems is not a good idea. If it's
possible, boot into SUM via boot -s first, check partitions (unmounted!)
and then mount -a. Use "exit" to bring up MUM afterwards.

Setting background_fsck="NO" in /etc/rc.conf may increase boot time
if problems occur, but can be useful to first check for errors, and
then bring up the system, instead of bringing up the system with maybe
problems on the partitions. I think this delay is something you can
affort.

It's not good to fsck a mounted partition anyway, because fsck can
repair minor defects on its own.



>   2) I would _never_ let background fsck "take care of things"
> after a crash,  While hovering over the keyboard is a pain, I will
> find out how badly things are damaged, rather than have boatloads of
> files mysteriously vanish.

That's a good concept which I do follow myself, too. I spend some minutes
seeing fsck checking partitions after unclean shutdown, but when everything's
okay, there's no problem running into MUM *afterwards*.


-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Bill Moran
David Newman  wrote:
>
> What's the canonical method for checking ufs file systems on a FreeBSD
> 7.1/amd64 system after an unscheduled power outage?

Wait.

The system will automatically detect a dirty shutdown and check the disks
during the boot process.  If the disks are only mildly scrambled by the
outage, the system will continue to boot and the filesystem check program
will run in the background -- you'll notice some disk slowness until
fsck is done cleaning things up, but things will be otherwise fine.

See the man page for fsck and fsck_ffs for more details.

-- 
Bill Moran
http://www.potentialtech.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Robert Huff

Jerry McAllister writes:

>  > > do I need to
>  > > boot into single-user mode, what filesystem(s) do I mount and how,
>  > > what switches if any do I use with fsck and so on.
>  > >
>  > i thought it happens in the background anyway. i don't recall having to
>  > do anything other than listen to the drive whirring away - and we've
>  > had many power outages!
>  
>  It does run in the background, but if you have time, it isn't a 
>  bad idea to run it in single user before bring the whole system
>  back up in the circumstance of a catastrophic failure like a power
>  outage.

1) It was my understanding one has to force-mount a dirty
filesuystem.  IF this sounds like a practice best left to senior
Jedi Masters ... it porbably is.
2) I would _never_ let background fsck "take care of things"
after a crash,  While hovering over the keyboard is a pain, I will
find out how badly things are damaged, rather than have boatloads of
files mysteriously vanish.


Robert Huff



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Jerry McAllister
On Thu, Feb 12, 2009 at 05:16:53PM -0800, prad wrote:

> On Thu, 12 Feb 2009 16:45:18 -0800
> David Newman  wrote:
> 
> > do I need to
> > boot into single-user mode, what filesystem(s) do I mount and how,
> > what switches if any do I use with fsck and so on.
> >
> i thought it happens in the background anyway. i don't recall having to
> do anything other than listen to the drive whirring away - and we've
> had many power outages!

It does run in the background, but if you have time, it isn't a 
bad idea to run it in single user before bring the whole system
back up in the circumstance of a catastrophic failure like a power
outage.

jerry

> 
> -- 
> In friendship,
> prad
> 
>   ... with you on your journey
> Towards Freedom
> http://www.towardsfreedom.com (website)
> Information, Inspiration, Imagination - truly a site for soaring I's
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Jamie





On Thu, 12 Feb 2009, David Newman wrote:


On 2/12/09 4:41 PM, Jerry McAllister wrote:

On Thu, Feb 12, 2009 at 04:06:49PM -0800, David Newman wrote:


What's the canonical method for checking ufs file systems on a FreeBSD
7.1/amd64 system after an unscheduled power outage?


How about fsck


Right. I'm asking procedurally how that's invoked -- eg., do I need to
boot into single-user mode, what filesystem(s) do I mount and how, what
switches if any do I use with fsck and so on.



   Normally after booting after a power outage fsck will run automatically 
as part of the system startup, and will prune the filesystems 
automatically. If it finds an error it can't fix without help, it will 
drop you into a command line and tell you that there were errors that 
require your input to fix.


   At that point you can just run fsck {reported filesysem with errors} 
ie:


fsck /dev/ad0s1e

   Sometimes you may want to use the -y switch, but use it with caution.

man fsck  for more info on other options.




  - Jamie



thanks!

dn




jerry



thanks

dn


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread A. Wright


 [ deletia introducing discussion of fsck ]

On Thu, 12 Feb 2009, Tim Judd wrote:

It's part of the bootup scripts now.  It runs in the background 60 seconds 
after the login prompt shows up (not exactly, but close to 60 secs)


it's the background_fsck option that defaults to YES in /etc/rc startup. 
only if there's major problems will it bail out, screaming for help.  it'll 
drop you into a shell telling you that the filesystems need repair.



If you are paranoid (like I am) and want to watch everything
happen, then it is nice that fsck will read /etc/fstab (if still
present) and correlate filesystem names with devices, so you can
just follow a sequence like this:

(boot single user)
fsck /
fsck /usr
fsck /var

...etc

Once you have run fsck on /, you can mount it using
mount -u -o rw /

so that you can then run ed (which is in /bin).

I am assuming that the reason you cannot use ed to look at
a file until this point is because it wants to write the
temporary buffer somewhere, even if there are no changes,
and if / is readonly and nothing else is mounted, then /tmp
is unavailable for this purpose.

Can anyone corroborate that?  If so, does anyone know when
ed started wanting to make a temp file even before any edits
are made?  I am sure that ed has gotten me out of similar jams
in the past, when I wanted to see part of a file in an unchecked
root fs, and cat wouldn't fit the bill because the file was
too long (and more and friends are far away on /usr, and therefore
not available if still patching up the root).

Anyone?

Andrew.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread prad
On Thu, 12 Feb 2009 16:45:18 -0800
David Newman  wrote:

> do I need to
> boot into single-user mode, what filesystem(s) do I mount and how,
> what switches if any do I use with fsck and so on.
>
i thought it happens in the background anyway. i don't recall having to
do anything other than listen to the drive whirring away - and we've
had many power outages!

-- 
In friendship,
prad

  ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Tim Judd

David Newman wrote:

On 2/12/09 4:41 PM, Jerry McAllister wrote:
  

On Thu, Feb 12, 2009 at 04:06:49PM -0800, David Newman wrote:



What's the canonical method for checking ufs file systems on a FreeBSD
7.1/amd64 system after an unscheduled power outage?
  
How about fsck 



Right. I'm asking procedurally how that's invoked -- eg., do I need to
boot into single-user mode, what filesystem(s) do I mount and how, what
switches if any do I use with fsck and so on.

thanks!

dn


  

jerry




thanks

dn
  


It's part of the bootup scripts now.  It runs in the background 60 
seconds after the login prompt shows up (not exactly, but close to 60 secs)


it's the background_fsck option that defaults to YES in /etc/rc 
startup.  only if there's major problems will it bail out, screaming for 
help.  it'll drop you into a shell telling you that the filesystems need 
repair.


--Tim
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread David Newman
On 2/12/09 4:41 PM, Jerry McAllister wrote:
> On Thu, Feb 12, 2009 at 04:06:49PM -0800, David Newman wrote:
> 
>> What's the canonical method for checking ufs file systems on a FreeBSD
>> 7.1/amd64 system after an unscheduled power outage?
> 
> How about fsck 

Right. I'm asking procedurally how that's invoked -- eg., do I need to
boot into single-user mode, what filesystem(s) do I mount and how, what
switches if any do I use with fsck and so on.

thanks!

dn


> 
> jerry
> 
> 
>> thanks
>>
>> dn
>>
>>
>> ___
>> freebsd-questions@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: recovering from a power outage

2009-02-12 Thread Jerry McAllister
On Thu, Feb 12, 2009 at 04:06:49PM -0800, David Newman wrote:

> What's the canonical method for checking ufs file systems on a FreeBSD
> 7.1/amd64 system after an unscheduled power outage?

How about fsck 

jerry


> 
> thanks
> 
> dn
> 
> 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"