Blogs Classifieds Downloads FlashChat Gallery Googlemap Invite Friends Links Projects Reviews Wiki
 


Welcome to the pSeries Tech Forums, our free peer-based support site for administrators, engineers and architects working with IBM pSeries servers and software.

You are currently viewing our site as a guest which gives you limited access to view most discussions, articles, tutorials and access our other free features. By joining our community you will be able to collaborate with administrators, engineers and architects charged with designing, delivering or maintaining IBM pSeries server environments.

Founded by a recognized IBM pSeries consultant and IBM Redbook author, pSeries Tech Forums was developed with the single mission of bringing IBM pSeries professionals together into a single self-help community.

Registration is fast, simple and absolutely free to all IT professionals with responsibility for or interest in IBM pSeries servers. We invite you to join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Our Sponsors
Want to advertise?  


Reply
 
LinkBack Thread Tools
  #1  
Old September 29th, 2006
prakash's Avatar
prakash Offline
Junior Member
 
Join Date: September 2006
Posts: 9
how to setup LVM?

Hi All,

I am new in AIX admin.
I want to know how to setup LVM in AIX 5.3, i.e
if i have a disk of say 10gb, how i will add it to PV , then create VG, and then LV through command line in AIX5.3.
__________________
Prakash
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old September 29th, 2006
sbzx's Avatar
sbzx Offline
POWER SE
 
Join Date: September 2006
Location: Szentendre, Hungary
Posts: 27
Wink Re: how to setup LVM?

Prakash,

LVM is a big chapter in the Great Book of AIX. You have to read first (the manual is a good place to start) and ask more specific questions later.

Your question is similar to asking how to drive a car. Well, easy, you jump in, ignition, accelerator and you're on your way... Or maybe it's a little more complicated. Consult the documentation first.

Check out the man on mkvg, mklv, crfs, lspv, lsvg, lslv, lsfs, lsdev...

Cheerz,
:sbzx:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old October 4th, 2006
pedz's Avatar
pedz Offline
Member
 
Join Date: July 2006
Location: Leander, TX (just north of Austin)
Posts: 58
Re: how to setup LVM?

The hardest command is crfs. It has a lot of options. In the examples below, I will use names like hdisk2. You will substitute other names for these.

MKVG: The simplest is just "mkvg hdisk2" It may say "Gee, it looks like this is part of a volume group already. In that case, add "-f". This will create a volume group with a generic name like "vg00". Thats fine. If you want a particular name, add "-y vgname" (where vgname is the name that you want). For the simple case, let the other options default.

You do not need to make a logical volume if you are going to make a file system. The system will do that automatically for you. The simple case of creating a file system is:

crfs -v jfs -a size=512M -Ano -prw -tno -a frag=4096 -a nbpi=4096 -a ag=8 -g vg00 -m mountpoint

Here vg00 is the volume group name, mountpoint is something like /usr/dog (the place where the file system will be mounted). As you can see, this is a lot of options. -v jfs is the type of file system. -a size=xxxx is the size of the file system (but file systems can be expanded so this is less critical).

A common trick is to do things from smit. Then look at smit.script in your home directory to see what was actually executed. But in the case of some more complex commands (crfs is a good example), you will see a small shell script to create a function and then a call to that function. So it is not as clear what the final command will be.

But, as the previous post suggests, this is an endless topic -- but at the same time, a lot of the versitility you can determine once for your own personal usage and then it will rarely change.

Good luck
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old October 6th, 2006
prakash's Avatar
prakash Offline
Junior Member
 
Join Date: September 2006
Posts: 9
Re: how to setup LVM?

Hi pedz,
first of all thanks a lot of your information about LVM.
As suggested by sbzx in his post, i tried reading the Red Books on LVM and got some idea about it. Although i have already worked on LVM in HP-UX, i was expecting it to be same or similar.
Here the difference is that we start by creating the VG first.
One quick question i want to ask here is that, is there no need to run mklv command for creating lv's? I mean as you suggested to go directly for command crfs for creating filesystem.
As i have learned in Red book is that , first you need to create VG by command mkvg. Then you need to create lv by command mklv, and then atlast we create filesystem by command crfs.
please help clarifying this.
__________________
Prakash
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old October 6th, 2006
pedz's Avatar
pedz Offline
Member
 
Join Date: July 2006
Location: Leander, TX (just north of Austin)
Posts: 58
Re: how to setup LVM?

There is no need for you, as a user, to type in and execute the mklv command *if* you are going to put a file system. The crfs does this for you "under the covers" as they say. The books probably tell you to do it because it does need to happen, but it happens automatically. You can, for educational purposes, do it yourself as well. But in that case, the particular arguments to crfs will likely change.

Also, if you want to create a dump partition or something else that is not going to be used by a file system, then you need to do the mklv command.

Also, it may be of interest to go into smit (or smitty) and navigate to the menu to crreate a file system. You will note that there are two options: create a file system (which create the logical volume) and create a file system on an already existing logical volume.

Oh... I bet also that you have more control if you create the logical volume yourself first. The placement of the lv and many other options I do not think are presented at the crfs command line.

Hope this helps.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old October 7th, 2006
sbzx's Avatar
sbzx Offline
POWER SE
 
