Logical Volume Manager (LVM) Commands For AIX Glossary Term
Logical Volume Manager (LVM) Commands For AIX Glossary Term
Glossary
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 Summary
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 This command makes a logical volume, mount point with a journaled file system:
size=<# of 512 byte blocks>
crfs -v jfs -m <mount point> -d <logical volume> 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> . . . Makes a volume group out of one or more physical volumes
<physical volume>
mount <logical volume> <file system> or Mounts the file system for use.
mount <filesystem> if it is already in /etc/filesystems
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.
Filesystem Procedures
• See below the procedure for creating a logical volume and a filesystem using JFS:
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)
o NOTE: Growing the file system will automatically grow the logical volume
6. df" shows the file system's current size is 2 GB more than before.
• Error Message: 0516-787 extendlv: Maximum allocation for logical volume <LV_Name> is 512.
o Maximum number of LPs for the logical volume has been exceeded - must increase the allocation
o Calculate the number of LPs needed = LV Size in MB / LP size in MB
o chlv -x <new_max_lps> <logical_volume>
Procedure to reduce the size of a file system - shareold is 8mb and needs to be reduced to 4mb
Procedure to create a logical volume and filesystem in a volume group using JFS:
o ls -ld <mountpoint>
o chown owner:group <mountpoint>
o chmod XXX <mountpoint>
2. If mirroring is in effect, then mirror this logical volume to another disk (original and 1 mirror):
o mklvcopy -s y <LV_NAME> 2
Check to see if all of the logical volumes in a volume group are mirrored
• lsvg -l
• mklvcopy -s y <LV_NAME> 2
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
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)
• lsvpcfg
o This will show disks/vpaths and the volume group they are allocated to
• lspv|grep None
o This will show pvs and whether they are asssociated with a volume group
o Note: For vpaths, the hdisks will show as none, but they may be allocated to a vpath - you must grep each hdisk with the lsvpcfg
Terminology: