Junos
Reply
Contributor
Mackodlak
Posts: 17
Registered: ‎12-28-2011
0

Corrupt primary partition for testing porpose

Hey ppl,

 

I whant to test how the frimary/backup partitions work on a demo device so we know what to expect if sth goes wrong in production.

First I only wanna corrupt the primary partition and see what happens when device is forced to reboot from secondary, then possibly corrupt both partitions and be forced to reboot from USB and restore the system.

 

How would I do it? Where to start? I thougth deleting the /dev/ad0s1a would be enough, but aparently it is not.

 

This is not intended to do in a way that would permanently dmg the demo device, just to see what happens if, god forbid, something bad happens with the device in production. The device is SRX650 and it's intended to be 2 of them in a cluster, so the system SHOULD be safe, but you all know it's not alaways like that.

Contributor
ed_gpc
Posts: 194
Registered: ‎09-21-2010
0

Re: Corrupt primary partition for testing porpose

I've found that pulling the power cord can do it nicely, might need to do it a few times.

Visitor
wagnerflo
Posts: 7
Registered: ‎07-07-2011
0

Re: Corrupt primary partition for testing porpose

/dev/ad0s1a is just a device node, a special type of file through which to access a BSD slice. If you delete it you just delete that file, not modify the slice itself.

 

What you want to do is "dd if=/dev/random of=/dev/ad0s1a bs=1M count=1" which will overwrite the first MB of the slice with random data and should make the slice not boot any more.

 

I've never tried that on any Juniper system so I can't garantee it won't destroy anything else I haven't thought of.

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.