Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out mount/partition a directory or file is on? (Linux Server) [closed]

People also ask

How do you check if a directory is mounted in Linux?

Using the mount Command One way we can determine if a directory is mounted is by running the mount command and filtering the output. The above line will exit with 0 (success) if /mnt/backup is a mount point. Otherwise, it'll return -1 (error).

How can I tell if a partition is mounted Linux?

The mount command is the usual way. On Linux, you can also check /etc/mtab, or /proc/mounts.

How do I find the directory partition?

pwd -P will give you the physical directory you are in, i.e. the pathname of the current working directory with the symbolic links resolved. Using df . would give you the df output for whatever partition the current directory is residing on.


df -P file/goes/here | tail -1 | cut -d' ' -f 1