June 19, 201610 yr I am trying to write a script and I need to know how many disk are in my system. Yes, I can just hard code the number but I plan on sharing it and want to do it the proper way. Is there a way to programmatically find out how many disks are mounted in the array?
June 19, 201610 yr You can parse /var/local/emhttp/disks.ini Or just keep testing if /mnt/disk1, /mnt/disk2, /mnt/disk3, ... exists as a directory.
June 19, 201610 yr Author You can parse /var/local/emhttp/disks.ini Or just keep testing if /mnt/disk1, /mnt/disk2, /mnt/disk3, ... exists as a directory. OK, I'll take a look at the ini. My initial idea was your second suggestion. But come to think of it, I don't really need to know how many disks there are. I'm really just trying to find which disk a file is on and the simplest thing would probably be to just search disks 1 to 21 (or whatever the upward limit is) until it finds it.
Archived
This topic is now archived and is closed to further replies.