Tuesday, July 25, 2017

# add disk aix # add new disks aix

UNIX: Extend File systems on AIX

I have used an older version of AIX for this request, it was a 5.7

The current version is 7.2

The request I had was of course a short and curt give-it-to-me email

Please add 30GB to existing file system, /oracle/SOL/sapdata5 on server server1.
The exiting size is 24GB which will become 54GB.

Of course the very first thing you do after being assigned disks by the SAN team is to make sure you scan for the unallocated/free disks. I have had cases where some engineers forgot to scan all disks and just add 2 out of 3 disks allocated and for a long long time there was one unused disk just sitting there waiting to be taken up by a VG. Yes, it happens. Humans always err

1. Run a lspv command to check for new unassigned disks

root@server1 / : lspv
hdisk0          00c49eaa11348c3f                    rootvg          active
hdisk1          00c49eaa11348c76                    rootvg          active
hdisk2          00c49eaacde6c88a                    vgarch          active
hdisk3          00c49eaacde6c9b7                    vgdata          active
hdisk4          00c49eaacde6c764                    vgapp           active
hdisk5          00c49eaacde6ca4a                    vgdata          active
hdisk6          00c49eaacde6c7f7                    vgapp           active
hdisk7          00c49eaacde6c922                    vgarch          active
hdisk8          00c49eaa1e216ad0                    vgapp           active
hdisk9          00c49eaa1e21a105                    vgapp           active
hdisk10         00c49eaad7434b3c                    vgdata          active
hdisk11         00c49eaad7423f03                    vgarch          active
hdisk12         00c49eaad74349ec                    vgarch          active
hdisk13         00c49eaad7434cfb                    vgdata          active
hdisk14         00c49eaa4c7a179a                    vgdata          active
hdisk15         00c49eaa4c7a96a1                    vgdata          active
hdisk16         00c49eaab37c9028                    None            
hdisk17         00c49eaab37c6be4                    None   

2. Take the current file systems size, its LV and its VG size and parameters. Just save it in a notepad so you can compare later.

lvdata5 is the LV of the file system  /oracle/SOL/sapdata5 

vgdata is the VG of the file system /oracle/SOL/sapdata5 

Make note of the FREE PP size in vgdata, there's only about 1800 MB left which isn't sufficient for us to extend the file system

3. Then you add the disks to the VG of that file system

root@server1 / : chdev -l hdisk16 -a pv='yes' 
hdisk16 changed

root@server1 / : chdev -l hdisk17 -a pv='yes'
hdisk17 changed

root@server1 / : extendvg vgdata hdisk16

root@server1 / : extendvg vgdata hdisk17

4.  You can check the new disks' space and its parameters details with the lspv command

5. When you run the lsvg command again, look at the FREE PP, the size has increased significantly

6. What's left to do is just to extend the file system. I encountered this error when I tried to extend the file system

root@server1 / : chfs -a size=+30G /oracle/SOL/sapdata5
0516-1034 lquerypv: Not enough physical partitions in physical volume hdisk3.
0516-788 extendlv: Unable to extend logical volume.

It appears that there is an upperbound restriction on the LV, which I changed with the smitty command line tool

I like to extend filesystem in batches, because I like to have a look at the FREE PP while I am doing it, and in my case, I extended the file system in batches

7. First, I added 15G to the FS

root@server1 / : chfs -a size=+15G /oracle/SOL/sapdata5
Filesystem size changed to 80740352

root@aserver1 / : df -g /oracle/SOL/sapdata5
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/lvdata5      38.50     15.01   62%     2504     1% /oracle/SOL/sapdata5

8. Then I added a further 14G to it

root@server1 / :  chfs -a size=+14 /oracle/SOL/sapdata5
Filesystem size changed to 80756736

root@server1 / : df -g /oracle/SOL/sapdata5
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/lvdata5      38.51     15.02   61%     2504     1% /oracle/SOL/sapdata5

9. Another 14G...

root@server1 / : chfs -a size=+14G /oracle/SOL/sapdata5
Filesystem size changed to 110116864

root@server1 / : df -g /oracle/SOL/sapdata5
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/lvdata5      52.51     29.02   45%     2504     1% /oracle/SOL/sapdata5

10. And a remaining 500MB that I could still squeeze from the LV

root@server1 / : chfs -a size=+500M /oracle/SOL/sapdata5
Filesystem size changed to 111149056

root@server1 / : df -g /oracle/SOL/sapdata5
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/lvdata5      53.00     29.51   45%     2504     1% /oracle/SOL/sapdata5

11. And the final size of the FS is now 53G. I was still short of 1G, but if you want to show client that you did your part, then do a df -m screenshot and email that to them instead

**because I had changed the actual server name for my blog, it shows as aserver1 and server1. It is purely a copy-paste typo error

No comments:

Post a Comment