DevOps · K8s · Volleyball · Travel  •  DevOps · K8s · Volleyball · Travel  •  DevOps · K8s · Volleyball · Travel
Explore NY Stream

— LiveStream

Creating a UNIX FileSystem in AIX

Creating a filesystem in AIX from scratch means building three layers in order: a volume group (VG) on top of your physical disks, a logical volume (LV) inside that VG, and finally a JFS2 filesystem on that LV that you mount. This guide walks through the full workflow on IBM AIX using both the menu-driven smit tool and the equivalent command-line steps, so you can provision storage reliably whether you live in the SMIT screens or on the command line.

The procedure below applies to modern AIX (7.1, 7.2, and 7.3) as well as older 5.x/6.1 systems. Where the legacy SAN tooling has changed, the modern equivalent is called out so the guide stays useful on current hardware.

The AIX storage stack: why you build a filesystem in layers

AIX uses the Logical Volume Manager (LVM), so you never put a filesystem directly on a raw disk the way you might mentally picture on a simple system. Instead, storage is abstracted in tiers, and understanding them is the key to creating an AIX filesystem correctly.

  • Physical Volume (PV) — an actual disk presented to the OS as an hdisk device (for example hdisk3), whether it is a local disk, a SAN LUN, or a multipath device.
  • Volume Group (VG) — one or more PVs pooled together. Space is carved into fixed-size chunks called physical partitions (PP).
  • Logical Volume (LV) — a virtual "partition" allocated from the VG's free PPs. The LV is what actually holds a filesystem, paging space, or raw data.
  • Filesystem — the JFS2 (Enhanced Journaled File System) layer placed on top of an LV, giving you a directory tree you can mount and use.

This layering is what makes AIX storage flexible: you can grow a filesystem online, mirror an LV across disks, or spread one LV across several PVs for performance, all without destroying data. The trade-off is that creating a filesystem in AIX is a multi-step task rather than a single command.

Before you start: confirm the disk is available and sized correctly

The single most common mistake when creating an AIX filesystem is grabbing a disk that is already in use or that belongs to another team. Verify the candidate disk first.

1. List the disks the OS can see. Run lspv. A disk that shows None in the volume-group column is free; a disk already showing a VG name is in use, so leave it alone.

  1. List all physical volumes and their VG membership: lspv
  2. Check the size of a specific disk in megabytes: getconf DISK_SIZE /dev/hdisk3 (replace hdisk3 with your disk; the value returned is in MB).
  3. Get full attributes of a disk, including the SAN serial: lscfg -vpl hdisk3

2. Confirm SAN/multipath status if the disk is a LUN. On modern AIX the default multipath driver is AIX MPIO, and you check paths with lspath -l hdisk3 and disk health with lsmpio. You want every path to read Enabled before you build anything on the disk.

Older environments used vendor multipath drivers and the vpath device naming convention. The legacy commands you may still see in old runbooks are:

  • pcmpath query essmap — listed vpaths for IBM ESS/Shark (Enterprise Storage Server) disks under the SDD driver.
  • /usr/lpp/EMC/CLARiiON/bin/inq.aix64 — EMC's INQ utility for listing CLARiiON LUNs and their serials.

Modern equivalent: SDD, SDDPCM, and most vendor-specific multipath stacks are end-of-life. On current AIX use native MPIO (lspath, lsmpio, mpio_get_config -Av for IBM storage). Only use the pcmpath/inq.aix64 commands if you are on an older system that still has those drivers installed.

Step-by-step: create the AIX filesystem with smit

The fastest reliable way to create an AIX filesystem interactively is the System Management Interface Tool (smit). Below is the full sequence. In every SMIT panel you press Enter to execute, F4 to pop up a pick-list for a field, and F10 (or Esc+0) to exit.

1. Create the volume group

Launch the VG menu with smit vg, then choose Add a Volume Group. On most installs choose the scalable type (Add a Scalable Volume Group) rather than the original or "big" type, because scalable VGs remove the old limits on the number of PVs, LVs, and partitions.

