linux lvm how do you determine which physcial hard disk drive is mapped to a particular partition


I have a pre-installed VMware machine with Linux Red Hat Enterprise Server 5 and Oracle 11g installed.

I have 4 10GB hard drives on the machine. By hard drives I mean 4 separate real-life hard disks (well through the VMware that is).

I have been analying my partitions with the Linux Logical Volume Management graphical tool.

I can see how things are layed out but I'm confused as to what a physical and logical partition really means.

I would like to know where I can see where the so-called "physical" partitions are mapped to the 4 hard disks that I have.

It may be a simple question.

I do have 4 "physical views" or physical partitions however they are separated between two different "Volume Groups" so I'm not sure if each physical volume is mapped to a different physical hard disk.

I've attached some screenshots from my LVM.

I have a 2 volume groups, I've uploaded a screenshot for each one.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kerem ERSOYPresidentCommented:

First of all LVM is organised like that:
- First of all you have Physical Volumes (Actual Hard Dsiks) with physical partitions on them. Such as /dev/sba,sbd etc and physical partitions such as /dev/sda1,/dev/sdb1. Your physical partitions will have a partition type of LVM (8e)
- You organize one or more physical partitions as logical volumes. You can see this in your second pic where you have a logical volume VolGroup01 including physical partitions (/dev/sdb,c,d)  organized as a single logical volume (VolGroup01)

While you see that there's only one physical partition allocated to your VolGroup00  in the first picture.

The good thing about LVM is that. You have a logical volume it may contain one or more physical partitions and/or physical volumes (having at least one physical partitions) so that you can expand the volume when you are out of spca on the logical volume.

If you hadn't had LVM then you'd need to add another Physical Volume (Hard-disk) to your system. Then You2d need to create a physical partition on your drive and then you'd need to mount this partition under your file tree. So that You would only be able to allocate space under this directory without having a chance to expand it when needed. If you were out of space without LVM all you would do is to format a new hard disk mount under another directory ( say /mnt) then copy the content of the entire directory to it. Unmount both and remount the new volume under the old path discarding the fisnitila smaller disk.

But with LVM you can always add physical disk (with a physical partition) and expand the space for entire tree..

I hope this helps if you have further questions I'll be happy to hear about them.

ora-whatAuthor Commented:
ok that is very good to know

so, between the 2 logical volumes I have (meaning the Volume Groups) I have a total of 4 physical volumes/partitions

(plus the uninitialized boot partition which is /dev/sda1)

according the LVM does this mean that each individual physical volume/partition is on a different hard disk?

(also, ive noticed on google references to the directory /hda, is this directory somehow related or would that be just a user named directory?)
Kerem ERSOYPresidentCommented:
Ok letss clear about something. Physical dirves are indicated as:


For ide drives and

for SCSI and SATA / SAS drives.

/dev/sda is a physical volume and /dev/sda1 is the first physical partition on /dev/sda and /dev/sda2 is the second physical partition over the same disk.

So you have 4 physical disks /dev/sda, /dev/sdb, /dev/sdc and /dev/sdd. /dev/sda is divided into 2 partitions. The first is /dev/sda1 . This is your boot volume and currently mounted under /boot.

/dev/sda2 physical volume is mounted under the VolGroup00. VolGroup00 contains 2 logical volumes. LogVol00 and LogVol01. The LogVol01 contains your SWAP partition and LogVol00 contains your  root file system.

So when it comes to your questions:

- You have 4 physical disks
- /dev/sda1 contains 2  Phyisical Partitions
- /dev/sda1 is mounted under /boot as a physical partition.
- /dev/sda2 contains your LVM Volume Called VolumeGroup00.
- VolumeGroup00 contains 2 logical Partitions: LogVol00 and LogVol01
- LogVol00 contains your / and your LogVol01 contains your Swap Space.
- You have another VolumeGroup which is called VaoGroup01
- VolGroup01 spans to 3 physical Partitions: /dev/sdb1, /dev/sdc1 and /dev/sdd1
- Each Physical Volume /dev/sdb to /dev/sdd contain single physical partitions on each drive.
- They are all allocated to the VolumeGroup.

So yeah each volume and partitons are avore their respective volumes. and VolGout01 is a collection of physical Parttiitons and logical Volumes and maps then to each other.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ora-whatAuthor Commented:
thanks for the thourogh explaination it really helped

yes I didn't notice the /dev/sda - sda1 sda2 pattern

now I can see that my 4 physical disks are:


and that numbers 1,2 ect get added to the end of those for each physical partition

I understand the mapping now, it makes sense

cheers :D
Kerem ERSOYPresidentCommented:
You're welcome. Cheers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.