VXVM-7 (Volume Resize)
What we will learn in
Next Few Pages,
·
Resize
Volumes without Unmount
Resize Volumes Without
Unmounting,
#vxassist it will initiate volume resize with help
of
Growby / growto
Shrinkby / shrinkto
Ok… but there one more
step in it, leave it have u remember that in SVM, after resize we need to fire
“growfs” b’coz vol mgr knows about the changes but these changes did not
directly propagated to File System, so we need to relay that change via
“growfs” to File system
Same Here, Vol mgr
knows but FS is unaware of changes, and here we need “fsadm”
#vxresize automatically resizes for both Vol &
FS,
root@pr-01:>/#
mount -F vxfs /dev/vx/dsk/mydg/myvol /vol-test/
root@pr-01:>/# df
-kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
200M 23M
166M 13% /vol-test
root@pr-01:>/#
vxassist -g mydg maxsize
Maximum volume size:
5261312 (2569Mb)
This is the free space
left in Dg “mydg”
Let’s grow this vol by
50m
root@pr-01:>/#
vxassist -g mydg growby myvol 50m
vxassist initiator
-g mydg DG
name
Growby expand
it
Myvol Volume
Name
50m size
to be grown
Let’s check what
happened
root@pr-01:>/# df
-kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
200M 23M
166M 13% /vol-test
Nothing…
We need to tell the FS
also that The Vol has been grown
root@pr-01:>/#
fsadm -b 50m /vol-test
UX:vxfs fsadm: INFO:
V-3-23586: /dev/vx/rdsk/mydg/myvol is currently 409600 sectors - size will be
reduced
Heyyy… what’s the
error ?
Why it is telling that
size will be reduced
OMG… I did everything
correctly, But why it shrink instead to grow
root@pr-01:>/# df
-kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
50M 23M
25M 48% /vol-test
**here I had data less
than 50m that’s why still I have those, but what if the data will be larger
than 50m? BOOOM… lost
SO what was wrong in
it?
We had given “growby
50m” vxvm thought that this is the new size of the volume and did
accordingly,There is no fault of Vol Mgr
We had to use + sign
if we want to increase and – for decrease
GOT IT…
Want to try again,
Currently our Vol is
of 50m
root@pr-01:>/#
vxassist -g mydg growby myvol +50m
root@pr-01:>/#
fsadm -b +50m /vol-test
UX:vxfs fsadm: INFO:
V-3-25942: /dev/vx/rdsk/mydg/myvol size increased from 102400 sectors to 204800
sectors
root@pr-01:>/# df
-kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
100M 23M
72M 25% /vol-test
Now… Fine?
Ok,
root@pr-01:>/# vxassist -g mydg
growby myvol +1024m
root@pr-01:>/# fsadm -b +1024m
/vol-test
UX:vxfs fsadm: INFO: V-3-25942:
/dev/vx/rdsk/mydg/myvol size increased from 204800 sectors to 2301952 sectors
root@pr-01:>/# df -kh /vol-test/
Filesystem size
used avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
1.1G 23M
1.0G 3% /vol-test
I think it will be clear, Or NOT ?
Let’s reduce…
root@pr-01:>/# vxassist -g mydg
shrinkby myvol 500m
VxVM vxassist ERROR V-5-1-7236 Shrinking
a FSGEN or RAID5 usage type volume can result in loss of data. It is
recommended to use the "vxresize" command or specify "-f"
option to force the operation.
root@pr-01:>/# vxassist -f -g mydg
shrinkby myvol 500m
root@pr-01:>/# fsadm -b 500m
/vol-test/
UX:vxfs fsadm: INFO: V-3-23586:
/dev/vx/rdsk/mydg/myvol is currently 2301952 sectors - size will be reduced
root@pr-01:>/# df -kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
500M 23M
447M 5% /vol-test
Great… we did it,
But, Have u noticed that in previous df
–kh we have 1.1g and in this we have 500mb, where the 100mb gone?
OHhhh Shit,
I think you are also thinking the same…
That’s why I asked Clear?
Ok... Let’s explain…
What happen when we give the grow/shrink
without +/- the vol mgr thinks that this is new size
And when we give +/- vol mgr thinks that
this is to add / subtract from what it is currently
NOW ============
Vxresize
root@pr-01:>/# df -kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
200M 23M
166M 13% /vol-test
root@pr-01:>/# vxresize -g mydg myvol
+30m
root@pr-01:>/# df -kh /vol-test/
Filesystem size
used avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
230M 23M
194M 11% /vol-test
root@pr-01:>/# vxresize -g mydg myvol
-70m
root@pr-01:>/# df -kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
160M 23M
128M 16% /vol-test
Enough… Now I want to be Tough and
should stop playing this +/- game,
OK…
root@pr-01:>/# vxresize -g mydg myvol
300m
root@pr-01:>/# df -kh /vol-test/
Filesystem size used
avail capacity Mounted on
/dev/vx/dsk/mydg/myvol
300M 23M
260M 9% /vol-test
See… no +/
No comments:
Post a Comment