LVM and VxVM

Disk Space Calc & Reducing /var Space

 
SOLVED
Go to solution
sivakumar_11
Advisor

Disk Space Calc & Reducing /var Space

Hello All,

Refer the info below:
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 86992 116920 43% /
/dev/vg00/lvol1 298928 80328 188704 30% /stand
/dev/vg00/lvol8 4710400 1029128 3652888 22% /var
/dev/vg00/lvol7 2015232 1466192 544792 73% /usr
/dev/vg00/u03 12288000 7321070 4811776 60% /u03
/dev/vg00/u02 12288000 6885880 5233306 57% /u02
/dev/vg00/ora
16400384 11987892 4275174 74% /u01
/dev/vg00/lvol4 204800 109576 95128 54% /tmp
/dev/vg00/lvol6 2154496 1369408 779024 64% /opt
/dev/vg00/bap 2097152 1067962 965111 53% /bap
/dev/vg00/lvol5 24576 4776 19696 20% /home


# iostat

device bps sps msps

c2t0d0 0 0.0 1.0
c2t1d0 0 0.0 1.0

# vgdisplay -v /dev/vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 12
Open LV 12
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 6945
Free PE 1735
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 304
Current LE 38
Allocated PE 38
Used PV 1

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 512
Allocated PE 512
Used PV 1

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 200
Current LE 25
Allocated PE 25
Used PV 1

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 200
Current LE 25
Allocated PE 25
Used PV 1

LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 24
Current LE 3
Allocated PE 3
Used PV 1

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 2104
Current LE 263
Allocated PE 263
Used PV 1

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 1968
Current LE 246
Allocated PE 246
Used PV 1

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 4600
Current LE 575
Allocated PE 575
Used PV 1

LV Name /dev/vg00/inca_orahome
LV Status available/syncd
LV Size (Mbytes) 16016
Current LE 2002
Allocated PE 2002
Used PV 1

LV Name /dev/vg00/u02
LV Status available/syncd
LV Size (Mbytes) 12000
Current LE 1500
Allocated PE 1500
Used PV 2

LV Name /dev/vg00/u03
LV Status available/syncd
LV Size (Mbytes) 12000
Current LE 1500
Allocated PE 1500
Used PV 1

LV Name /dev/vg00/inca_bap
LV Status available/syncd
LV Size (Mbytes) 2048
Current LE 256
Allocated PE 256
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4340
Free PE 0
Autoswitch On

PV Name /dev/dsk/c2t1d0
PV Status available
Total PE 4340
Free PE 1735
Autoswitch On

===============
# pvdisplay /dev/dsk/c2t0d0
--- Physical volumes ---
PV Name /dev/dsk/c2t0d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 10
PE Size (Mbytes) 8
Total PE 4340
Free PE 0
Allocated PE 4340
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

# pvdisplay /dev/dsk/c2t1d0
--- Physical volumes ---
PV Name /dev/dsk/c2t1d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 3
PE Size (Mbytes) 8
Total PE 4340
Free PE 1735
Allocated PE 2605
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

===============================================

1. I want to reduce /var space
2. I want to create a new lv of 12 Gig.

Help me.

tar
sva
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: Disk Space Calc & Reducing /var Space

Even without reducing /var, you've got enough space to create your 12Gb lvol. There are 1735 x 8Mb PEs free on /dev/dsk/c2t1d0. That's roughly 13.8 Gb available for your new lvol.

As far as reducing /var, unless you have OnlineJFS, the easiest way to do it is to use some of that free space before you create your new 12Gb lvol to create a new, temporary /var of your desired size. Call it /newvar or something. Then copy the contents of /var into /newvar, switch the mountpoints in /etc/fstab and reboot. Then you can get rid of the old /var (now called /newvar) and incorporate that space into your new lvol.


Pete

Pete
sivakumar_11
Advisor

Re: Disk Space Calc & Reducing /var Space

Thanks Pete,

Could u give me the step by step cmds for making /var to reduce. actually, i removed the mirror & i got 13gig. My sr. adm, asks me to reduce the /var space to 2 gig.

I req. Steps .

tar
siva
Robert-Jan Goossens
Honored Contributor
Solution

Re: Disk Space Calc & Reducing /var Space

# mkdir /u02/var
# shutdown -r -y now
as soon as you see something like "press any key to override"

at the menu:
boot pri isl
answer y to interact with ISL
hpux -is

will boot your system in single user mode.
# mount /usr
# mount /u02
# mount /var
# cd /var
# cpio -pcmudv /u02/var
# cd /
# umount /var
# lvreduce -L 2000 /dev/vg00/lvol8
# newfs -F vxfs /dev/vg00/rlovl8
# mount /var
# cd /u02/var
# cpio -pcmudv /var
# bdf
# shutdown -r -y now

If you have OnlineJFS you could try it with fsadm and lvreduce.

Hope this helps,
Robert-Jan
Robert-Jan Goossens
Honored Contributor

Re: Disk Space Calc & Reducing /var Space

I made a typo in the above steps.

# mkdir /u02/var
# shutdown -r -y now
as soon as you see something like "press any key to override"

at the menu:
boot pri isl
answer y to interact with ISL
hpux -is

will boot your system in single user mode.
# mount /usr
# mount /u02
# mount /var
# cd /var
# find . | cpio -pcmudv /u02/var
# cd /
# umount /var
# lvreduce -L 2000 /dev/vg00/lvol8
# newfs -F vxfs /dev/vg00/rlovl8
# mount /var
# cd /u02/var
# find . | cpio -pcmudv /var
# bdf
# shutdown -r -y now

added the find command before the cpio.