|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
|
LVM stands for Logical Volume Manager and JFS is a Journaled File System.
|
The role of LVM is to present a simple logical view of underlying physical storage space, ie. harddrive(s). LVM manages individual physical disks - or to be more precise, the individual partitions present on them (for a short glossary of terms, look at the end of the article). LVM hides the numbers, size and location of physical partitions from users. Instead it presents the concept of logical volume. A logical volume may correspond to a physical partition (but that obviously almost defeats the purpose of LVM) but it doesn't have to. One volume may be composed of several partitions located on multiple physical disks. Not only that, the volumes can even be extended (not shrunk - people usually want more space, not less). They can even be extended while the OS is running and the filesystem is being accessed! Of course, most home and SOHO users don't have the hardware required for this.
The more experienced readers are now probably wondering how 'traditional' file systems like FAT or HPFS could be extended at runtime. The answer is, they can't. To take full advantage of LVM, it is necessary to use a filesystem designed for it. JFS is not really tied to LVM, both LVM and JFS can exist separately, but only when working in concert both can reach their full potential.
The following is a list of the common features in the LVM and VxVM methods of storage management:
Both VxVM and LVM enable file systems to be expanded while the file system is mounted and in use. Both volume managers are tied closely to specific file systems. VxVM only works with the Veritas File System, and LVM only works with the JFS or JFS2 (enhanced JFS) file system found on AIX. The one difference between VxVM and LVM is the philosophy on the concept of file system shrinkage. LVM/JFS/JFS2 does not allow the user the ability to shrink the file system. The reasoning behind this is that sometimes portions of files are spread out over the file system for performance reasons. And when a file system needs to be shrunk, the file system must go out and gather up the "pieces" of a file and relocate them to a portion of the file system that will not be eliminated. This method is time-consuming and not very efficient for performance. Thus on AIX, file system reduction is not permitted on JFS and JFS2.
VxVM takes a different approach to this. It does allow the reduction of a file system size, but it is very simplistic and has drawbacks. They literally "chop" off the end of the logical volume and file system up to the point where the user wants the file system reduced. Warnings are included in the VxVM product regarding this practice; if the user has data at the end of the file system, the data may be corrupted or lost. Thus, for the purposes of this paper, the ability of VxVM to reduce file system size is considered limited.
Advantages:
Limitations:
Command | Definition |
---|---|
chfs -a size=<#512 byte blocks> <file system> |
Increases the size of a journaled file system to the total number
of 512 byte blocks specified |
chfs -a size=<+512 byte blocks> <mount point> | Increases the size of a journaled file system by the addional
number of 512 byte blocks specified. For example "chfs -a
size=+393216 /usr" |
chlv -n <newname> <oldname> | Change the name of a logical volume (it must be inactive) |
crfs -v jfs -m <mount point> -g <volume group> -a size=<# of
512 byte blocks> crfs -v jfs -m <mount point> -d <logical volume> |
This command makes a logical volume, mount point with a journaled
file system: creates a jfs file system on a logical volume |
df -k |
Shows the disk usage of logical volumes on the server. |
exportvg <volume group> |
removes a volume group from a machine |
extendvg <volume group> <physical volume> | Adds a new physical volume to an existing volume group |
importvg -y <volume group> <physical volume> |
add a volume group to another machine |
lslv <logical volume> [-l, m] |
Lists information about the logical volumes. The -l option
lists the disks in the logical volume. |
lspv <physical volume> [-l, M, p] |
Lists the disks on the server, including the physical volume
will give details about that disk. The -l option will list
the details of how the filesystems are distributed on the disk. |
lsvg <volume group> [-l] |
Lists the volume groups on the server, including the volume
group name will give details about that vg. The -l option will list
the logical volumes in the volume group. |
lsvpcfg |
Lists each vpath and the hdisks that make up the vpath |
mklv -y <new lv> <vg> | Makes a logical volume in a volume group |
mksysb -l -f <device> |
makes a bootable backup of rootvg |
mkvg -y <volume group> <physical volume> . . . <physical volume> | Makes a volume group out of one or more physical volumes |
mount <logical volume> <file system> or mount <filesystem> if it is already in /etc/filesystems |
Mounts the file system for use. |
reducevg <volume group> <physical volume> | Removes a physical volume from a volume group |
rmfs <file system> |
removes a file system and it's logical volume |
rmlv <lv> | Removes a logical volume (it must be inactive) |
savevg -l -f <device> <volume group> |
makes a backup copy of another volume group |
umount <file system> dismount the file system |
Unmounts the filesystem. |
|
Switchboard | ||||
Latest | |||||
Past week | |||||
Past month |
File system - allocate more space
- chfs -a size='+500' /usr/acct (To enlarge file system)
- Use chlv -x 256 <lv-name> if you get an errorwhen running the above command (To expand beyond maximum LV's)
Logical Volumes striping
- From AIX 4.3.3 (not backward compatible) LVM support striping
- Often called fine striping (i.e. not PP level striping)
- Recommend 32K, 64K or 128K stripe width = 4 to 16 times I/O size most databases do 4K or 8K I/O
- Excellent for balancing serial and random I/O across disks
- Excellent read ahead serial I/O boost
Using LVM commands (with smit)
- Find unused disks: lspv
- Add them to a VG or create a VG: smitty lvm + VG + Add VG
- Check unused space in VG: lsvg <vgname>
- Create a LV: smitty lvm + LV + Add LV
- Create a Filesystem (JFS)smitty jfs + Add jfs + standard + which VG (see below)
If the command changes the VG, PV or LV then the VG is locked i.e. one command at a time.
This is needed to allow recovery of the change - if the system fails during the update.Creating Stripes Tips:
- Stripes LV must contain a whole number of items, that is the number of PPs must divide evenly into the number of disks
- Or put another way: each disk have the same number of PPs
- Hint: use multiples of No. of disks to make this easier
LVM Create Mirrors
There are three ways to create a mirror:
- One Step = create LV with mirror
- These can be slow as you can have to wait until mirror complete before creating next lv
- Create LV and later add mirror synchronise=yes
- again slow as you can have to wait for silvering
#Create LV and later add mirror synchronise=no and then sychronise all mirrors together- Use this when creating lots of lv because all mirrors can be created at the same time
So (with smit)
- create lv's
- add mirrors sync=no
- syncvg -l <lvname>
to remove "stale" partitions = resilver
Warning:
- resilvering hurts performance
- often forgotten when recommending mirror breaking for backup purposes
LVM Higher Level Management Commands
Disown disks ready to connect them to another system
- varyoffvg <vgname>
- exportvg <vgname>
or smitty lvmActivate newly attached disks
- cfgmgr – finds disks
- importvg hdiskN – any one of the disks
- varyonvg <vgname> – mounts file systems
Moving LVs
migratelv (not striped)
- Use smit lvm
- Can migrate LV on a disk to another disk
- Can empty whole disk to remove it later or replac a fault disk
Disks can be added and removed from a VG- extendvg and reducevg
- Use smit lvm recommended
LVM rootvg good practice
Small rootvg - 1 or 2 disks (for mksysb backup)
Mirror rootvg for AIX disk protection
- Add disk hdisk1
- chvg -Qn rootvg
- For hd1 to hd8 and hd9var copy the LV
- mklvcopy hd{1,2,3,4,5,6,7,8,9var} 2 hdisk1
- syncvg -v rootvg
- bosboot -a
- bootlist -m normal hdisk0 hdisk1
Or- mirrorvg -s rootvg
- this second option is recommended
TIP: This command will show you formatted list of active Volume groups
for i in $(lsvg -o);do lsvg $i;done \ | awk ' BEGIN { printf("%-10s\t%10s\t%10s\t%10s\t%10s\n","VG","Total(MB)","Free","USED","Disks") };/VOLUME GROUP:/ \ { printf("%-10s\t", $3) };/TOTAL PP/ { B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/FREE PP/ \ { B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/USED PP/ \ { B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/ACTIVE PV/ { printf("%10s\t\n", $3) } 'Put other disks into other volume groups
- use min PP size ( 8MB or 16 MB)
- use 16 to 32 disks per volume group
- use different vg for data that might be moved elsewhere
Avoid hot disks- Spread data across disk with LVs or RAID5
- Mirrors add protection and performance
- Use striping whenever possible
- Think spindles not disk size
reorgvg- this will move physical partitions (PP) around in an attempt to get PPs in the right place
migratepv- this can be used to spread PPs across move disks
- also to remove all PPs from a suspect disk before replacement (due to errors being reported)
AVOIDING Disk Crashes
- Rule One: RAID5 or mirror everything
- Rule Two: monitor error logs. Make sure you know when a disk failed
- Rule Three: call hardware support. That is what they are for
- Rule Four: Don't meddle. Only try, if you know what you are doing
- Rule Five: Read and practise. Get the Redbooks and try it safely
http://www.networktechnologist.com/tips-aix-lvm.html
http://web.utanet.at/mario/exam/5129fm.htm#tocbrvH1 - old (AIX 4.3 but good
description) http://www.redbooks.ibm.com/redbooks/SG246584/
Chapter 5. Device management
5.1 Overview
5.2.2 Managing device drivers
5.2.3 Configuring a device
5.2.4 Adding a new device to a SCSI bus
5.2.5 Remove a SCSI device
5.3 Device management in AIX 5L Version 5.1
5.3.1 Listing devices
5.3.3 Removing a device
5.3.4 Changing a device
5.4 Quick reference
Chapter 6. Logical Volume Manager and disk management
6.1 Logical volume management overview
6.2 Introducing the logical volume solutions
6.2.1 Solaris Solstice DiskSuite: Introduction
6.2.2 VERITAS Volume Manager: Introduction
6.2.3 AIX 5L Version 5.1 LVM: Introduction
6.3 Working with logical volume manager
6.3.1 Volume groups
6.3.2 Working with logical volumes
6.3.3 Working with physical disks
6.3.4 Additional features: Hotspare disks
Chapter 7. File system management
7.1.1 Solaris file systems types and commands
7.1.2 AIX file systems types and commands
7.2 Formatting and partitioning a disk (Solaris only)
Chapter 6. Logical Volume Manager and disk management 129 Naming conventions for LVM Use Table 6-5 to find out the names that LVM uses for each of its components. Table 6-5 Naming conventions for LVM 6.3 Working with logical volume manager In this section, we will describe the way to list, create, remove, and change characteristics for volume groups, logical volumes, and physical disks. We mainly use VxVM and LVM, because not all the features in these two products are available in Solaris DiskSuite. 6.3.1 Volume groups As defined earlier, a volume group is a collection of physical disks that are related. Let us review the main and most important ways to work with them. Listing a volume group: LVM In AIX 5L Version 5.1, we use lsvg to list a volume group. If you do not specify an option, it will show you all the volume groups defined in the system. Some of its useful flags are: -o Shows only the active volume groups. -p <vg_name> Shows all the physical volumes that belong to the requested volume group (vg_name).
157 r Removes all disks from the pool of hotspare disks for the volume group specified. Synchronization policy Since AIX 5L Version 5.1, there is another option (-s) for the chvg command. It is used to specify the synchronization characteristics. The supported values for this option are: y Automatically attempts to synchronize stale partitions. n Will not attempt to synchronize stale partitions. This is the default value. Here we have some examples for hot spares: # chpv -hy hdisk2 This command marks hdisk2 as a hotspare disk for the volume group to which it belongs. To change the synchronization policy, we use chvg, as shown in the following example. It is highly recommended that you change the synchronization policy to automatic. # chvg -hy -sy apachevg 6.4 Quick reference In both LVM and VxVM, the same task can be done in different ways: AIX LVM tools smitty, Web-based System Manager (GUI), or the command line VxVM 3.2 Tools /opt/VRTSvmsa/bin/vmsa (GUI), vxdiskadm (text based interactive tool), or the command line Table 6-6 on page 158 contains a quick reference for the most used tasks, using command line tools.
Term | Definition |
---|---|
Journaled File System (JFS) |
File system that uses a journaled
log for faster, more reliable data recovery |
Logical Partition (LP) |
The LV is made up of LPs.
The LP corresponds to 1 or more (in the case of mirroring) PPs. |
Logical Volume (LV) |
The VG is subdivided into logical
volumes and each LV can have a file system on it. |
Physical Partition (PP) | All physical volumes are subdivided into pps. PPs are all the same size. |
Physical Volume (PV) |
Disk that is being managed by LVM. |
Rootvg |
Default volume group created during
installation. The vg holds the OS filesystems ( /,/usr, /home,
/proc /opt, /tmp, /var and swap space ) |
Volume Group (VG) |
Area of storage that consists of
one or more PVs |
Command |
Definition |
---|---|
chfs -a size=<#512
byte blocks> <file system> |
Increases the size of a journaled
file system to the total number of 512 byte blocks specified |
chfs -a size=<+512 byte blocks> <mount point> | Increases the size of a journaled
file system by the addional number of 512 byte blocks specified.
For example "chfs -a size=+393216 /usr" |
chlv -n <newname> <oldname> | Change the name of a logical volume (it must be inactive) |
crfs -v jfs -m <mount point> -g
<volume group> -a size=<# of 512 byte blocks>
crfs -v jfs -m <mount point> -d <logical volume> |
This command makes a logical volume,
mount point with a journaled file system:
|
df -k |
Shows the disk usage of logical
volumes on the server. |
exportvg <volume group>
|
removes a volume group from a machine |
extendvg <volume group> <physical volume> | Adds a new physical volume to an existing volume group |
importvg -y <volume group> <physical
volume> |
add a volume group to another machine |
lslv <logical volume> [-l, m] |
Lists information about the logical
volumes. The -l option lists the disks in the logical volume. |
lspv <physical volume> [-l, M,
p] |
Lists the disks on the server,
including the physical volume will give details about that disk.
The -l option will list the details of how the filesystems are distributed
on the disk. |
lsvg <volume group> [-l] |
Lists the volume groups on the
server, including the volume group name will give details about
that vg. The -l option will list the logical volumes in the volume
group. |
lsvpcfg |
Lists each vpath and the hdisks
that make up the vpath |
mklv -y <new lv> <vg> | Makes a logical volume in a volume
group |
mksysb -l -f <device>
|
makes a bootable backup of rootvg |
mkvg -y <volume group> <physical volume> . . . <physical volume> | Makes a volume group out of one or more physical volumes |
mount <logical volume> <file system>
or mount <filesystem> if it is already in /etc/filesystems |
Mounts the file system for use. |
reducevg <volume group> <physical volume> | Removes a physical volume from a volume group |
rmfs <file system>
|
removes a file system and it's logical volume |
rmlv <lv> | Removes a logical volume (it must be inactive) |
savevg -l -f <device> <volume group>
|
makes a backup copy of another volume group |
umount <file system> dismount
the file system |
Unmounts the filesystem. |
Procedure to list the PVs in a volume group:
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 quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard 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 DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting 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-Month : How 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-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) 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 to buy a cup of coffee for authors of this site |
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 Softpanorama society. 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: July 28, 2019