Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello to all - need enlightenment on AIX and LVM 2

Status
Not open for further replies.

solid7

Technical User
Apr 17, 2005
70
US
Hello everyone. Obviously, I'm a new user of this forum - but I'm also as new as can be to AIX administration.

I've been a user of AIX workstations for about 10 years, but I recently purchased my own RS6000, and will use it for a workstation first, and later as an entry level server.

I am having much difficulty understanding all things related to LVM. I just simply don't understand logical volumes, and physical volumes, and volume groups, etc.

Does anyone know of a very BASIC explanation of these things, and possibly good analogies, or parallel usage terms for which to ascribe? I'm not an idiot, but I'm certainly out of my element when it comes to this area.

Thank you in advance.


-------
CAD Design Services by 2H Technical and Translation Services
 
Solid7,

Download the certification papers on AIX and you'll find a chapter or two dedicated to the subject, together with simple examples.

In brief you have physical volumes, that's the hard disks, you have volume groups that are logical groups of hard disks, you have logical volumes that you can think of as reserved sectors on the disk (and are setup within logical volumes), and you have filesystems within the logical volumes.

Hope that helps.
Mark
 
Forgive my ignorance - but what are the certification papers, and where do I get them? Is this what I have seen referred to as "redbooks?"

Thank you for your response.


-------
CAD Design Services by 2H Technical and Translation Services
 
Wow... that's a little overwhelming. Know of anything simpler? (not to sound ungrateful - but like I said, I'm out of my element)

It's not what I would call "LVM for Dummies"

Maybe my question is better served by asking specifically. I think I will post it on another thread.

Thank you.


-------
CAD Design Services by 2H Technical and Translation Services
 
Yeah - I did. I'm desperately trying to grasp, but it seems like too much info all at once.

What am I missing? Are these hard things to understand, or is it just me?


-------
CAD Design Services by 2H Technical and Translation Services
 
When we start, it's really hard to assimilate. It's not you. You have to read and understand and read again and something that can really help you is to practice on your machine. Some command to execute on your system to start:

smit vg
smit lv
smit fs

It gives you some way to start the pratice...
 
reneford is right, it is not an easy thing to understand, as the preface in "

AIX Logical Volume Manager from A to Z: Introduction and Concepts - PDF 3.5 MB


" says

LVM is a vast topic

but it is well worth the hassle

once you get started it will get easier

just have a play with vg, lv and fs settings (on a test vg) making / deleting volume groups, resizing file systems, etc. and you will be on your way.
 
I'm going to do just that, after I solve my new problem. (which I can handle - hurry for me)

I'll come back with a progress report in a few days, or so.

Thank you all so much for your help. I really appreciate it.




-------
CAD Design Services by 2H Technical and Translation Services
 
Hi ,

For a quick and hopefully simple overiew , see if this makes sense

1. You have a hard disk
2. Pysically install this hard disk in your machine
3. For arguments sake the server sees the disk as hdisk5 size 18.2GB
4. In order for you to use this disk , you create a volume group
5. In this volume group you add this disk
6. when you add this disk to the volume group , you have to set PP size( physical partiton) these are small chunks in mb that occupy your disk and cannot exceed 1016
and are normally multiple of 2 i.e. 4 , 8 , 16, 32 , 64 , 128 etc..
so if you have 18.2GB disk and dived by 4MB the number of PPs is about 4500 . This exceeds the value you can have i.e
max 1016 per disk , therefore you select the next PP size
which is 8MB , PPs you have on your 18.2GB disk is about 2000 this still exceeds 1016 , then you select your next PP size i.e 16MB and so on until the PPs are less than = 1016

( you select the PP value when you create your volume group)

7. Once you have added your disk and created your volume group , you create your logical volume

8. Logical volume will be create on several PP's ( note PP's are mapped to LP's ( logical Partitions)

so if you want to create a logical volume of size 2GB and your PP size you created in step 6 is 32mb
you will need 64 32MB PPs to create 2GB LV ( 32*64 =2048)
so when you create you LV you specify the name and disk
and size ( i.e.number of LPs note PPs map to LPs ) which is
64

9. Next to keep things simple , you create your filesystem on the top of the logical volume


so it s

add disk ---> create VG with correct PP size ----> create LV --- create filesystem


HTH
 
OK, this is getting better. The thing is, I only have one drive, and if I understand Logical groups correctly, each physical volume (hard drive, for me) can only belong to 1 volume group. In my case, that would be rootvg.

I'm not sure, for what I'm doing, if I NEED another logical volume or not. For conversation sake, let's say I don't. If I want more allocated space in the logical volumes that already exist, I just need to go change the value of the physical partitions in smit vg? (36GB drive, currently set to 8MB)


-------
CAD Design Services by 2H Technical and Translation Services
 
Err...

No the easiest way is to go to the smitty fs screen and add to the number of partitions that are allocated to that file system...

Mark
 
I don't see an option to add to the number of partitions.

What is it called?

Currently, I have 2097152 of 512-bytes assigned.


-------
CAD Design Services by 2H Technical and Translation Services
 
smitty for me is actually more confusing, it gives too many options.

I prefer using the CLI for my LVM stuff.

 
Hi Solid7,

What I understand is, you want to increase te size of a particular filesystem.

use the following command:

chfs -asize=+1 </file/system/name>

This command wants to add 1 (512byte) block to your filesystem (FS), but the LVM rounds this up to 1 physical partition (PP), or 8MB in your case, as this is the smallest building block of a logical volume (LV) and a FS is contained within a LV.

So, this would add another PP to the underlying LV, provided that there are still some free PPs in your volume group, and that you don't bump into a specific other limit for this particular filesystem or logical volume.

The good thing of this chfs command is, that all the underlying LVM stuff is taken care of for you by the system, without you having to know a great deal of LVM.

You can run this command multiple times, adds another 8MB each time. or you can do the math yourself:

Let's say you want to double your FS size, currently 2097152, so times two = 4194304

command: chfs -asize=4194304 /file/system/name

As another example, you want to increase the size of a FS to 1.5GB

1.5GB = 1536MB = 1572864KB = 3145728blocks

command: chfs -asize=3145728 /file/system/name

you can even use simple numbers, and let LVM worry about multiples of 8MB

command: chfs -asize=3000000 /file/system/name

and if you are using AIX52 or later it is even easier:

chfs -asize=1.5G /file/system/name
chfs -asize=1500M /file/system/name

again, LVM rounds up to the next 8MB multiple...

You can also specify the /dev/lv-name instead of the possibly longer /file/system/path/name in the above commands: use df or lsfs command to find out the names of your filesystem.

HTH - p5wizard
 
Good post p5wizard!

what if you want to add 10 PPs using the chfs command?

Is it
chfs -a size=+10 or do I have to do chfs -a size=+1 10 times?
 
if your PP size is 8MB, and you want to add 80MB (i.e. 10 PPs) use:

chfs -asize=+80M

provided you are using aix52 or later, otherwise run

chfs -asize=+1

10 times or do the math yourself:

10 PPs * 8 MB_per_PP * 1024 KB_per_MB * 2 blocks_per_KB

chfs -asize=+163840

I thought it was explained in my previous post...

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top