[SUMMARY] Purposely corrupting a filesystem

From: Jeff Germain (j.germain@xpedite.com)
Date: Tue Jan 14 2003 - 14:16:00 EST


Thanks to:

peter@ejs.is
Rich Kulawiec

The suggestion was to create a bogus file, then run clri to clear that
file's inode. This is fairly simple, but will not work with vxfs
filesystems, which will not allow you to run the clri command on them. No
matter for my tests, I just created a ufs filesystem instead. Not sure what
you would do if you *really needed* to test it using vxfs....

# df -k /testit
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/rootdg/testit
                        2799 343 2177 14% /testit
# touch /testit/junk
# ls -i /testit/junk
       131 /testit/junk
# umount /testit
# clri /dev/vx/rdsk/rootdg/testit 131
clearing 131
# <Run the test here. Or via CLI...>
# mount /testit
mount: the state of /dev/vx/dsk/rootdg/testit is not okay
        and it was attempted to be mounted read/write
mount: Please run fsck and try again
# fsck -Y /dev/vx/rdsk/rootdg/testit
(bunch -O messages)
# mount /testit
# <Repeat ad nauseum - one nice thing is the inode number will always be the
same, if you're the only one using the filesystem. i.e....>
# touch /testit/junk
# ls -i /testit/junk
---> 131 /testit/junk

Jeff

-----Original Message-----
From: Jeff Germain [mailto:j.germain@xpedite.com]
Sent: Friday, January 10, 2003 11:20 AM
To: SunManagers
Subject: Purposely corrupting a filesystem

Group,

I'm writing a script which will contain something like:

mount /dev-path /mount-point
if [ it fails ]
then
        fsck -options /raw-dev-path
        mount /dev-path /mount-point
fi

I will want to test the script a few times. Is there a quick and relatively
painless way to force a *minor* corruption on a filesystem? It should do
enough so the mount will fail, but without hurting my fs too much, and
without having to crash/reboot the system.

Thanks, will summarize...

Jeff
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:36 EDT