LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 05-02-2013, 09:42 AM   #1
UnhandledException
LQ Newbie
 
Registered: May 2013
Posts: 5

Rep: Reputation: Disabled
Should the pvs command show all physical drives?


I have 2 physical hard drives on my machine and thought the pvs command would display them but only one is being displayed.

> pvs

pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_jimvmserver lvm2 a-- 465.27g 185.27g


Here is my output from the df command showing 2 physical hard-drives:

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_jimvmserver-lv_root
40G 13G 25G 35% /
tmpfs 16G 832K 16G 1% /dev/shm
/Downloads/OEL/OEL_R5_U8_ISO/V31120-01.iso
3.7G 3.7G 0 100% /u02/cdrom
/dev/loop1 197M 197M 0 100% /media/Oracle Linux Server
/dev/loop0 197M 197M 0 100% /media/Oracle Linux Server_
/dev/sda1 485M 77M 383M 17% /boot
/dev/mapper/vg_jimvmserver-lv_home
99G 188M 94G 1% /home
/dev/mapper/vg_jimvmserver-lv_u01
99G 188M 94G 1% /u01
/dev/sdb1 1.8T 53G 1.7T 4% /virt_Machine


Did I misunderstand the purpose of the pvs command?
 
Old 05-02-2013, 10:58 AM   #2
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
The physical volumes that pvs displays are those created by the pvcreate command for Logical Volume Manager (LVM). In other words, a physical volume in this context is a hard disk partition that was initialized by pvcreate as an LVM "physical volume", or PV.

A hard disk could have multiple partitions, each of which could be an LVM PV. Any hard disk partitions you have that are not created as LVM physical volumes will not be listed by the pvs command. BTW, try the pvdisplay command for additional information about your PVs.

The df command lists file systems, which do not necessarily correspond to hard disk partitions either.


Try this:

Code:
cat /proc/partitions
and

Code:
fdisk -l
The -l option on fdisk lists detailed information about the partitions listed in /proc/partitions. This should include all of your physical hard drives and any LVM mapped logical volumes you have defined.

Last edited by Z038; 05-02-2013 at 11:05 AM. Reason: additional info
 
Old 05-02-2013, 11:21 AM   #3
UnhandledException
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Z038 View Post
The physical volumes that pvs displays are those created by the pvcreate command for Logical Volume Manager (LVM). In other words, a physical volume in this context is a hard disk partition that was initialized by pvcreate as an LVM "physical volume", or PV.

A hard disk could have multiple partitions, each of which could be an LVM PV. Any hard disk partitions you have that are not created as LVM physical volumes will not be listed by the pvs command. BTW, try the pvdisplay command for additional information about your PVs.

The df command lists file systems, which do not necessarily correspond to hard disk partitions either.


Try this:

Code:
cat /proc/partitions
and

Code:
fdisk -l
The -l option on fdisk lists detailed information about the partitions listed in /proc/partitions. This should include all of your physical hard drives and any LVM mapped logical volumes you have defined.


Basically, unless my hard-drive was brokend down further it won't appear via the 'pvs' command because LVM didn't play a part????

I am keeping the 2nd hard-drive as a single huge storage mass.

Here is the output from /proc/partitions

> cat /proc/partitions
major minor #blocks name

7 0 201728 loop0
7 1 201728 loop1
7 2 3793004 loop2
8 0 488386584 sda
8 1 512000 sda1
8 2 487873536 sda2
8 16 1953514584 sdb <--------Same size to indicate one large volume
8 17 1953513472 sdb1 <--------Same size to indicate one large volume
252 0 41943040 dm-0
252 1 41943040 dm-1
252 2 104857600 dm-2
252 3 104857600 dm-3
 
Old 05-02-2013, 12:37 PM   #4
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
More or less. The pvs command is a part of LVM (Logical Volume Manager). It doesn't apply to any hard drives or partitions that are not part of your LVM configuration.

LVM is an optional method of organizing your available disk resources that is independent of the underlying disk configuration. Not all systems use LVM. It adds a layer of abstraction on top of your installed base of hard drives to enable you to manage them at a higher level so that you can easily add physical drives, resize logical volumes, and so forth. But not all hard disks on your system have to be part of the LVM scheme.

There are a number of good wiki sites and articles and howto pages about LVM that you might want to search for and read.

The use of the term "physical volume" by LVM can be misleading unless you keep the context in mind. It refers to LVM-managed partitions created by pvcreate that are the building blocks of your LVM volume groups and logical volumes. It is part of the abstraction, the lowest level, of the LVM storage management system, but it is not a synonym for your physical hard drives.

The partition on your /dev/sdb device is not part of the LVM setup on your system, there are no LVM PVs created on it, so it doesn't show up in the output of the pvs command.

It does take a while to wrap your head around the LVM concepts if you are used to thinking of your hard drives solely in terms of physical drives with one or more partitions.

Last edited by Z038; 05-02-2013 at 12:39 PM.
 
  


Reply



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
Finding the Physical Hard Drives amirsd Linux - Newbie 1 12-04-2009 01:55 PM
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
How to get a list of physical drives in C++ ManuPeng Programming 11 03-20-2007 02:15 PM
Two Physical Hard Drives FC5 combatseabee Linux - Newbie 8 07-27-2006 05:13 PM
booting 2 physical drives Malique Linux - Hardware 5 04-06-2004 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 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
Open Source Consulting | Domain Registration