Page 1 of 1

script to identify physical disks not part of a pool?

PostPosted: Fri May 12, 2017 1:47 am
by tangles
Hi,

Looks like I need a script that identifies a physical disk that is not part of any currently mounted pool...

Image

Code: Select all
diskutil list | grep ZFS
will get me by for now, but am curious if anyone has already written something.

Cheers,

Re: script to identify physical disks not part of a pool?

PostPosted: Tue May 16, 2017 4:29 pm
by lundman
Ah hmm, active disks can use -L to follow through, but for the dead disk.. Presumably you can't "ls" the /var/run symlink as it is gone, but invariantdisk does produce log output, so you could probably grep the symlink name and get the original disk name. I wonder if there are better ways