How to obtain detailed device / partition info from file path on Linux (like UUID, hard drive serial etc.)
Starting with an absolute file path, I want to obtain the following information: The mount point of the filesystem on which the file is stored (in order to compute the path relative to the mount point) The UUID and label of the file system The type (or vendor name) and the serial number of the hard drive that contains the partition I am aware that 2 and 3 may be undefined in many cases (e.g. for loopback, ramfs, encyrpted devices), which is totally fine. I also know how to obtain that information using a shell and system tools like df and the /sys or /proc filesystem. See this question for