Fill in the panel:

FieldValue
VOLUME GROUP namee.g. datavg
Physical partition SIZE in megabytes128 (pick a PP size that gives a sensible partition count for the disk)
PHYSICAL VOLUME nameshdisk3 (use F4 to select)
Force the creation of a volume group?no
Activate volume group AUTOMATICALLY at system restart?yes
Volume Group MAJOR NUMBERleave blank (auto-assigned)
Create VG Concurrent Capable?no (set yes only for clustered/PowerHA shared VGs)

The command-line equivalent of this whole panel is a single mkvg call:

  1. mkvg -S -y datavg -s 128 hdisk3

Here -S requests a scalable VG, -y names it, and -s 128 sets the 128 MB physical partition size. Confirm the result with lsvg datavg and note the FREE PPs figure — that is how much space you have to allocate.

2. Create the logical volume

Open the LV menu with smit lv and select Add a Logical Volume. Pick the VG you just made, then complete the panel. The two fields that matter most are the LV name and the number of logical partitions.

  • Logical volume NAME — give it a clear, prefixed name such as lvdata01. A leading lv makes LVs easy to spot in lsvg -l output.
  • Number of LOGICAL PARTITIONS — set this to the free PPs you want to consume. If JFS2 will use an inline log (recommended, see below), you can allocate all free PPs to the data LV; you do not need to reserve a separate partition for a JFS log volume.
  • Logical volume TYPE — set to jfs2 for an Enhanced Journaled File System.

Clarifying a legacy note: older guides told you to make the LV "one less than total PPs" so a separate JFS log LV could use the remaining partition. That advice applies to classic JFS with an external JFS log. With JFS2 and an inline log the journal lives inside the data LV itself, so the "minus one PP" rule is no longer needed.

The command-line equivalent, allocating 100 logical partitions, is:

  1. mklv -t jfs2 -y lvdata01 datavg 100

3. Create the JFS2 filesystem on the logical volume

Run smit jfs2 and choose Add an Enhanced Journaled File System on a Previously Defined Logical Volume. Complete the fields:

FieldValue
LOGICAL VOLUME namelvdata01 (use F4)
MOUNT POINT/data01
Mount AUTOMATICALLY at system restart?yes
PERMISSIONSread/write
Block Size (bytes)4096
Inline Log size (MBytes)leave blank for the default, or set explicitly
Extended Attribute Formatv2 (use v2 if you need NFS4 ACLs / extended attributes)
ENABLE Quota Management?no

The command-line equivalent creates the filesystem, sets the mount point, and uses an inline log in one step:

  1. crfs -v jfs2 -d lvdata01 -m /data01 -A yes -a logname=INLINE

The -A yes flag adds the filesystem to /etc/filesystems so it mounts automatically at boot, and logname=INLINE keeps the journal inside the LV.

4. Mount the filesystem

The filesystem now exists but is empty and unmounted. Mount it:

  1. Mount the new filesystem: mount /data01
  2. Confirm it is mounted and see its size: df -g /data01

You can also run smit mount and select the filesystem from the list if you prefer the menu. That completes the full path from raw disk to a usable, mounted AIX filesystem.

The fast path: skip the layers with one command

If you do not need to micromanage the LV, AIX can create the logical volume and the JFS2 filesystem for you in a single crfs call once the VG exists. This is the quickest way to create an AIX filesystem when you just want "give me a 50 GB filesystem in this VG":

  1. Create the VG (if it does not exist): mkvg -S -y datavg -s 128 hdisk3
  2. Create a 50 GB JFS2 filesystem in it: crfs -v jfs2 -g datavg -m /data01 -A yes -a size=50G -a logname=INLINE
  3. Mount it: mount /data01

Here -g datavg tells crfs which VG to allocate from, and AIX silently creates an underlying LV with an auto-generated name. Use the layered approach from the previous section when you need a specific LV name, mirroring, or precise partition placement.

Common pitfalls when creating an AIX filesystem

