Stux
MVP
- Joined
- Jun 2, 2016
- Messages
- 4,419
You have a great bit of code here. I got it working on both of my FreeNAS systems last night and took it into work with me this morning.
Unfortunately for me, the system I wanted to run this on that has no Internet access is CentOS and this script will not run on it because of the ''sysctl -n kern.disks". It there is no kern.disks in CentOS. I spent some time looking at it today but I have not done any bash scripting in over a decade and even when I was doing it, I never did anything this sophisticated.
CentOS has a directory /dev/disk/by-partid that appears to list only the disks in the zpool.
Well, kern.disks is a BSD kernel property. And CentOS is Linux.