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

Fleischer, Julie N julie.n.fleischer at intel.com
Wed Aug 7 11:36:32 PDT 2002

Thanks, Stephanie.

So, it seems like the common theme is to stress the filesystem enough so
that we are fairly sure it will want to do some type of recovery.

Then, we need to shutdown "ungracefully."  So, if you do know of a way I
could simulate a manual power button press, I think I could use that
information.  But, possibly the first two ideas (watchdog timer or cause a
system crash) could simulate a power button press too?

- Julie

-----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

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.


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


                      08/07/2002 12:23




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

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

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. ;^)


cgl_discussion mailing list
cgl_discussion at lists.osdl.org

More information about the cgl_discussion mailing list