Join Date: September 2006
Location: Szentendre, Hungary
Posts: 27
Re: how to setup LVM?

As pedz has already suggested, you have more control over the LV layout and other parameters if you use mklv first and create the FS in a second step using crfs. As an admin, I think you should always use the two-step approach. It may prove extremely useful in more complex situations or in cases where you need to recreate a certain layout (if you scripted the creation of the VG the first time, all you have to do now is to run the script again and you're done).
So, it's only one extra comand and so much gain!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old October 7th, 2006
prakash's Avatar
prakash Offline
Junior Member
 
Join Date: September 2006
Posts: 9
Re: how to setup LVM?

Hi pedz/sbzx,

I really thanks you guys to clarify my doughts.
I am satisfied and convinced with the answers you guys have given.
This post has helped me to understand LVM quite better.
Hope to recieve the same reponse and help for my posts in future.
I really found this forum very helpful and knowledge sharing.
once again thanks...........
__________________
Prakash
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old May 31st, 2007
ketse's Avatar
ketse Offline
Junior Member
 
Join Date: May 2007
Posts: 11
Re: how to setup LVM?

I understand how to create a VG with only one hdisk but how do you create it with 4-15G hard drives to make a 60G Filesystem? I read the man pages on mkvg and th -s flag is throwing my off. Normally I would use "mkvg -y "tivdbvg" hdisk1 hdisk2 hdisk3 hdisk4". How does the -s and -t fit in ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old May 31st, 2007
sbzx's Avatar
sbzx Offline
POWER SE
 
Join Date: September 2006
Location: Szentendre, Hungary
Posts: 27
Cool Re: how to setup LVM?

ketse,

I mean no harm but you should really consult the relevant man pages and documentation. Until you do, here's what you should do to get what you want (I will assume you use AIX 5.3):

(1) Create a VG: mkvg -S -y vgname -s 64 hdisk1 hdisk2 hdisk3 hdisk4

(2) Create an LV to occupy the entire VG: mklv -y lvname -e x -t jfs2 vgname total_pp_count, where the total_pp_count equals the total number of physical partitions in your newly created VG (lsvg vgname, check for TOTAL PPs)

(3) Create a filesystem to occupy the entire LV: crfs -v jfs2 -d /dev/lvname -m /mount_point -A y -a log=INLINE

Start reading, it'll make your life much easier. And happier! Good luck.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old May 31st, 2007
jrigler's Avatar
jrigler Offline
Member
 
Join Date: April 2007
Posts: 43
Re: how to setup LVM?

Another option that is often helpful is to learn the process through smit and then begin adding pieces as commands. In some cases you can have smit show you the command that it would run by filling in the fields and then hitting F6. Some commands look really clean and useful this way and others have extra smitty stuff in them that is not helpful. Everything you need should be under 'smitty lvm' and 'smitty fs'. Another thing you will want to understand down the road is that when you expand the size of a filesystem, the size of the underlying lv will also expand. If you start trying to expand your LVs and the fSs separately you could end up with a nasty situation where you have some wasted space in an logical volume with a smaller filesystem sitting on it. Finally, I don't know if these very useful commands are documented:

lqueryvg -Atp hdisk0 <--- shows you all sorts of stuff about the VGDA on this disk

lquerypv -h /dev/hdisk0 <--- checks to see if you can physically access the disk (often an issue with SAN SCSI Reserves) and shows you the first bit of data in HEX.

Last edited by jrigler; May 31st, 2007 at 16:13.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

These are the 100 most searched terms
Search Cloud
0042-001 0042-001 nim 0513-001 the system resource controller daemon is not active 0513-001 the system resource controller daemon is not active. 0514-061 0514-061 cannot find a child device 0514-061 cannot find a child device. 0516-787 0516-787 extendlv 0516-787 extendlv: maximum allocation for logical volume 110000ac aa00e1f3 aio aix aix aio aix freeware aixif_arp_dup_addr b150f22a b181f22a b181fb53 ba010004 c1001020 d133c002 dacnone dcb47997 fcp_array_err6 fget_config gnu tar aix gsclvmd gtar aix hi yall hmc root password hmc vmware hscl05db ibm p6 ibm p6 520 libpopt aix libpopt.a libpopt.a(libpopt.so.0) is needed by rsync-2.6.2-1 migratelv mksysb navisphere agent nim server pseries pseriestech rsync aix sc_disk_err4 scan_error_chrp vio server websm xhost file ... powered by Simple Search Cloud


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How best to setup P505/ hmc test lab patelhk1 pSeries - System p 0 March 14th, 2007 12:56
Help with AIX 5 setup for remote backup Jasonemmg AIX for POWER Systems 1 January 4th, 2007 08:49
Printer setup problem dwagg pSeries - System p 2 November 22nd, 2006 08:32
GPGS /HACMP setup sdhotre AIX for POWER Systems 0 October 16th, 2006 14:40
How to configure alternate link of a LUN in AIX LVM amitava AIX for POWER Systems 0 September 6th, 2006 09:25



Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Powered by vbWiki Pro 1.3 RC5. Copyright ©2006-2007, NuHit, LLC

vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50