How can we check the mount points for partitions listed in /dev/sd*? For example, I would like know if the partition for my home is /dev/sda4.


Another approach is with findmnt:

findmnt /dev/sda4

...to get mountpoint from dev. Or vice-versa:

findmnt /home
| improve this answer | |
  • any command option that would make it return only the dev or mountpoint, so that it can be directly piped into other commands? – Matan Sep 8 '19 at 16:29
  • @Matan use the -n|-noheadings and -o|--output options. for mount point to dev translation: findmnt -no SOURCE /mount/point. for dev to mount point translation: findmnt -no TARGET. available output columns are listed at findmnt -h. – pkfm Nov 26 '19 at 6:27

You can use:

  • mount for a list of all mounted filesystems and mount options for each of them;
  • lsblk for a tree of block devices, size and mount point (if mounted);
  • df for a list of mounted block devices, size, used space, available space and mount point.
| improve this answer | |
  • lsblk is linux specific? – Milind Dumbare Mar 24 '15 at 19:29
  • Yes, util-linux package. – petry Mar 24 '15 at 20:04
  • 1
    @Miline /dev/sd* to refer to disks and partitions is Linux-specific as well. Other Unix-like systems solve the same problem but have different naming conventions. – user Mar 25 '15 at 10:26
  • 1
    lsblk was exactly what I needed. Thank you – Timothy Pulliam Oct 20 '16 at 17:52

You're actually asking two questions. The easiest thing to do if you want to know where your home is:

df -h .


df -h $HOME

Where is /tmp mounted?

df -h /tmp


If you want to know what is mounted on a certain device,

mount | grep ^/dev/sda1

(for example). Or

mount | grep ^/dev/sd

to see all the sd's.

| improve this answer | |

Depends on what you're after. If you want to check which of the partitions in /dev/sd* has a default mountpoint and what that mountpoint is, you could do

for part in /dev/sd*; do grep -w "$part" /etc/fstab | awk '{print $1,$2}; done

However, on most modern systems, partitions are mounted by UUID and not dev name, so a better approach1 would be:

for uuid in /dev/disk/by-uuid/*; do 
    mpoint=$(grep "$(basename $uuid)" /etc/fstab | awk '{print $2}')
    [ -n "$mpoint" ]  && echo  "$(basename $(readlink $uuid)) : $mpoint"; 

On my system, for example, that returns:

sda3 : swap
sda1 : /
sda2 : /home
sdc1 : /mnt/bigboy
sdb3 : /mnt/movies
sdb1 : /winblows

You could also extend that to report those partitions with no default mount point:

for uuid in /dev/disk/by-uuid/*; do 
    dev=$(basename $(readlink $uuid))
    mpoint=$(grep "$dev" /etc/fstab | awk '{print $2}')
    if [ -n "$mpoint" ]; then
      echo  "$dev : $mpoint"; 
      echo "$dev : No mountpoint"

If you want to find out the partition of a given directory, for example ~/, you can use df:

$ df /home/
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda2      442047744 266441120 153128800  64% /home

Or, to get the device name only (note that the --output flag is not POSIX):

 $ df --output=source /home/ | tail -n1

To get a list of currently mounted partitions and their mountpoints:

mount | awk '/^\/dev/{print $1,$3}'

Finally, a very useful command is lsblk:

$ lsblk 
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0  29.3G  0 part /
├─sda2   8:2    0 428.4G  0 part /home
└─sda3   8:3    0     8G  0 part [SWAP]
sdb      8:16   0   1.4T  0 disk 
├─sdb1   8:17   0   9.8G  0 part /winblows
├─sdb2   8:18   0     1K  0 part 
├─sdb3   8:19   0   1.2T  0 part /mnt/movies
├─sdb5   8:21   0  46.6G  0 part 
├─sdb6   8:22   0    14G  0 part 
├─sdb7   8:23   0 117.4G  0 part 
└─sdb8   8:24   0   2.3G  0 part 
sdc      8:32   0   1.8T  0 disk 
└─sdc1   8:33   0   1.8T  0 part /mnt/bigboy

1An even better approach is findmnt but I'd never heard of that before reading @taliezin's answer.

| improve this answer | |
  • I guess the mention of /etc/fstab is good, but your loops over it seem needlessly complex. Also, /proc/mounts is always up-to-date, but /etc/fstab doesn't necessarily match. The first script could be awk '/^[^#]*\/dev\// {print $1, $2 }' /etc/fstab. You typically don't need grep if you're also using awk. The regex is more complex because I'm filtering out comments, and I have to escape the /es since I'm inside a /pattern/. Anyway, quick one-off scripting stylistic debate aside, df is probably the best recommendation for everyday use. fstab can have LABEL= as well as UUID=. – Peter Cordes Mar 25 '15 at 7:43
  • @PeterCordes as I mention in my answer, fstab is used to show the default mount point. Of course it's not always up to date, that's the point! As I also explain, I am using the loops to show which of the partitions in /dev has a default mount point. I did it that way because I wanted to include an example that listed those that don't. That and for the sake of readability is why I didn't just use awk. We're talking about parsing about a dozen lines of text, for such simple tasks I always choose readability and succinctness over cold efficiency. – terdon Mar 25 '15 at 12:33
  • @terdon - mtab is for showing up-to-date mount points. – mikeserv Mar 28 '15 at 0:28
  • df --output=source /home/ | tail -n1 is the only option out of all of them that allows you to find which device a sub directory of another mountpoint is in. – Gaia Sep 2 at 6:00

You can use mount command. It also shows options with which the mounting is done.

| improve this answer | |

You're looking for the df command.

| improve this answer | |

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