This begins what will be an ongoing series of posts relating to basic AIX tasks. The first is a quick explanation of how to add and takeaway space from a filesystem:
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 3.00 2.73 10% 11642 2% /
/dev/hd2 4.00 1.90 53% 50028 10% /usr
/dev/hd9var 3.00 1.14 62% 7020 3% /var
/dev/hd3 3.00 1.76 42% 964 1% /tmp
/dev/fwdump 1.00 1.00 1% 4 1% /var/adm/ras/platform
/dev/hd1 3.00 3.00 1% 14 1% /home
Check the VG for available space.
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER:
VG STATE: active PP SIZE: 512 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 558 (285696 megabytes)
MAX LVs: 256 FREE PPs: 454 (232448 megabytes)
LVs: 14 USED PPs: 104 (53248 megabytes)
…
Now, we add space to our filesystem.
# chfs -a size=+5G /home
Filesystem size changed to 16777216
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 3.00 2.73 10% 11642 2% /
/dev/hd2 4.00 1.90 53% 50028 10% /usr
/dev/hd9var 3.00 1.14 62% 7020 3% /var
/dev/hd3 3.00 1.76 42% 963 1% /tmp
/dev/fwdump 1.00 1.00 1% 4 1% /var/adm/ras/platform
/dev/hd1 8.00 7.99 1% 14 1% /home
Alternatively, we could specify the total size of our filesystem.
# chfs -a size=10G /home
Filesystem size changed to 20971520
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 3.00 2.73 10% 11642 2% /
/dev/hd2 4.00 1.90 53% 50028 10% /usr
/dev/hd9var 3.00 1.14 62% 7020 3% /var
/dev/hd3 3.00 1.76 42% 963 1% /tmp
/dev/fwdump 1.00 1.00 1% 4 1% /var/adm/ras/platform
/dev/hd1 10.00 9.99 1% 14 1% /home
Be careful when removing space from a filesystem. It is possible to lose data if the filesystem is close to full, depending on how much you want to decrease by. This can only be done with JFS2 filesystems.
# chfs -a size=8G /home
or
# chfs -a size=-2G /home
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 3.00 2.73 10% 11642 2% /
/dev/hd2 4.00 1.90 53% 50028 10% /usr
/dev/hd9var 3.00 1.14 62% 7020 3% /var
/dev/hd3 3.00 1.76 42% 963 1% /tmp
/dev/fwdump 1.00 1.00 1% 4 1% /var/adm/ras/platform
/dev/hd1 8.00 7.99 1% 14 1% /home
No comments:
Post a Comment