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

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

link|improve this question

feedback

3 Answers

up vote 4 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

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

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

link|improve this answer
feedback

enter code here[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

enter code here

cd /dev/sda

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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