Timeline for Determine what device a directory is located on
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 5, 2024 at 6:08 | comment | added | akki | I guess df -h $(stat --format %m /tmp/mydir/morefiles) could make this work even for inner directories. | |
| Jun 25, 2023 at 0:01 | comment | added | Brent Bradburn | For the mount point of the current folder, just type: df . | |
| May 8, 2014 at 13:55 | vote | accept | StrongBad | ||
| May 8, 2014 at 13:49 | comment | added | terdon♦ | @StrongBad if it's a link, you could get the device name with df $(readlink -f /path/to/file) | tail -n 1 | cut -d ' ' -f 1. | |
| May 8, 2014 at 13:26 | comment | added | StrongBad | @Patrick done, I think | |
| May 8, 2014 at 13:18 | comment | added | slm♦ | I think you're relegated to walking it recursively then. But just so we're clear can you please update your Q with what Patrick mentioned? | |
| May 8, 2014 at 13:18 | comment | added | StrongBad | readlink -f /mnt gives /mnt | |
| May 8, 2014 at 12:48 | comment | added | phemmer | @StrongBad if you have to deal with determining the mount point/device when obscured by symlinks, you should put that in your question. It'll make it much easier to get the right answer. | |
| May 8, 2014 at 12:37 | comment | added | slm♦ | @StrongBad - what does readlink -f /mnt show? | |
| May 8, 2014 at 12:29 | comment | added | StrongBad | With bind mounts despite what shows up in /proc/mounts the "thing" that is mounted, at least in my mind, is not the device it is the directory/file. | |
| May 8, 2014 at 12:27 | comment | added | StrongBad | If $PWD (which is what I am mounting) is buried in a series of symlinks, bind mounts, etc then I would need to recursively examine the path for mount points. | |
| May 8, 2014 at 12:27 | history | edited | terdon♦ | CC BY-SA 3.0 | I think this is what the OP was asking |
| May 8, 2014 at 12:18 | history | answered | slm♦ | CC BY-SA 3.0 |