I need to test in a script, whether a file is from a network mount or truly local. To be more clear: I need to test, whether parsing the contents will be fast or slow, but for my case local vs network is a reliable indicator.
The best attempt I've come up with is
stat -c %m [path] to get the mount point for the path, which gives
/ for files on my local disk and the mounting point for a CIFS mount.
But I suspect that this isn't a reliable diagnostic beyond my very simple config (one local drive, one big partition, a couple of network mounts) so I'd like a robust/canonical approach. Searching hasn't given any useful leads; terms like “network” and “path” are just too overloaded.