- Understand the difference between physical volumes, volume groups, logical volumes and filesystems → Physical (disks), volume group (disk allocation), logical volume (how volume group is divided), filesystem(where files reside)
- Determine which file systems are currently mounted → lsvg -l rootvg, mount
- List system disks → lspv
- Determine the used and available space of filesystems (lsfs, df, etc)
- Determine the space available in a volume group → lsvg
- Determine which file systems are in a volume group → lsvg
- List available paging space → lsps -a
- Mount filesystems, CD, and tape devices → mount
Understand the difference between physical volumes, volume groups, logical volumes and filesystems
The simplest way to look at how storage in AIX works is as follows.
Physical Volumes: At the lowest level you have disks which are the physical devices where data will reside. Example hdisk0
Volume Groups: It is not uncommon for a server to have multiple disks allocated to it, however in some circumstances you want to have the server see these disks as a single storage location. A Volume Group is a grouping of one or more disks , wherein the server does not distinguish between physical boundaries.
With this, if you have 2 separate 10gb disks as one volume group, it is possible to store a single 20gb file. This would not be possible without volume groups. Example rootvg
Logical Volumes: In order to organize data on in the Volume Group, you must create a Logical Volume which can be used to split up a volume group into a more manageable and organizable unit. Example fslv00
File Systems: This is the lowest level of storage on an AIX server. The File System refers to the directory in which you will place data. All other forms of storage are unseen by the user. The File System is the only storage unit seen by a used creating, copying, moving and removing files. Example /home
Determine which file systems are currently mounted
A File System can exist without being accessible and/or functional. Before a file system can exist it must be mounted. This is an important detail and speaks volumes to the importance of a file system. File systems can be moved at will, unmounted, mounted etc. They are very flexible. In order to view mounted file systems you can issue any of the below commands:
“lsvg -l rootvg” -> This will show you all of the file systems which currently reside on your root volume group. There is a column “LV STATE” which will show “open/syncd” when mounted and “closed/syncd” when not.
“mount” -> This will show you all mounted file systems. It separates it into the logical volume, file system, file system type, date mounted and options
“cat /etc/filesystems” -> The /etc/filesystems file will show you all file systems permanently initialized on the LPAR. There is an option for each file system for mount either set to true or false. If true, this file system will mount on reboot. This file does not dynamically change, and therefore is not a reference for currently mounted file systems
List system disks
“lspv” -> This command will show you all of the disks available to the system
“lspv hdisk0″ -> Will show you the attributes of the specified disk
“lspv -l hdisk0” -> Will show you the volume groups associated with that disk
Determine the used and available space of filesystems
Each unit of storage is allocated a certain amount of space. Typically the complaint “My disk is full” doesn’t refer to the disk at all, but the file system instead. In order to better organize your storage you can increase and decrease the file system size which is important for ensuring large files are only stored in appropriate areas. For example, you don’t typically want someone’s home directory to get filled up with temporary and personal files, and therefore you typically assign the /home filesystem very little space.
The ability to dynamically change file system size has been greatly improved when they upgraded from jfs to jfs2. Under jfs, you could only increase file system size, not decrease. This meant that if you over-allocated space to a file system, you could not get that space back. This made for very stingy sys admins constantly under-allocating and demanding accurate estimations of space requirements.
To determine the space of a file system, issue the following commands:
“lsfs” -> This will show a column for the size of all file systems
“df” -> The “disk free” command outputs the usage data of all file systems. Default is 512-blocks. Use -m or -g options for megabytes and gigabytes respectively
“du” -> Not file system specific, but this command will show the disk usage for the current folder, or a specific folder if specified
Determine the space available in a volume group
“lsvg rootvg” -> This command will output detailed information on a volume group, including the size and usage. NOTE: space is typically allocated using PPs (physical partitions). The PP size can fluctuate based on lpar set up and therefore take note of the PP size when determining space availability and usage. Multiply the attribute by the PP size to get megabytes.
Determine which file systems are in a volume group
“lsvg -l rootvg” -> This will list the contents of a volume group, showing the logical volumes, file system type, usage, state (mounted) and file system name
List available paging space
“lsps -a” -> Will output the amount of paging space available. Paging space is allocated by a logical volume and can be managed as such. Increase, decrease the size or even create additional paging spaces on separate disks
Mount filesystems, CD, and tape devices
“mount” -> The mount command is all you need to mount devices. Flags and options may change per device and outcome. The mount command will produce the same results with any device, the contents will be accessible as a file system
“mount /home/user/testfs” -> mount file system
“mount -V cdrfs -o ro /dev/cd0 /cdrom” -> mount cd
“ls -l /dev/rmt” -> tape devices will be located in the rmt device list. Use “mt” or “tapeutil” to manage tape devices