zap always skips block.db, leaves them around
This happens because the 'backing devices' have the wrong identifier ("block" vs. "db"). The right change in zap.py is:
backing_devices = [ (journal_lvs, 'journal'), (db_lvs, 'db'), (wal_lvs, 'wal') ]
Additionally, the zapping of partitions was creating the following error:
--> Zapping: /dev/sdz1 Running command: /usr/sbin/wipefs --all /dev/sdz1 Running command: /bin/dd if=/dev/zero of=/dev/sdz1 bs=1M count=10 --> Destroying partition since --destroy was used: /dev/sdz1 Running command: /usr/sbin/parted /dev/sdz --script -- rm 1 --> Zapping: /dev/sdz2 Running command: /usr/sbin/wipefs --all /dev/sdz2 stderr: wipefs: error: /dev/sdz2: probing initialization failed: No such file or directory --> RuntimeError: command returned non-zero exit status: 1
The immediate fix was to add a sleep before it:
import time; time.sleep(2) wipefs(device.abspath) zap_data(device.abspath)
This is far from ideal, and what needs to happen here is to have a few try/except/sleeps so that this succeeds without problem when the "probing initialization failed: No such file or directory" message shows up.