Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there a way to find out which partition a directory is located in?

I know I can use df to list partitions and mount points but I need to be able to find out which partition any directory is located in with a simple command.

share|improve this question

3 Answers 3

up vote 11 down vote accepted
df -h .

gives you:

$ df -h .
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/disk0s2  1.4Ti  390Gi  1.0Ti    28%    /

so you have 'mounted on' for that dir

share|improve this answer
    
Arh ha. Thanks! –  Camsoft Feb 8 '10 at 10:23

take a look at this post on serverfault. it should give you all the information you need.

share|improve this answer
1  
It's recommended to copy the information to your post rather than referring to another page. –  l0b0 Apr 24 '13 at 7:58
[rajat@rajat ~]$ df -HT

Filesystem    Type     Size   Used  Avail Use% Mounted on
/dev/sda6     ext4      22G   7.4G    14G  36% /
tmpfs        tmpfs     1.1G   349k   1.1G   1% /dev/shm
/dev/sda1     ext3     200M    53M   137M  28% /boot

[rajat@rajat ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6              20G  6.9G   13G  36% /
tmpfs                 987M  340K  986M   1% /dev/shm
/dev/sda1             190M   50M  131M  28% /boot

cd /dev/sda
share|improve this answer

protected by Sven Feb 19 at 9:21

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.