LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 04-14-2004, 10:29 PM   #1
sveint
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
Disk partitioning


Coming from Solars I'm completely stumped on this one, and the documentation is rather confusing:

Fresh AIX 5.2L installation. My hard disk is auto-partitioned into VERY small partitions.

Questions:
How can I easily display the hard disk(s) and the allocated partitions?

Any easy way to reconfigure the partitions as I wish?

The installation procedure did NOT give any partitioning options, which was very disappointing.

Thanks for any help.
 
Old 04-14-2004, 11:17 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Use lspv to display the physical volumes on a machine. This will also display the volume groups that use the disks.
Code:
$ lspv
hdisk0          000373ec3605869a                    rootvg
hdisk1          000373ec370cb945                    rootvg
hdisk2          000373ec41efeeab                    servicesvg
hdisk3          none                                None
Get details of the volume group with lsvg.
Code:
$ lsvg servicesvg
VOLUME GROUP:   servicesvg               VG IDENTIFIER:  000343ec00004c00345000fbca9f5f47
VG STATE:       active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:  read/write               TOTAL PPs:      546 (139776 megabytes)
MAX LVs:        256                      FREE PPs:       386 (98816 megabytes)
LVs:            3                        USED PPs:       160 (40960 megabytes)
OPEN LVs:       3                        QUORUM:         2
TOTAL PVs:      1                        VG DESCRIPTORS: 2
STALE PVs:      0                        STALE PPs:      0
ACTIVE PVs:     1                        AUTO ON:        yes
MAX PPs per PV: 1016                     MAX PVs:        32
LTG size:       128 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:      no
$
To see what logical volumes/filesystems are in a volume group use lsvg -l.
Code:
$ lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
hd5                 boot       1     2     2    closed/syncd  N/A
hd6                 paging     8     16    2    open/syncd    N/A
hd8                 jfslog     1     2     2    open/syncd    N/A
hd4                 jfs        1     2     2    open/syncd    /
hd2                 jfs        36    72    2    open/syncd    /usr
hd9var              jfs        1     2     2    open/syncd    /var
hd3                 jfs        4     8     2    open/syncd    /tmp
hd1                 jfs        1     2     2    open/syncd    /home
hd10opt             jfs        1     2     2    open/syncd    /opt
lg_dumplv           sysdump    16    16    1    open/syncd    N/A
lg_sdumplv          sysdump    16    16    1    open/syncd    N/A
lv02                jfs        32    64    2    open/syncd    /u00
$
You can view the details of all the filesystems on a machine with lsfs

You can view all this information in smit, but I usually run these programs by hand for viewing info and I then use smit to change the properties. Smit is fairly easy to use and after a little poking around in the volume group, logical volume and file system section it become pretty easy to increase the size of filesystems (although not as easy as Veritas on Solaris). Remember space is allocated in # of PPs. The PP size is dependent on your disk size and is displayed in lsvg.

Hope this helps.
 
Old 04-15-2004, 03:30 PM   #3
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
Hi sveint,

Coming from Solaris, the AIX Logical Volume Manager can be a bit confusing at first. With AIX you get something similar to Veritas Volume Manager built into the operating system : much more powerful than disk partitions. However, it can be a bit hard to get your head round at first.

AIX assigns sensible low values to filesystems (the equivalent of partitions) during the installation. You are free to increase the size of filesystems, which you can do online dynamically : smit chfs or with the command
Code:
chfs -a size=+<size> <filesystem>
e.g chfs -a size=+200M /usr
. If you install additional software and /usr fills up, AIX will automatically increase the size of /usr during the software installation so everything fits on.

So in AIX you have :

- volume groups (often called disk groups in other OSs) : a group of physical disks, lumped together to give you a big space to spread files across. Volume groups (with the exception of rootvg) can easily be moved from one server to another and shared between multiple servers, all as part of thebasic OS functionality.

- logical volumes : containers, in which you can put filesystems, paging (swap) space, boot logical volume and dump devices. You can also define a raw logical volume for a database to access directly. These are the equivalent of disk partitions, but much better. They can increase size dynamically (paging spaces can be shrunk too); they can be spread across multiple disks, mirrored and striped very easily through smit. You can break off a copy of a logical volume (e.g. to do a backup) and then remerge it later. You can move a logical volume from one disk to another while the system is running normally.

