[ASK] decrease/shrink the size of filesystem


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
[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  
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:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Shrink ext4 filesystem and reduce the size of a Logical Volume in Linux
los_bandidos
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.... Red Hat
2
Red Hat
Decrease buffer size
@bhi
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...... UNIX for Dummies Questions & Answers
8
UNIX for Dummies Questions & Answers
How to increase or decrease inode number of the particular UFS filesystem
girish.batra
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... Solaris
3
Solaris
jfs2 - cannot shrink filesystem
zxmaus
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...... AIX
11
AIX
increase/decrease filesystem
itik
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.... Solaris
5
Solaris

Featured Tech Videos