2016-02-01 12:32 GMT+01:00 Johannes Schauer <[email protected]>:
> does there exist an easy way to detect at run-time whether overlayfs is
> available on the system?
A dumb method could be checking whether the filesystem is listed in
/proc/filesystems:
$ cat /proc/filesystems | grep overlay
nodev overlay
$
But I think it will return nothing if overlay module is not loaded via
modprobe first, and again it's Linux-specific...
A full check would be like this:
if system is Linux:
if /proc/filesystem contains overlayfs:
overlayfs available
else if modprobe overlay:
overlayfs available
else:
overlayfs not available
else:
overlayfs not available
... but my impression it's not 100% error-proof.
--
Cheers,
Luca