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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-28-2009, 06:40 PM
|
#1
|
Member
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567
Rep:
|
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?
|
|
|
12-28-2009, 06:45 PM
|
#2
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979
Rep:
|
Hello worm5252,
use Markus
|
|
|
12-28-2009, 07:28 PM
|
#3
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983
|
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.
|
|
|
12-28-2009, 07:49 PM
|
#4
|
Member
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567
Original Poster
Rep:
|
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:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|