LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 12-28-2009, 05:40 PM   #1
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX
Posts: 565

Rep: Reputation: 57
Question 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?
 
Old 12-28-2009, 05:45 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,970

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Hello worm5252,
use
Code:
df -h
Markus
 
Old 12-28-2009, 06:28 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,284

Rep: Reputation: 394Reputation: 394Reputation: 394Reputation: 394
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.
 
Old 12-28-2009, 06:49 PM   #4
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX
Posts: 565

Original Poster
Rep: Reputation: 57
Thanks, I use du but I never use df. That's why I did not know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount problem - device already mounted or mount point busy zahoo Linux - General 7 08-28-2009 05:02 PM
device mount point/driver access richmgb Linux - Embedded & Single-board computer 2 04-18-2009 03:13 AM
find mount point given device kornelix Programming 2 04-13-2007 09:01 AM
Where to find mount point for USB Removable device bobbelfield Mandriva 3 02-17-2006 10:37 PM
would it make sense to have 2 mount point for 1 device? sirpelidor Linux - Hardware 3 12-27-2003 12:10 PM


All times are GMT -5. The time now is 09:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration