How to remove the one LE via fsadm and lvreduce method
How
to remove the one LE via fsadm and
lvreduce method. If data is fragmented ,
it is Good advice to run defragmentation step before
going for shrinking of File
system.
[root@sandbox:/tmp]#
#-> bdf /usr
Filesystem
kbytes used avail %used Mounted on
/dev/vg00/lvol9
8388608 3968860 4143896 49% /usr
[root@sandbox:/tmp]#
#-> vgdisplay /dev/vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 14
Open LV 14
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 5000
VGDA 4
PE Size (Mbytes) 16 ----------one PE size.
Total PE 8748
Alloc PE 7026
Free PE 1722
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
[root@sandbox:/tmp]#
#-> lvdisplay -v /dev/vg00/lvol9 |tail
00503
/dev/dsk/c2t1d0 02645 current /dev/dsk/c2t0d0 02773 current
00504
/dev/dsk/c2t1d0 02646 current /dev/dsk/c2t0d0 02774 current
00505
/dev/dsk/c2t1d0 02647 current /dev/dsk/c2t0d0 02775 current
00506
/dev/dsk/c2t1d0 02648 current /dev/dsk/c2t0d0 02776 current
00507
/dev/dsk/c2t1d0 02649 current /dev/dsk/c2t0d0 02777 current
00508
/dev/dsk/c2t1d0 02650 current /dev/dsk/c2t0d0 02778 current
00509
/dev/dsk/c2t1d0 02651 current /dev/dsk/c2t0d0 02779 current
00510
/dev/dsk/c2t1d0 02652 current /dev/dsk/c2t0d0 02780 current
00511 /dev/dsk/c2t1d0 02653 current /dev/dsk/c2t0d0 02781 current
[root@sandbox:/tmp]#
#->
[root@sandbox:/tmp]#
#->
[root@sandbox:/tmp]#
#-> lvdisplay /dev/vg00/lvol9
--- Logical volumes ---
LV Name /dev/vg00/lvol9
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8192
Current LE 512
Allocated PE 1024
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
[root@sandbox:/tmp]#
#-> bc
8192-16
8176
[root@sandbox:/tmp]#
#-> fsadm -b 8176M /usr
fsadm: /etc/default/fs is used for determining the file
system type
vxfs fsadm: /dev/vg00/rlvol9 is currently 8388608 sectors
- size will be reduced
vxfs fsadm: allocations found in shrink range, moving
data
[root@sandbox:/tmp]#
#-> bdf /usr
Filesystem
kbytes used avail %used Mounted on
/dev/vg00/lvol9
8372224 3968860 4128536 49% /usr
[root@sandbox:/tmp]#
#-> lvreduce -L 8176
/dev/vg00/lvol9
When a logical volume is reduced useful data might get
lost;
do you really want
the command to proceed (y/n) : y
Logical volume "/dev/vg00/lvol9" has been
successfully reduced.
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf
[root@sandbox:/tmp]#
#-> lvdisplay /dev/vg00/lvol9
--- Logical volumes ---
LV Name /dev/vg00/lvol9
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8176
Current LE 511
Allocated PE 1022
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
[root@sandbox:/tmp]#
#-> lvdisplay
-v /dev/vg00/lvol9 |tail
00502
/dev/dsk/c2t1d0 02644 current /dev/dsk/c2t0d0 02772 current
00503
/dev/dsk/c2t1d0 02645 current /dev/dsk/c2t0d0 02773 current
00504
/dev/dsk/c2t1d0 02646 current /dev/dsk/c2t0d0 02774 current
00505
/dev/dsk/c2t1d0 02647 current /dev/dsk/c2t0d0 02775 current
00506
/dev/dsk/c2t1d0 02648 current /dev/dsk/c2t0d0 02776 current
00507
/dev/dsk/c2t1d0 02649 current /dev/dsk/c2t0d0 02777 current
00508
/dev/dsk/c2t1d0 02650 current /dev/dsk/c2t0d0 02778 current
00509
/dev/dsk/c2t1d0 02651 current /dev/dsk/c2t0d0 02779 current
00510
/dev/dsk/c2t1d0 02652 current /dev/dsk/c2t0d0 02780 current
[root@sandbox:/tmp]#
#->