That's a sort of Holy Grail but, unfortunately, due to hardware diversity it's not easy or even possible at all.
I remember that Sun systems had a nice way to identify drive bays. But, how do know which backplane slot is "da0"? LSI/Avago?/Broadcom HBAs, moreover, have the nasty habits of keeping a mapping between disk serial numbers and device identifiers.
The only reliable approaches I know, besides putting an actual, physical label, on each disk, is to use "sesutil map", "sesutil locate/fault", or even sas2ircu. And I would make sure that all of them work before relying on them. I have a Dell backplane here with some random shuffling of slot numbers. No idea why, it just happened at some time.
Welcome to peecee chaos at its worst.
"But, how do know which backplane slot is "da0"?"
sas2ircu or sas3ircu will match the backplane slot with the drives serial number. Make a list of the which serial number matches which da number and start work naming your drives. After that it doesn't matter about the da numbers as your identifier is now the name of the drive itself.
In my case I find using the 90 bay Supermicro JBOD the system auto assigns da0 and da90 to drive slot one and then da1 and da91 to drive slot 2 etc so I don't generally go through the process of checking da numbers against serials as its not required however I always check the mapping afterwards before the system goes into production. On smaller systems its a quick job but on bigger systems it takes a while but just keep telling yourself you should only ever have to do this once.
I've done this for years and currently have thousands of drives setup this way on many different types of hardware with many replacements under my belt. Remember to do the same process when replacing drives. Single pathed systems are trickier as you need to name the drives and then make the pool on the command line and then export and import into the UI. Future disk replacements also need to be done on the command line otherwise you won't see the drive name after its been added to the pool.
Example of creating a pool on the command line using glabel names:
zpool create –f tank raidz2 label/1_50PV_2_0 label/2_ZHZV_2_1 label/3_52WV_2_2 label/4_TL7V_2_3
I normally create a dummy pool out of the drives before hand via the UI and then export it NOT MARK DISKS AS NEW as that way Freenas sorts all the partitioning for me hence why I need the force command above. Do the same for disk replacements ie. build a pool out of your new disk and then export and replace via the command line.
zpool replace –f tank label/1_50PV_2_0 label/1_16LE_2_0
(notice how only the middle part of the name has changed as that is part of the serial number, the slot is the same as is the enclsoure ID).
Your disk naming will not appear within the UI but it will on the command line with zpool status.
Once the pool is created via the command line set the following pararmeters.
From the command line set the zpool failmode to continue and autoexpand to on.
zpool set failmode=continue tank
zpool set autoexpand=on tank
From the webui set the top level dataset compression to lz4 as when you create the pool from the command line this does not happen by default.
Good luck and enjoy naming your drives.