Corrupt primary partition for testing porpose

‎12-28-2011 04:58 AM

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.


Re: Corrupt primary partition for testing porpose

‎05-24-2012 10:25 AM

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


Re: Corrupt primary partition for testing porpose

‎09-05-2012 05:15 AM

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