[ASK] decrease/shrink the size of filesystem


 
Thread Tools Search this Thread
Operating Systems AIX [ASK] decrease/shrink the size of filesystem
# 1  
Old 03-27-2019
[ASK] decrease/shrink the size of filesystem

Hello,

I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command.

My AIX system is version 6.1 and the filesystem type is JFS2.
# 2  
Old 03-27-2019
Quote:
Originally Posted by Phat
I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease?<...>
My AIX system is version 6.1 and the filesystem type is JFS2.
You can do that without risk online. I suggest you do it when the load is light (because for the time it takes performance is decreased) but in principle you can do it at any time without interrupting the service.

Notice that a "filesystem" (FS) resides on a "logical volume" (LV) and the LV is decreased in size as well as the FS is decreased. Because LVs are built from "logical partitions" (LPs) and these in turn are built from allocated "physical partitions" you can only decrease (as well as increase) a filesystem in units of the PP size. You also need to have at least one LP free (after shrinking the FS). i.e if you have a PP size of 1024MB and you have 2GB free in the FS you can shrink it by 1GB but not by 2GB.

You should run a defragfs before so you do not have to worry about moving data. , This is (or, maybe, was - but i still do it that way) not done by the chfs command automatically. You just need to make sure you can afford (see above) to release the space. You do not have to worry about (LVM-level) striping, mirroring, etc.. If you have i.e. a mirror set up the LVM will release the two corresponding PPs for the LP to be freed automatically.

Finally, here is how you do it:

Code:
chfs -a size=-1 /path/to/fs

will reduce the FS by 1 byte but because (see above) it can only shrink in units it will be shrunk by the size of 1 PP. You can also set a certain target amount:

Code:
chfs -a size=100G /path/to/fs

will - depending on the current size - shrink or expand the FS to a final 100GB.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 3  
Old 03-28-2019
Hi Bakunin,

it really helps me Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Shrink ext4 filesystem and reduce the size of a Logical Volume in Linux

Hello guys, I would like to ask you kindly if you don't know some quick and safe method how to shrink ext4 filesystem and reduce the size of a Logical Volume in Linux, please? Thank you very much. (2 Replies)
Discussion started by: los_bandidos
2 Replies

2. Programming

How to decrease virtual size of a process after cleaning all containers and using malloc_trim (0)?

Hello all i have simple server running on linux redhat 6.1 it is build with c++ in the server i have huge std vector that holds pointers to cache objects those cache objects holds allot of data from the DB any way ... in some point in time there is simple API that suppose to clean the... (2 Replies)
Discussion started by: umen
2 Replies

3. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

4. UNIX for Dummies Questions & Answers

Decrease buffer size

Hi, I am using the below command to get the output in a file called "Logs.txt" tail -f filename | egrep -i "cpu | hung " >> Logs.txt The problem is the Logs.txt file gets updated only after the buffer is 8Kb, but i want to update the file immediately and not wait for the buffer to get 8kb. Is... (8 Replies)
Discussion started by: @bhi
8 Replies

5. AIX

Why using "%" of Paging size increases & how to decrease this percentage?

Hi I have found a problem on my AIX 5.1 server. day by day the paging size is increasing,what is the reason behind it and if percentage is at 100 what will happen. Oracle 9i is running on my server. PAGING SPACE size,mb 5632 % used 14.6 % free 85.3 How can i decrease the using... (6 Replies)
Discussion started by: dearsumon
6 Replies

6. Solaris

How to increase or decrease inode number of the particular UFS filesystem

Hi Gurus I want to know the command & tips regarding, how to increase or decrease inode number of the particular ufs filesystem. Is it possible to do it in a live/production environment. Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

7. AIX

jfs2 - cannot shrink filesystem

Hi, is anyone aware about filesystem size restrictions on AIX? And does anyone know a solution for below problem? I have 2 boxes attached to EMC Raid5 storage, both have huge /optware/oracle/oradata filesystems - 4.5 and 2.5 TB in size, nothing is striped or in any other way restricted. Due to... (11 Replies)
Discussion started by: zxmaus
11 Replies

8. Shell Programming and Scripting

How to decrease the font size in Mailx

Hi all, I am using echo "$EMAILMESSAGE" | mailx -s "$SUBJECT" -b $CC "$TO" I am receiving the mail but seems to big in font size. Is there any option mailx to decrease the size of the mail generated. Thanks, (1 Reply)
Discussion started by: shellscripter
1 Replies

9. Solaris

increase/decrease filesystem

Hi All, I need to increase the filesystem of / and /var (two different slices)? Space will be coming from /home slice so I need to decrease it. Is that possible without reinstallation or in a single-user-mode? Any idea or link please. Thanks in advance. (5 Replies)
Discussion started by: itik
5 Replies

10. Programming

Will exe file size decrease while using inline function

using namespace std; void g(); class A { public : A() { g();g();g(); cout << "Constructor of A"<< endl ;} }; inline void g(){ cout << "vijay" <<endl; } int main() { A a; } when i use inline i get size 303488 Aug 31 12:05 a.out* when not using inline i get size 303572 Aug 31... (1 Reply)
Discussion started by: vijaysabari
1 Replies
Login or Register to Ask a Question