Everything can be done through smit (type "smit lvm" for the volume group/logical volume things and "smit fs" for filesystems) or on the command line (smit saves the commands it runs to ~/smit.script).

In addition to the commands crabboy mentions, here some some others you might find useful :
lspv hdisk0 : overview of disk
lspv -l hdisk0 : list logical volumes of hdisk0
lslv -m hd5 : list the location of every partition in hd5
lsvg -p rootvg : list physical disks in rootvg
lsvg -l rootvg : list logical volumes in rootvg
lsvg rootvg : overview of rootvg

You might it useful to take a look at www.rootvg.net which has a link to a chart comparing commands from different OSs including (I think) AIX and Solaris.
 
Old 04-15-2004, 05:42 PM   #4
sveint
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Great information, thank you very much!

One last detail if I may; I'm able to increase the size of my filesystems fine, but after I do, the "df -k" doesn't show any difference?

[ edit: my error was that I used "extendlv", "chfs" works fine ]

I did order a book on AIX, should hopefully help alot. Initially I thought I could get by with my Solaris/Linux experience.

Last edited by sveint; 04-15-2004 at 05:45 PM.
 
Old 04-16-2004, 06:08 AM   #5
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
You spotted it. The reason is that increasing the size of a logical volume doesn't increase the size of the filesystem it contains; but increasing the size of the filesystem increases both. Never quite sure why this is; I can't think of any reason at all why you would want to have an lv which was only partially filled with a filesystem, but there it is.

Another slight gotcha is that if you delete a logical volume, the filesystem definitions don't get deleted; but if you delete the filesystem (rmfs) it deletes both filesystem and lv (which is normally what you want). Again, this seems very counter-intuitive to me but there may be a good reason for it somewhere.
 
Old 05-08-2004, 11:56 AM   #6
dramm
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
Not sure what command to use? Fire up SMIT, step through the menus, and find the choice that does what you want. THEN, go back to the panel where you entered options for the command you just ran (F3 from the output screen normally does this) and press F6. This wil display the command that SMIT ran for you. Occasionally, a full shell script was created and will be displayed when you do this, but most of the time a simple one-line command (such as the examples people have been giving you) will be displayed.

One detail: SMIT puts a lot of single quotation marks around options in this F6 view. I'd say 99% of the time you don't need to enter those single quotes when you run it on the command line.

One nice thing about running commands through SMIT: each command is logged in /smit.script and how you go there and the output are listed in /smit.log.

Final comments:

Unless something has changed, you cannot shrink a filesystem/logical volume easily. So take care when expanding filesystems.

Don't like the idea of a logical volume NOT being contiguous? There is an option in SMIT to re-arrange (sort of a defrag for logical volumes) available to you via SMIT. I think the command it runs is "migratepv".

The vast majority of these things (including moving logical volumes around) can be done while the system is up and running in multi-user mode.

The vast majority of these logical volume manager functions have been in AIX 3.1 days -- early 90s.

I use to work for IBM...can you tell? :-)
 
Old 05-08-2004, 05:01 PM   #7
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
Quote:
Originally posted by dramm
Unless something has changed, you cannot shrink a filesystem/logical volume easily. So take care when expanding filesystems.
You can now shrink paging space in 5L. I believe that shrinking other filesystems (presumably JFS2, don't know if JFS would be included) is planned for AIX 5.3, due out towards the end of this year. Happy days.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk partitioning in SUSE 10.0 TigerLinux SUSE / openSUSE 1 10-29-2005 12:18 PM
disk re-partitioning..... yanger Linux - General 2 08-30-2005 12:21 AM
Hard disk partitioning Michael Davont Fedora - Installation 3 01-15-2005 10:26 AM
disk partitioning gamenutt Linux - General 1 03-11-2002 05:28 AM
Disk Partitioning hank@$3800 Linux - General 2 12-31-2001 09:54 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration