Softpanorama

Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
May the source be with you, but remember the KISS principle ;-)
Bigger doesn't imply better. Bigger often is a sign of obesity, of lost control, of overcomplexity, of cancerous cells

AIX LVM Tasks

News

AIX Logical Volume Manager

Redbooks IBM Links Recommended Links   quick_reference.l
what disks are in the root volume group How many disks are on the system Create a volume group Add a disk to the root volume group Make sure the disks are in an active state Mirror the logical volumes Create the boot image on the new disk
Extend the size of filesystem Remove a file system JFS mksysb Command Aix JFS2 snapshots Humor Etc

what disks are in the root volume group
 

# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            546         186         00..00..00..77..109

Now let's see how many disks are on the system
 

# lspv
hdisk0          00cf4f5d02a3c139                    rootvg          active
hdisk1          00cf4f5da1ca9590                    none 
#
Create a volume group:
 
  1. lsdev -C -c disk  -> lists available disks (and the hdisk#) on the server
  2. mkvg -y "<VG_NAME>" hdisk#  --> creates the volume group on the named hard disk
  3. varyonvg <VG_NAME>  --> activates the volume group

Add a disk to the root volume group (extend the volume group) extendvg <vg> <disk#>

# extendvg -f rootvg hdisk1

Make sure the disks are in an active state
 

# lspv
hdisk0          00cf4f5d02a3c139                    rootvg          active
hdisk1          00cf4f5da1ca9590                    rootvg          active
 

 Mirror athe logical volumes that exist on a given volume group

# /usr/sbin/mirrorvg rootvg hdisk0 hdisk1

0516-1124 mirrorvg: Quorum requirement turned off, reboot system for this
to take effect for rootvg.
0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
bosboot of system to initialize boot records. Then, user must modify
bootlist to include: hdisk0 hdisk1.
Check to see if  all of the logical volumes in a volume group are mirrored Mirror a logical volume after the fact

Create the boot image on the new disk and put it on the bootlist
 

# bosboot -ad /dev/hdisk1

bosboot: Boot image is 25166 512 byte blocks.
bootlist -m normal hdisk0 hdisk1

Confirming that all of the volumes are on the boot image
 
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk1            active            546         186         00..00..00..77..109
hdisk0            active            546        186         00..00..00..77..109

Logical Volume Manager (LVM) Commands for AIX

Filesystem Procedures

Procedure to create a filesystem using JFS:
 
Extend the size of filesystem :
 
  1. "df" to see the filesystem, it's current size, % utilization and the name of it's logical volume
  2. "lslv <logical_volume>" to show information about the logical volume including it's volume group name.
  3. "lsvg <volume_group>" to show information about the volume group, including number of free pp's and the pp size
  4. If there are not enough free pp's then see below for procedure to add a disk to a volume group.
     
  5. "chfs -a size= +4194304 <MOUNT_POINT>" to grow the filesystem by 2 GB (4194304=2*1024*1024*1024/512)
  6. df" shows the file system's current size is 2 GB more than before.
Troubleshooting extending the size of a filesystem using JFS: Remove a file system
  1. Unmount the filesystem
  2. Remove the logical volume "rmlv <lv_name>"
  3. Remove the filesystem information from /etc/filesystems
Procedure to reduce the size of a file system - shareold is 8mb and needs to be reduced to 4mb
  1. Create the file system
    1. crfs -v jfs -m /usr/sharenew -g rootvg -a size=8192
    2. this makes a logical volume in the root volume group of 4MB that uses jfs
  2. Mount the volume
    1. mount /usr/sharenew
  3. Move the files from the old file system (/usr/shareold)
    1. cd /usr/shareold
    2. tar cf - | (cd /usr/sharenew; tar xvf -)
    3. cd
  4. Unmount the file systems
    1. umount /usr/sharenew
    2. umount /usr/shareold
  5. Remove the old file system and it's logical volume
    1. rmfs /usr/shareold
  6.   
    1. chfs -m /usr/shareold /usr/sharenew
  7. Mount the new filesystem
    1. mount /usr/shareold
  8. Delete the temporary mount point
    1. rmdir /usr/share

Logical Volume Procedures
 

Create a logical volume and filesystem in a volume group:
 
  1. lsvg to determine the size of the PP
  2. lslv in similar logical volumes to determine if mirroring is in effect
     
  3. Calculate the number of PPs needed for the logical volume
     
    1. bc
    2. scale=2
    3. <size of lv in MB>/<size of PP in MB>
    4. quit
       
  4. mklv -y  "<LV_NAME>" <VG_NAME> <# of LPS>  --> creates the logical volume
  5. crfs -v jfs -d <LV_NAME> -m /<MOUNTPOINT> -A yes   --> makes the filesystem, creates the mountpoint and puts it in /etc/filesystems
  6. mount /<MOUNTPOINT>  --> mounts the new fileystem
  7. df /<MOUNTPOINT>  --> verifies the mount and the size of the new filesystem
  8. Check the ownership and permissions of the new mount point
  9. If mirroring is in effect, then mirror this logical volume to another disk (original and 1 mirror):

 

Volume Group Procedures


Procedure to mirror the rootvg:
 
  1. lspv  --> determine the hdisk#
     
  2. extendvg rootvg hdisk<number>  --> add the hdisk to the volume group
     
  3. lspv  -->  verify that the hdisk has been successfully added to the volume group
     
  4. chvg -Q 'n' rootvg  -->  change the quorum so that the vg will stay active if one of the mirrors fail
     
  5. mirrorvg -S -c 2 rootvg  --> mirror all of the logical volumes in the volume group
     
  6. lsvg -l rootvg  --> verify successful mirroring (pps will appear "stale" until synchronization is complete).
     
  7. bosboot -a  -->  update the boot image information
     
  8. bootlist -m normal -o hdisk0 hdisk1  --> create a new bootlist
     
  9. bootlist -m normal -o  --> verify the bootlist is correct
     
Procedure to increase the number of LP's available
Assume we receive an error that the maximum number of LP's had been exceeded, and the maximum number of LP's defined was 1100:
 
  1. "lsvg <volume_group>" to show the total PP's available in the volume group =1250
  2. "lsvg -l <volume_group>" to show the total PP's used in all logical volumes in that volume group (showed sys1log, the jfs log was using 2 PP's)
  3. "chlv -x 1248 <logical_volume>" to change the maximum number of LP's from 1100 to 1248 (1250 PP's in the volume group - 2 PP's used by the jfs log  = 1248 available)
 

Physical Disk Procedures
 

Procedure to find disks/vpaths that are unallocated Procedure to make a new lun available to AIX
Procedure to list the PVs in a volume group:
 

 

Logical Volume Manager

During the early stages of UNIX®, the management of physical disks was always a daunting task because of the restrictions on allocating the actual physical space. You'd have to define physical partitions, and each physical partition would actually be of a fixed size. Additionally, a physical disk could only have eight physical partitions, so the customer had to select the correct size of each partition before installing the system.

A major restriction of the physical partition was that each partition had to be contiguous; meaning you could not span multiple drives. What evolved from this messy picture was a new, flexible technique to manage the allocation, known as logical volumes. Here are some of the benefits:

AIX and Solaris offer different methods for using logical volumes. With Solaris, it does not come ready out of the box. You need to determine which LVM to use, and decide whether or not to use SVM or VERITAS. While VERITAS offers the VERITAS Foundation suite for AIX 5L™, it is typically not used in AIX environments, as it is not necessary. VERITAS Volume Manager (VxVM) is a storage management subsystem that enables you to manage physical disks as logical devices called volumes. It is important to reiterate that this product is third-party software, and you will pay handsomely for it.

The LVM has been a feature of the AIX operating system since Version 3, and it is installed automatically with the operating system. Table 1 helps lay out some of the differences between AIX and VERITAS, and it also compares the commands (for the complete table, see Resources). While the version numbers might be different, the concepts and commands remain the same.


 

Figure 1 illustrates how the physical disk relates to the actual logical partitions.


 

Recommended Links

Transition from Solaris to AIX

AIX File Structure Volume Logical Tips




Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: September 12, 2017