These are the errors that most often bite administrators provisioning AIX storage.

  • Grabbing a disk that is already in a VG. Always run lspv first. Adding an in-use disk to a new VG with Force = yes will destroy the existing data — never force unless you are certain the disk is empty.
  • Wrong PP size for the disk. A VG has a limit on the number of partitions per disk. If your PP size is too small for a very large LUN, mkvg fails. A scalable VG (-S) plus a sensible PP size (often 128 MB or higher for multi-terabyte LUNs) avoids this.
  • Forgetting auto-mount. If you skip -A yes (or set "Mount automatically" to no), the filesystem will not come back after a reboot, which looks like data loss to users. Verify the entry exists in /etc/filesystems.
  • Confusing JFS and JFS2. JFS2 is the modern default and supports larger files and online shrink. Do not reuse a classic JFS external-log workflow on a JFS2 filesystem; use an inline log instead.
  • Multipath not fully online. Building a VG while some SAN paths are Failed can cause intermittent I/O errors later. Confirm all paths are Enabled with lspath before you start.
  • Mount point already populated. If files already exist in the directory you mount over, they become hidden (not deleted) until you unmount. Use an empty directory as the mount point.

Verification: confirm the filesystem is correct end to end

After mounting, run this short checklist to prove every layer of the AIX filesystem is healthy and persistent.

  1. Volume group is active: lsvg -o should list datavg.
  2. Logical volume exists in the VG: lsvg -l datavg shows lvdata01 with type jfs2 and an open/syncd state.
  3. Filesystem is mounted with free space: df -g /data01.
  4. Auto-mount is registered: lsfs /data01 shows the LV, mount point, type jfs2, and auto = yes.
  5. Write test: touch /data01/testfile && rm /data01/testfile to confirm read/write permissions actually work.

If all five checks pass, the filesystem will survive a reboot and is ready for production data. To grow it later you do not repeat this whole process — just run chfs -a size=+10G /data01 to extend the JFS2 filesystem online, assuming the VG has free PPs.

Key Takeaways

  • An AIX filesystem is built in three layers: physical volume → volume group → logical volume → JFS2 filesystem.
  • The SMIT path is smit vgsmit lvsmit jfs2smit mount; the CLI path is mkvgmklvcrfsmount.
  • Always verify the target disk is free with lspv and sized with getconf DISK_SIZE before building anything on it.
  • Prefer scalable VGs and a JFS2 inline log on modern AIX; the old "one less PP for the JFS log" rule applies only to classic JFS.
  • Legacy SAN tools (pcmpath query essmap, EMC inq.aix64) are mostly EOL — use native MPIO commands (lspath, lsmpio) on current systems.

Frequently Asked Questions

What is the difference between a volume group and a logical volume in AIX?

A volume group (VG) is a pool of one or more physical disks, divided into fixed-size physical partitions. A logical volume (LV) is a slice carved out of that pool. You put a filesystem on the LV, not directly on the VG or the disk, which is what lets AIX grow and mirror storage without reformatting.

How do I create a filesystem in AIX from the command line in one step?

Once the volume group exists, a single crfs command can create the logical volume and the JFS2 filesystem together: crfs -v jfs2 -g datavg -m /data01 -A yes -a size=50G -a logname=INLINE, then mount /data01. AIX auto-creates the underlying LV for you.

Should I use JFS or JFS2 on AIX?

Use JFS2 (Enhanced Journaled File System) for all new filesystems. It supports much larger files and filesystems, online expansion and shrink, an inline log, and is the default on modern AIX. Classic JFS remains only for backward compatibility on very old systems.

How do I extend an existing AIX filesystem without unmounting it?

Run chfs -a size=+10G /data01 to add 10 GB to a mounted JFS2 filesystem online, provided the volume group still has free physical partitions. If the VG is full, add a disk first with extendvg datavg hdisk4, then extend the filesystem.

If this AIX storage walkthrough helped, subscribe to @explorenystream on YouTube for more UNIX and system-administration guides.