Use chfs to AIX Modify File System!
AdrianMahendrata 2700008J7X Visits (21311)
I was asked to move data on SAN LUNs from one LPAR (source LPAR) to another (destination LPAR). I encountered an issue during the import of the volume group and you can read about it on my previous blog, Missing Logical Volume! Doco Saved the Day!
After successfully creating the logical volume labels, another issue uncovered.
The file systems were mounted with the Concurrent I/O (CIO) option when they were not supposed to. I confirmed this by checking the system configuration documentation gathered. Where did that CIO mount option come from?
After a bit of investigation, it appears that CIO mount option were removed from the file systems in the past. I suspect that the file system changes were done by simply editing the /etc/filesystem file instead of using the chfs command as the logical volume control block are still showing that the file system mount option are cio,rw.
In this article, I will walk you through reproducing, identifying and rectifying the issue.
Reproducing the Issue
First, let’s reproduce the issue!
I have a file system called /testfs3 that are mounted with CIO on volume group vg01.
I will now then edit the /etc/filesystem file (Big no! no!), remove the cio mount options, unmount and re-mount the file system.
As you can see above, the file system is mounted without the CIO option after manually editing the /etc/filesystem configuration file. At this point in time, the issue is introduced but highly likely it is unnoticed!
Running into the Issue
The issue will appear on a volume group export and import operation. I will now perform an export and import of the volume group vg01.
After an importvg operation, the /testfs3 CIO file system option are back!
Where did that come from?
Well, when the /etc/filesystems file was edited manually, the logical volume configuration on the logical volume control block weren’t updated.
Below is the logical volume – lv01 – mount option configuration that was obtained using the getlvcb command.
Notice from the command output above that the file system attributes are still configured to mount with the CIO option. Therefore, when the volume group is imported, it uses the configuration stored at the logical volume control block.
To fix this, simply run the chfs command as shown below. This will then update the logical volume control block with the right configuration.
The take-away from this is to always use the chfs command to change any file system configuration options on AIX operating system. Unless you utilises disk replication technology, the import/export of volume group may be a rare operation. However, you may have to do it during platform migration or in a disaster recovery.
So do the right thing and save yourself (or someone else) the confusion when they have the need to do it in the future. Remember, there is always the “smitty chfs” interface when you don’t remember the chfs command syntax.
“Adrian Mahendrata is an AIX, PowerVM, and PowerHA specialist in Melbourne, Australia. He has many years of experience in the design and implementation of AIX, PowerVM, and PowerHA across large enterprise environments. He has worked on various migration projects and disaster recovery implementations throughout his career. He enjoys photography and motorbike riding during his free time. You can connect with him on LinkedIn and follow him on Twitter @amahendrata.”