If you need to move the entire contents of a file system, and the underlying storage doesn't need to change, you might as well just change the mount point. When you change the mount point of a file system, you effectively move all the files and directories that sail in it. Wouldn't it be wonderful if you could relocate your house and family just by slapping on a new sign on the gates of your city. In effect, that's what happens when you change the mount point.
When you want to use a new mount point - effectively rename a file system's - it doesn't take effect until you unmount the old one. And you can't do that if the file system is in use. And if a file system has nested file systems within it, then they have to come down first.
So here's the procedure. This is taken from my article Moving Mounts
in the IBM Systems Magazine, Power Systems edition (AIX and IBM i)
Nested File Systems
If a file system itself contains mount points for other file systems, those nested file systems need a valid mount-point directory before they can be mounted. Here is an example:/orig
Here, /orig/reports is a nested file system, and /orig is the parent. If you want to change the parent mount point, you’ll need to change the nested file system mount point as well, but it has to be done in the correct order. First you, have to unmount the nested file system, because while it’s mounted, you won't be able to unmount the parent. Free up any processes holding the nested file system, open and then unmount it:unmount /orig/reports
If that succeeds, unmount the parent file system:unmount /orig
Change the parent mount point:chfs -m /new /orig
And then mount the parent file system, using its new mount point:mount /new
After mounting the parent file system on its new mount point (/new), the reports directory should be available so it can be used as a mount point for the nested file system. You can now change the nested file system mount point:chfs -m /new/reports /orig/reports
Then mount the nested file system using its new mount point:mount /new/reports
For more information about changing file systems, see the rest of the article
I recommend subscribing to theIBM Systems Magazine, Power Systems edition (AIX and IBM i)
. It has a wealth of news and information about AIX in very accessible format. It includes a weekly blog post - AIXChange
- from the indefatigable Rob McNelly. Always a great read.