zfstest -a destroys rpool on IDE disks and should strip partition numbers
The OmniOS installer does not detect virtio disks, so my virtual
OmniOS rpool running under SmartOS KVM is on
zfstest -a in that OmniOS VM destroys the rpool. (I was lucky
enough to snapshot the zvol before trying zfstest, no damage done)
The code which sets $all_disks accepts everything starting with c[0-9]
(zfstest.ksh:40) as disk, but the awk expression which detects disks
used in pools requires disk to start with c[0-9]*t[0-9]*d[0-0]
(zfstest.ksh:42). IDE disks have no target number so they are not
added to $used_disks and end up in the list of disks to use for the
Making the target number optional fixes this. While here also strip
partition numbers (p[0-9]+) as already done for slice
numbers. Partition numbers may exist in the wild.
Successfully ran zftest with the patch applied, rpool survived ;-),
three unused virtio disks where all detected and used.
Tested awk regexp with /usr/bin/awk, /usr/gnu/bin/awk and
/usr/xpg4/bin/awk, same for sed.
I'll open an openzfs PR on github and prepare a webrev.
Updated by Electric Monk over 2 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
commit ce326879a41b052db3abafb44e551f9d9c40cdba Author: Attila Fülöp <email@example.com> Date: 2017-03-28T22:28:10.000Z 7982 zfstest -a destroys rpool on IDE disks and should strip partition numbers Reviewed by: John Wren Kennedy <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Approved by: Matthew Ahrens <firstname.lastname@example.org>