Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template_zfs_on_linux, zfs.vdev.discovery not filtering "indirect" disks #325

Open
leaskovski opened this issue Feb 1, 2024 · 0 comments

Comments

@leaskovski
Copy link

With ZFS, if you remove a disk from a pool, and then add it back again, ZFS will create an "indirect" entries that then show up on discovery. See https://serverfault.com/questions/1102923/what-are-indirect-x-after-zpool-remove for more info on indirect entries.

The code in the conf file for the vdev discovery is currently...

# vdev discovery
UserParameter=zfs.vdev.discovery,/sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$  s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1  s/\(.*\)/{ \"data\":[\1/'

It should be...

# vdev discovery
UserParameter=zfs.vdev.discovery,/sbin/zpool list -Hv | grep '^[[:blank:]]' | egrep -v 'mirror|raidz|indirect' | awk '{print $1}' | sed -e '$ ! s/\(.*\)/{"{#VDEV}":"\1"},/' | sed -e '$  s/\(.*\)/{"{#VDEV}":"\1"}]}/' | sed -e '1  s/\(.*\)/{ \"data\":[\1/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant