cancel
Showing results for 
Search instead for 
Did you mean: 

resize a volume or file system partition?

headbig
Level 4
Partner Accredited Certified
I have two aix system installed, these two systems share a storage which capacity is 1T.  After installed SFHA ,I created a diskgroup named sapprddbdg which include one shared disk , and created a volume sapdbvol01 with 500GB size, then created veritas file system on this volume mounted with  mountpoint  "/oracle" which size is 300GB.

The resource dependency view is like below:

Mount_SAPDBV         Vol_SAPDBV       DG_SAPDBV

Now , i can switch between these two nodes.

But I want to know how to expend  the "/oracle" mountpoint size to 400GB?

1 ACCEPTED SOLUTION

Accepted Solutions

rregunta
Level 4
Hello,

Your volume sapdbvol01 is of 800GB while your file system is of 300GB. You can resize the file system using fsadm command upto 800 GB.

There are 2 ways to do this -

# /usr/lib/fs/vxfs/fsadm -F vxfs -b <size_in_sector> -r </dev/vx/rdsk/<diskgroup_name>/<volume_name>  /<mount_point>

Eg.-
by providing sector -

# /usr/lib/fs/vxfs/fsadm -F vxfs -b +4270 -r /dev/vx/rdsk/PRODdg/db01 /db01
vxfs fsadm: /dev/vx/rdsk/PRODdg/db01 is currently 8540 sectors - size will be increased 

by providing size -
# /usr/lib/fs/vxfs/fsadm -F vxfs -b +100g -r /dev/vx/rdsk/PRODdg/db01 /db01

OR


#  /usr/lib/fs/vxfs/fsadm -b <size to match volume> /<mount point>

Eg:
by providing sectors -
#  /usr/lib/fs/vxfs/fsadm -b +4270 /db01

by providing size-
#  /usr/lib/fs/vxfs/fsadm -b +100g /db01

However it would always recommended to test the provided steps in Development setup before executing on production.

Also please make sure there are NO or absolutely minimal I/Os happening on the file system

Regards
Rajesh

Note: Please mark this note as solution if this note helps.

View solution in original post

17 REPLIES 17

Gaurav_S
Moderator
Moderator
   VIP    Certified

Can u tell how did u created the filesystem with 300GB size over a 500GB volume ? paste exact commands...

Also paste

# vxprint -qhtg sapprddbdg sapdbvol01
# df -k /oracle
# fstyp -v  /dev/vx/rdsk/sapprddbdg/sapdbvol01


Gaurav

Gaurav_S
Moderator
Moderator
   VIP    Certified
If for sure FS & Volume have different sizes, it will be treated as inconsistent by fsck ... I am wondering how you were able to mount it... I would strongly recommend NOT to unmount the FS ... since vxresize command needs FS to be mounted (just in case if resize is needed)...

Gaurav

headbig
Level 4
Partner Accredited Certified
# vxdg list
NAME         STATE           ID
sapprddbdg   enabled              1280487012.7.SAPPRDDB1

# vxprint -qhtg sapprddbdg sapdbvol01
v  sapdbvol01   -            ENABLED  ACTIVE   1677721600 SELECT  -        fsgen
pl sapdbvol01-01 sapdbvol01  ENABLED  ACTIVE   1677721600 CONCAT  -        RW
sd sapprddbhd01-01 sapdbvol01-01 sapprddbhd01 0 1677721600 0      hdisk1   ENA

# df -g /oracle
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/sapprddbdg/sapdbvol01    300.00    281.12    7%        5     1% /oracle

# ./fstyp -v /dev/vx/dsk/sapprddbdg/sapdbvol01
vxfs
magic a501fcf5  version 7  ctime Thu Aug  5 18:44:15 GMT+08:00 2010
logstart 0  logend 0
bsize  1024 size  314572800 dsize  314572800  ninode 0  nau 0
defiextsize 0  ilbsize 0  immedlen 96  ndaddr 10
aufirst 0  emap 0  imap 0  iextop 0  istart 0
bstart 0  femap 0  fimap 0  fiextop 0  fistart 0  fbstart 0
nindir 2048  aulen 32768  auimlen 0  auemlen 8
auilen 0  aupad 0  aublocks 32768  maxtier 15
inopb 4  inopau 0  ndiripau 0  iaddrlen 8   bshift 10
inoshift 2  bmask fffffc00  boffmask 3ff  checksum f16545b1
oltext1 32  oltext2 1282  oltsize 1  checksum2 0
free 314429054  ifree 0
efree  2 0 3 2 0 1 3 3 2 1 0 1 2 1 2 0 1 0 1 1 1 1 2 2 1 2 1 1 0 0 0 0


V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
v  sapdbvol01   -            ENABLED  ACTIVE   1677721600 SELECT  -        fsgen
pl sapdbvol01-01 sapdbvol01  ENABLED  ACTIVE   1677721600 CONCAT  -        RW
sd sapprddbhd01-01 sapdbvol01-01 sapprddbhd01 0 1677721600 0      hdisk1   ENA
# # vxprint -hvt
Disk group: sapprddbdg

headbig
Level 4
Partner Accredited Certified
# vxprint -hvt
Disk group: sapprddbdg
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
v  sapdbvol01   -            ENABLED  ACTIVE   1677721600 SELECT  -        fsgen
pl sapdbvol01-01 sapdbvol01  ENABLED  ACTIVE   1677721600 CONCAT  -        RW
sd sapprddbhd01-01 sapdbvol01-01 sapprddbhd01 0 1677721600 0      hdisk1   ENA

headbig
Level 4
Partner Accredited Certified


In my VOM, it looks like the following pictures


.


 

rregunta
Level 4
Hello,

Your volume sapdbvol01 is of 800GB while your file system is of 300GB. You can resize the file system using fsadm command upto 800 GB.

There are 2 ways to do this -

# /usr/lib/fs/vxfs/fsadm -F vxfs -b <size_in_sector> -r </dev/vx/rdsk/<diskgroup_name>/<volume_name>  /<mount_point>

Eg.-
by providing sector -

# /usr/lib/fs/vxfs/fsadm -F vxfs -b +4270 -r /dev/vx/rdsk/PRODdg/db01 /db01
vxfs fsadm: /dev/vx/rdsk/PRODdg/db01 is currently 8540 sectors - size will be increased 

by providing size -
# /usr/lib/fs/vxfs/fsadm -F vxfs -b +100g -r /dev/vx/rdsk/PRODdg/db01 /db01

OR


#  /usr/lib/fs/vxfs/fsadm -b <size to match volume> /<mount point>

Eg:
by providing sectors -
#  /usr/lib/fs/vxfs/fsadm -b +4270 /db01

by providing size-
#  /usr/lib/fs/vxfs/fsadm -b +100g /db01

However it would always recommended to test the provided steps in Development setup before executing on production.

Also please make sure there are NO or absolutely minimal I/Os happening on the file system

Regards
Rajesh

Note: Please mark this note as solution if this note helps.

Gaurav_S
Moderator
Moderator
   VIP    Certified
Strange ... as per vxprint output .... 1677721600 * 512 / (1024*1024*1024) = 800G can u tell the exact command you have used to create the filesystem & volume ?

rregunta
Level 4
Also, since the diskgroup has more space available, after the file system has grown up to 800GB you could use vxresize command to grow maximum available space. Use the vxresize command when resizing both the volume and the file system. The vxresize command guarantees that the file system shrinks or grows along with the volume.

The command syntax would be.

1. Verify that there is enough space available to grow the volume. vxassist maxgrow <volume-name>
2. Grow the filesystem:

     cd /usr/lib/vxvm/bin/
     ./vxresize -F <filesystem type> -g <diskgroup> <volumename> + <size>

   example:
     ./vxresize -F vxfs -g dadbdg-hds voldb00 +100g
Regards
Rajesh

Note: Please mark this note as solution if this note helps.

Gaurav_S
Moderator
Moderator
   VIP    Certified
So you have two tasks here: a) You have a case where volume & fileystem size are not matching, first you have to fix this... see below on how to do this.. b) once above is done, then you can think of reducing the FS & volume to 400G (as this was your original requirement) # /usr/lib/fs/vxfs/fsadm -b 1677721600 /oracle should extend your filesystem to 800G I would suggest to do this first... once this is done (i.e your volume & filesystem size is exactly matching), You can verify the same once again by pasting a "fstyp -v " Once above is done then you can shrink your filesystem & volume to 400G by running # vxresize -g -b 400G Gaurav

Gaurav_S
Moderator
Moderator
   VIP    Certified
there is a typo in last command... it should be

# vxresize -g <diskgroup> -b <volume> 400G

Gaurav

g_lee
Level 6
As Gaurav and Rajesh have both mentioned, the filesystem is 300G but the underlying volume is 800G - as mentioned, if you want to know why/how this occurred please provide the commands used when you attempted to grow the filesystem previously.

As you want to grow the filesystem to 400G, and the volume is already larger than this, you should be able to use vxresize to resize the volume + filesystem to 400G (ie: as the sizes are out of sync at the moment, specify absolute size of 400g so they are both resized to same/consistent size):

# vxresize -F vxfs -g sapprddbdg sapdbvol01 400g

For future resize operations (grow/shrink), would still recommend using vxresize as this will resize the filesystem and volume ie: you avoid inconsistencies. You can specify increments, eg: if you later wanted to grow the filesystem from 400g to 500g, then:

# vxresize -F vxfs -g sapprddbdg sapdbvol01+100g
(this specifies a growth increment of +100g ie: 400+100 = 500)

see man page for more options: http://sfdoccentral.symantec.com/sf/5.0MP3/aix/manpages/vxvm/man1m/vxresize.html

g_lee
Level 6
Gaurav,

As the volume is larger than the filesystem in this case, the fs should not need to be grown to 800GB

It should be sufficient to run vxresize specifying absolute size of 400g, as this will resize (shrink) the volume to 400g, and then grow the fs from 300g to 400g to match.

regards,
Grace

Gaurav_S
Moderator
Moderator
   VIP    Certified

Hi Grace,

Yep I agree, I mentioned FS to grow to 800G be get to a safe point.... To correct the problem, I thought better to resize one (FS) rather then to resize both (FS&volume)

Once confirmed all incosistencies are removed, then anytime can come down to 400G....

Gaurav

headbig
Level 4
Partner Accredited Certified

Hi all,

Thank you!

I will follow your advice to have a retry.

Bill_Havey
Level 3
There is no rule in SF that a volume and file system must be the same size although that is the default. The "mkfs" command can specify a size. The "inconsistency" of sizes doesn't interfere with the functionality of VxVM or VxFS. It does guarantee space is available to grow the volume and file system in the future. Reserving space this way wouldn't be classifies as a best practice.

Gaurav_S
Moderator
Moderator
   VIP    Certified
Hi Bill,

Yes agreed, Different size will keep on working i.e mount will be functional as is the case above, however if the sizes are different & FS gets unmounted for whatsoever reason, it won't mount again as fsck would report as inconsistency.... For HP-UX, it is pretty easy as extendfs runs on a unmounted FS, but for solaris it becomes difficult since fsadm needs filesystem to be mounted for grow/shrink option...


Gaurav

headbig
Level 4
Partner Accredited Certified

Very Sorry, Thank you all  !

With your help, I solved my problems,and I also got lots of knowledges about SFHA.