20

I have a lot of filesystems:

  • / on a PCI-E SSD
  • swap on a SATA SSD
  • /media/ned is a RAID5 array
  • /tmp lives on RAM
  • Parts of /home/oli are symlinked and bind-mounted in from ned
  • I also have /media/jeff/ which is RAID1 that I store backups and bind-mount ~/.wine in off.

It's actually a lot more complicated than that. There are all sorts of extra symlinks that I need to untangle in the long run but for now I just need a nice way of taking a path and finding out where it physically lives.

2 Answers 2

21

This is not probably the best or the correct answer, but df can do it:

javier@todocolor:~$ df /boot/grub/
S.ficheros         Bloques de 1K   Usado    Dispon Uso% Montado en
/dev/sda2               918354    184202    685154  22% /boot
javier@todocolor:~$ df .
S.ficheros         Bloques de 1K   Usado    Dispon Uso% Montado en
/dev/md0              75532064  13930424  57795044  20% /

Take the first and the last column.

1
  • For eg long NFS mount paths, df sometimes splits its report across more than one line, so it might be wise to take the second line rather than the last one, or to use --portability (a switch whose portability I doubt!). Apr 13, 2018 at 0:05
11
df /path/to/filename    # to find out what device a file or folder is on
1
  • followed by mount to see the filesystem for each mounted location Apr 5, 2017 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .