| 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? | |
![]() |
| | LinkBack | Thread Tools |
|
#1
| ||||
| ||||
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 |
|
#2
| ||||
| ||||
| 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: |
|
#3
| ||||
| ||||
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. |
|
#4
| ||||
| ||||
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 |
|
#5
| ||||
| ||||
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. |
|
#6
| ||||
| ||||
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! |
|
#7
| ||||
| ||||
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 |
|
#8
| ||||
| ||||
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 ? |
|
#9
| ||||
| ||||
| 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. |
|
#10
| ||||
| ||||
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. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
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 |