LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the easiest way to match a mount point to a device? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-easiest-way-to-match-a-mount-point-to-a-device-778565/)

worm5252 12-28-2009 05:40 PM

What is the easiest way to match a mount point to a device?
 
Say I have to work on an unknown systems with multiple hard drives. I know it has the primary system on /dev/sda. What is the easiest way (without checking /etc/fstab or /etc/mtab) to check to see what /dev/* is mounted where?

In otherwords, is there a command I can run that will say /dev/sda1 is mounted to /, /dev/sdb1 is mounted to /media/Data, /dev/sdc1 is mounted to /home/user/backups/, and /dev/sdc2 is mounted at /var/www/usb/?

Know what I mean?

markush 12-28-2009 05:45 PM

Hello worm5252,
use
Code:

df -h
Markus

lleb 12-28-2009 06:28 PM

it will look like this:

Code:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              48G  1.7G  44G  4% /
/dev/sda1            251M  38M  201M  16% /boot
tmpfs                1014M    0 1014M  0% /dev/shm
/dev/sda3            133G  120G  6.8G  95% /home1
/dev/sdb2              71G  36G  31G  54% /home11
/dev/sdc1              20G  13G  6.7G  66% /winXP
/dev/sdc2            260G  226G  35G  87% /winXP_data
/dev/sdd3              19G  7.9G  9.6G  45% /sdd3
/dev/sdd4            208G  159G  39G  81% /sdd4
/

you can clearly see what dev is mounted to what name and with cat /etc/fstab you can see more details:

Code:

$ cat /etc/fstab
LABEL=/1                /                      ext3    defaults        1 1
LABEL=/boot1            /boot                  ext3    defaults        1 2
tmpfs                  /dev/shm                tmpfs  defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                  /sys                    sysfs  defaults        0 0
proc                    /proc                  proc    defaults        0 0
LABEL=SWAP-sdb1        swap                    swap    defaults        0 0
/dev/sda3                /home1                        ext3        exec,rw,noatime,user        0 0
/dev/sdb2                /home11                        ext3        rw,noatime,user        0 0
/dev/sdc1                /winXP                        vfat        rw,noatime,user,umask=00 0
/dev/sdc2                /winXP_data                ntfs-3g        rw,umask=0000,defaults        0 0
/dev/sdd3                /sdd3                        ext3        rw,noatime,user        0 0
/dev/sdd4                /sdd4                        ext3        rw,noatime,user        0 0

now not only can you see what is mounted to what name, but what file type, what permissions, etc... this is on my NFS server so permissions are very open for my home use.

worm5252 12-28-2009 06:49 PM

Thanks, I use du but I never use df. That's why I did not know.


All times are GMT -5. The time now is 05:11 PM.