Solved

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

Posted on 2009-07-04
5
739 Views
Last Modified: 2013-12-06
Hello,

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.
VolGroup00.bmp
VolGroup01.bmp
0
Comment
Question by:ora-what
  • 3
  • 2
5 Comments
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24778506
Hi,

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.

Cheers,
K
0
 

Author Comment

by:ora-what
ID: 24778536
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?)
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24778639
Ok letss clear about something. Physical dirves are indicated as:

/dev/hda
/dev/hdb
/dev/sdc

For ide drives and
/dev/sda
/dev/sdb
/dev/sdc

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.


0
 

Author Closing Comment

by:ora-what
ID: 31599852
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:

/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd

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
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24779325
You're welcome. Cheers.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now