Operating System - HP-UX
1757457 Members
2725 Online
108862 Solutions
New Discussion юеВ

How to simulate disk failure ?

 
SOLVED
Go to solution
KRI
Advisor

How to simulate disk failure ?

Hi !

I have configuration:
vg01 has 2 physical volume groupe: PVG0, PVG1
PVG0 (c0t0d0, c0t1d0)
PVG1 (c4t0d0, c4t1d0)

LV's was created in vg01 with Extent-Based Mirrored Stripes:
lvcreate -D y -s g -m1 -l 100 /dev/vg01

I want to check what hapend when 1 disk failing.

How can I simulate disk failure ?
I don't want to remove disk from machine!
Is pvcreate -f /dev/rdsk/c0t0d0 good idea ?

Thx for help!
KRI
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: How to simulate disk failure ?

Are these disks hot swappable, allowing you to pull one out to simulate failure?


Pete

Pete
Luk Vandenbussche
Honored Contributor

Re: How to simulate disk failure ?

Hi,

pvcreate -f is not a solution.
The only good way to simulate if failure is power down or remove the disk from the array
Steven E. Protter
Exalted Contributor

Re: How to simulate disk failure ?

KRI,

I think the command will fail. If it does not, it is possible that it will lock the machine, or force the machine to fail.

If you have raid 1 (lxextend -m 1 ) mirroring, it might survive.

I tested this successfully in the US. I shut the system down and booted it while pulling out one of the hot sway drives. It ran normally and then I plugged the drive in. It was discovered and the OS synced up itself.

I recommend against use of your proposed test, it could destroy data and make it impossible for your mirrors to sync. You'd then be forced to redo mirroring from scratch on the system. I think it won't work, but do not like what the impact would be if it does.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alexander M. Ermes
Honored Contributor

Re: How to simulate disk failure ?

Hi there.
I would not perform that test. Do as the others said, pull the disk and reinsert it.
Your test is pretty dangerous to your data and disk.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to simulate disk failure ?

Hi :

First, 'pvcreate' (forced or not) will not work if the volume in question exists in '/etc/lvmtab', so that is not an option.

Secondly, as noted, brutally disconnecting a running disk might lead you into more problems than the test was worth.

If this was a mirrored vg00 set, then, I would suggest that you use prove that you could boot from either mirrored set. Otherwise, I would ask, "what's-to-check?". If your logical volumes are synchronized (use 'lvdisplay -v' to check), then why can't you trust the product?

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: How to simulate disk failure ?

Well, I never trust that software is going to do what the vendor says. I'm more of a "trust but verify" kind of guy. However, testing on a production box is state of the art stupid; that is what sandboxes are for. The only real way to test a drive failure is with a drive failure. That means yanking the drive if it's a hot plug drive or powering it down otherwise. In any event, anyone using Mirror/UX should use only hot-plug drives otherwise a shutdown is required to fix the problem. I have not shutdown a machine to replace a drive in well over 7 years. I have literally pulled hot plug drives hundreds of time w/o damage.
If it ain't broke, I can fix that.
Paul Sperry
Honored Contributor

Re: How to simulate disk failure ?

Just give it time the disk will fail on it's own :)
KRI
Advisor

Re: How to simulate disk failure ?

Hi again !

Thank all of You for help me!

Now I know the only one way to simulate disk failure is power down or remove the disk from the array.

Thx!
Regards!
KRI
Mridul Shrivastava
Honored Contributor

Re: How to simulate disk failure ?

U can simulate failure of disk using the following command:
dd if=/dev/null of=disk path b=1024K count=12
So after this if u run some query or write or read some data then u'll find some stale extend on the disk on which u run this dd.
After that u have restore the vgcfgbackup on that particular disk. Ur data will be safe so don't worry abt the data.
Time has a wonderful way of weeding out the trivial