Showing posts with label chlv. Show all posts
Showing posts with label chlv. Show all posts

Wednesday, February 8, 2017

How to increase or decrease file system size in AIX operating system.

Hello Friends,

Hope you are doing well at your end. In my previous post, I explained you step by step method of extend & reduce of file system size in HP-UX operating system. In this post, I would like to guide you , how to increase or decrease the file system size in AIX operating system.

In AIX platform, normally we are using Journaled File System (JFS) or Enhanced Journaled File system (JFS2). So before moving to main topic we need to understand, what is the advantages of JFS file system in AIX.

JFS file system has more advantages over the BSD and UFS file system which are normally used in Unix environment. The biggest disadvantages of BDS/UFS file system is "file system corruption" in case of power failure or system crash. And this corruption mostly occur during the creation or removal of files in operating system. So JFS file system is resolved such issues.

Using JFS, this problem can be reduced by use of log volume of file system. When the AIX system crash, this log file replayed and bringing back the system online. So all the data before crash written in disk.

Hope, you can understand the advantages of this file system. Now we will move main topic of this post. How we will extend and reduce the file system size. So please follow the below step by step method as describe below.

1. Before increase the size of file system , we need to check the current size of file system, for this please run the below command and check the output.
-------------------------------------------------------------------------------------------------------
aix:/> df -kP /test
Filesystem    1024-blocks      Used Available Capacity Mounted on
/dev/test   716308480 694894144  21414336      98% /test
-------------------------------------------------------------------------------------------------------
If you see the above output, the file system is almost 98% full, so we will increase the file system size to 200 GB.

2. To increase the file system size, please use the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chfs -a size=+$((200000*2048)) /test
or
aix:/>chfs -a size=+200G  /test
-------------------------------------------------------------------------------------------------------
In above command output, we will increase the size of file system /test to 200 GB, so for this we will use "chfs" command. You can use two method for increase the size of file system.

If you have an error 0516-787 extendlv: Maximum allocation for logical volume oraexp is old_limit. For resolving this issue you can run the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chlv -x new_limit lv_name
eg. chlv -x 4000 test
-------------------------------------------------------------------------------------------------------
Note: In my case my file system logical volume name is "test". You can replace your LV name to your LV name.

3.  To decrease the file system size in AIX operating system, please use the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chfs -a size=-$((X*2048)) /fs
-------------------------------------------------------------------------------------------------------
You can replace the "X" size in Mo which you want to decrease it. Using above command you can reduce the size of file system in AIX.

Please post your query in comment if you are facing any issue during increase and reduce of file system in AIX operating system.