[cgl_discussion] [cgl_valid] Simulating a system failure to f orce a filesystem recovery

Lynch, Rusty rusty.lynch at intel.com
Wed Aug 7 11:38:09 PDT 2002


If you want to trigger an ungraceful reboot then you could just use the
watchdog timer (with instructions to setup the software watchdog timer if a
hardware solution doesn't exist on the test machine.)

Basically, all you have to do is open /dev/watchdog, write something to it
and wait for the system to boot.  You could prevent system hangs (if the
watchdog device is not loaded) by doing a "select" on the file descriptor
for /dev/watchdog where you configure a timeout for several seconds.  This
should work for all watchdog drivers.

	-rusty

-----Original Message-----
From: Stephanie Glass [mailto:sglass at us.ibm.com]
Sent: Wednesday, August 07, 2002 11:24 AM
To: Fleischer, Julie N
Cc: 'cgl_discussion at osdl.org'
Subject: Re: [cgl_discussion] [cgl_valid] Simulating a system failure to
force a filesystem recovery



Julie,
I talked to the guys in my dept who test jfs and they didn't think a reboot
() would allow the file system to be corrupted.  It would wait till the
command ended before doing a write.  What they did was use a tool they
wrote which is part of LTP called LFTEST which does very large writes and
then manually they hit the power button.  They think you could simulate the
power button by running a program that causes the system to do an OOPS.
They said there were several programs out there which do that.

Please let me know if you need any additional information on any of the
programs involved with what they are saying.


Stephanie

Linux Technology Center
 IBM, 11400 Burnet Road, Austin, TX  78758
 Phone: (512) 838-9284   T/L: 678-9284  Fax: (512) 838-3882
 E-Mail: sglass at us.ibm.com


 

                      Andy Pfiffer

                      <andyp at osdl.org>          To:       "Fleischer, Julie
N" <julie.n.fleischer at intel.com>              
                      Sent by:                  cc:
"'cgl_discussion at osdl.org'" <cgl_discussion at osdl.org>           
                      cgl_discussion-adm        Subject:  Re:
[cgl_discussion] [cgl_valid] Simulating a system failure to 
                      in at osdl.org                force a filesystem rec
overy                                             
 

 

                      08/07/2002 12:23

                      PM

 

 




On Wed, 2002-08-07 at 09:55, Fleischer, Julie N wrote:
> Validation -
> As part of testing a resilient file system, I want a test case where I am
> sure that I have simulated a system failure so that on startup fsck (I
> believe) must be performed.  In addition, it would be even better if that
> fsck could have to repair something (i.e., the system failure happened in
> the middle of a logical write).
>
> Does anyone know how I can do this reliably?

As far as triggering an fsck, for non-journaled filesystems that are
listed in /etc/fstab and automatically mounted on reboot, all you need
to do is use reboot(2) with LINUX_REBOOT_CMD_RESTART without a previous
unmount.

You could probably arrange to reliably cause enough dirty state to be
stuck in the bufffer cache that some form of repair would always be
attempted.

You might try this: create a new directory, and in that new directory,
randomly create, write, re-write, re-name, and unlink a few 100 files
and directories. Make sure it runs for a few seconds (like 3), and then
call reboot().

Saftey tip: don't do this on an ext2-based filesystem that you expect to
be sane when the system reboots. ;^)

Andy



_______________________________________________
cgl_discussion mailing list
cgl_discussion at lists.osdl.org
http://lists.osdl.org/mailman/listinfo/cgl_discussion





_______________________________________________
cgl_discussion mailing list
cgl_discussion at lists.osdl.org
http://lists.osdl.org/mailman/listinfo/cgl_discussion



More information about the cgl_discussion mailing list