Obviously this is sarcasm, but I've been able to reproduce (on more than 3 occasions) breaking my ZFS pool (unintentionally) using these initial conditions and trigger. Thankfully, I no longer trust ZFS enough to put critical data in the situation described below. The leason to take away here is to never use ZFS without taking backups, setting "copies" to a value greater than one, or using at least a mirror. If you can't use those options, then stick to UFS. UFS is much better at handling the faluire scenerio described below.
How to Reliably Break your ZFS Pool
(Will not work on UFS)
Step 1: Get a Copy of VMware Workstation
I have VMware workstation running on Windows. I suppose this could also be done with VirtualBox on Linux/FreeBSD, but I haven't tried (this is unintentional after all).
Step 2: Install FreeBSD
It can be whatever you want. Just get a fresh install of FreeBSD as a guest. In my case, I am running a graphical desktop, but it will work on a headless server too.
Step 3: Find some Storage
You can use your root volume, but for the purpose of simplicity we will dedicate a new volume to it.
Step 4: Create a ZFS Pool
If you using Vmware, your second volume will be known as da1. So run
Step 5: Generate IO
Real world use case: lets install net-p2p/litecoin. Set the location of the blockchain and wallet to your ZFS pool. Don't forget to export your private key.
Step 6: Pull the Plug
Simuliating a power faluire or host OS kernel panic.
Step 7: Boot up your Guest & Cry
Observe the falied pool and be happy that you took a backup copy of your private key
How to Reliably Break your ZFS Pool
(Will not work on UFS)
Step 1: Get a Copy of VMware Workstation
I have VMware workstation running on Windows. I suppose this could also be done with VirtualBox on Linux/FreeBSD, but I haven't tried (this is unintentional after all).
Step 2: Install FreeBSD
It can be whatever you want. Just get a fresh install of FreeBSD as a guest. In my case, I am running a graphical desktop, but it will work on a headless server too.
Step 3: Find some Storage
You can use your root volume, but for the purpose of simplicity we will dedicate a new volume to it.
Step 4: Create a ZFS Pool
If you using Vmware, your second volume will be known as da1. So run
zfs create MyPool da1Step 5: Generate IO
Real world use case: lets install net-p2p/litecoin. Set the location of the blockchain and wallet to your ZFS pool. Don't forget to export your private key.
Step 6: Pull the Plug
Simuliating a power faluire or host OS kernel panic.
Step 7: Boot up your Guest & Cry
Observe the falied pool and be happy that you took a backup copy of your private key
Code:
# zpool import MyPool
cannot import 'MyPool': I/O error
Destroy and re-create the pool from
a backup source.