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
  Search this Thread
Old 06-04-2015, 10:57 AM   #1
Archangelmscj
LQ Newbie
 
Registered: Jun 2015
Posts: 12

Rep: Reputation: Disabled
Simple Linux Command


I am somewhat of a noob and I am trying to locate a simple linux command that will allow me to take partitions and see what hard drives they are on. I can see the partitions and logical volumes but, don't know who to see which hard drives they are attached to. OS is Cent OS 6.
 
Old 06-04-2015, 11:03 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,516

Rep: Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436
probably:
sudo fdisk -l
sudo gparted
 
1 members found this post helpful.
Old 06-04-2015, 12:47 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Code:
lsblk
 
Old 06-04-2015, 02:09 PM   #4
fatmac
Senior Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: BSD & Linux - As long as they are Lightweight
Posts: 1,704

Rep: Reputation: Disabled
Welcome aboard.
Other possibles :-
Code:
 df -h
or
Code:
 cat /etc/fstab
 
1 members found this post helpful.
Old 06-05-2015, 10:12 AM   #5
Archangelmscj
LQ Newbie
 
Registered: Jun 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks to all who have responded. The above commands show me /dev/mapper/VolGroup??. How can I take this information and correlate it to a physical drive. From my understanding is sda1 is drive 1 and sdb1 is drive 2 and so on. Is my logic correct? If so how can I determine which drive sda1 and sda2 are on? Are they both on the same physical drive?

I am sorry gparted and lsblk didn't work.
 
Old 06-05-2015, 11:07 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
All partitions starting with sda (sda1, sda2, ..., sdan) will be on the first disk, all partitions starting with sdb on the second, and so on.
This is different for volume groups, they belong to a LVM setup. For example, a volume group can reside on a single partition on a single physical disk, but you can also have volume groups that spend over several partitions on one (or more) disk(s). To get reliable information on that you will have to use the tools LVM offers, like pvdisplay, vgdisplay, lvdisplay, ... .

Quote:
Originally Posted by Archangelmscj View Post
I am sorry gparted and lsblk didn't work.
What do you mean with "didn't work"?

Last edited by TobiSGD; 06-05-2015 at 11:08 AM.
 
1 members found this post helpful.
Old 06-05-2015, 11:09 AM   #7
Archangelmscj
LQ Newbie
 
Registered: Jun 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
TobiSGD....Thanks those commands along with the command pvs gave me the information I needed. Thanks you all
 
Old 06-05-2015, 01:41 PM   #8
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Also just to show a bit more powerful method, bypass the software tools and go directly to source:

cat /proc/mounts
 
Old 06-05-2015, 01:50 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Quote:
Originally Posted by joec@home View Post
Also just to show a bit more powerful method, bypass the software tools and go directly to source:

cat /proc/mounts
Which will only show you mounted filesystems, not all that are present on the disks, of course.
 
Old 06-05-2015, 02:20 PM   #10
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by TobiSGD View Post
Which will only show you mounted filesystems, not all that are present on the disks, of course.
Ah yes, thank you. Needing to get some more rust off my brain. Partitions can also be seen in proc:

cat /proc/partitions

Though it would not show network devices, that gets more ugly and better off with the software tools. Either case get to know the /proc/ folder, good info in there.
 
1 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
simple questions looking for a simple command s3ns4i Linux - Newbie 4 10-21-2008 01:55 PM
simple linux command questions herve2001 Slackware 5 02-11-2005 08:44 PM
Simple Linux command Problem GUIPenguin Linux - Newbie 2 09-23-2004 05:47 PM
booting linux in simple command line tombomb300 Linux - Newbie 1 10-18-2003 02:49 PM
Simple help in Linux command line daeojkim Programming 3 09-30-2003 11:21 PM


All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration