Operating System - HP-UX
1824841 Members
3685 Online
109674 Solutions
New Discussion юеВ

How to add disks to vg and need to extend the filesystem?

 
SOLVED
Go to solution
Sudhaadm
Regular Advisor

How to add disks to vg and need to extend the filesystem?

Hi the disks are added from EMC to HP server.
Now the disks are claimed .i need to add this disk into vg1 .after that need to extend the filesystem size without lossing data and reboot.
Please help us this problem
Deatails:
root@charv01:/# diskinfo /dev/rdsk/c10t6d7
SCSI describe of /dev/rdsk/c10t6d7:
vendor: EMC
product id: SYMMETRIX
type: direct access
size: 35354880 Kbytes
bytes per sector: 512

root@charv01:/# diskinfo /dev/rdsk/c10t6d6
SCSI describe of /dev/rdsk/c10t6d6:
vendor: EMC
product id: SYMMETRIX
type: direct access
size: 35354880 Kbytes
bytes per sector: 512

root@charv01:/# ioscan -funC disk |grep /dev/rdsk/c10t6d7
/dev/dsk/c10t6d7 /dev/rdsk/c10t6d7
root@charv01:/# ioscan -funC disk |grep /dev/rdsk/c10t6d6
/dev/dsk/c10t6d6 /dev/rdsk/c10t6d6
root@charv01:/#
29 REPLIES 29
Sivakumar TS
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?



Dear Sudhaadm,

do # pvcreate
then # vgextend
then # lvextend
and #extendfs

Please check the man pages for further info.

With Regards,

Siva.
Nothing is Impossible !
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

try this:

# vgextend /dev/vg1 /dev/dsk/c10t6d6 /dev/dsk/c10t6d7

with online:
# lvextend -l /dev/vg1/
# fsadm -F vxfs -b

without online:
# lvextend -l /dev/vg1/
# umount /dev/vg1/
# extendfs /dev/vg1/r
# mount /dev/vg1/

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

forgot something before vgextend:

# pvcreate -f /dev/rdsk/c10t6d6
# pvcreate -f /dev/rdsk/c10t6d7

regards.
what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

How can i give the extent size.
this disk is EMC disk.And need clear steps because i am new to HP-UNIX
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

I need to add 10Gb space on each FS or logical volume.
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

could u reply on this:

# vgdisplay -v vg1

from the output, what is the file system u like to increase.

regards.
what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

I need to add space 10 gb on each of these /data 06, 04,05,02,07

vg03_chardata is having lv 's /data02/04/05/06
/dev/vg04_chardata is having lv /data07

root@charv01:/usr/symcli/bin# vgdisplay -v /dev/vg03_chardata
--- Volume groups ---
VG Name /dev/vg03_chardata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 6
Cur PV 6
Act PV 6
Max PE per PV 17263
VGDA 12
PE Size (Mbytes) 8
Total PE 90615
Alloc PE 90615
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg03_chardata/lv_data01
LV Status available/syncd
LV Size (Mbytes) 103488
Current LE 12936
Allocated PE 12936
Used PV 1

LV Name /dev/vg03_chardata/lv_data02
LV Status available/syncd
LV Size (Mbytes) 103488
Current LE 12936
Allocated PE 12936
Used PV 1

LV Name /dev/vg03_chardata/lv_data03
LV Status available/syncd
LV Size (Mbytes) 103488
Current LE 12936
Allocated PE 12936
Used PV 1

LV Name /dev/vg03_chardata/lv_data04
LV Status available/syncd
LV Size (Mbytes) 103488
Current LE 12936
Allocated PE 12936
Used PV 1

LV Name /dev/vg03_chardata/lv_data05
LV Status available/syncd
LV Size (Mbytes) 69056
Current LE 8632
Allocated PE 8632
Used PV 1

LV Name /dev/vg03_chardata/lv_data06
LV Status available/syncd
LV Size (Mbytes) 68992
Current LE 8624
Allocated PE 8624
Used PV 1

LV Name /dev/vg03_chardata/lv_arch02
LV Status available/syncd
LV Size (Mbytes) 103536
Current LE 12942
Allocated PE 12942
Used PV 3

LV Name /dev/vg03_chardata/lv_arch
LV Status available/syncd
LV Size (Mbytes) 69384
Current LE 8673
Allocated PE 8673
Used PV 4


--- Physical volumes ---
PV Name /dev/dsk/c8t5d0
PV Name /dev/dsk/c10t2d4 Alternate Link
PV Status available
Total PE 17260
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t5d1
PV Name /dev/dsk/c10t2d5 Alternate Link
PV Status available
Total PE 17260
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t5d2
PV Name /dev/dsk/c10t2d6 Alternate Link
PV Status available
Total PE 17260
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t5d3
PV Name /dev/dsk/c10t2d7 Alternate Link
PV Status available
Total PE 17260
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t5d4
PV Name /dev/dsk/c10t3d0 Alternate Link
PV Status available
Total PE 17260
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t5d5
PV Name /dev/dsk/c10t3d2 Alternate Link
PV Status available
Total PE 4315
Free PE 0
Autoswitch On


root@charv01:/usr/symcli/bin#
root@charv01:/usr/symcli/bin# vgdisplay -v /dev/vg04_chardata
--- Volume groups ---
VG Name /dev/vg04_chardata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 17263
VGDA 6
PE Size (Mbytes) 8
Total PE 12942
Alloc PE 12942
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg04_chardata/lv_data07
LV Status available/syncd
LV Size (Mbytes) 103536
Current LE 12942
Allocated PE 12942
Used PV 3


--- Physical volumes ---
PV Name /dev/dsk/c8t6d0
PV Name /dev/dsk/c10t6d0 Alternate Link
PV Status available
Total PE 4314
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t6d1
PV Name /dev/dsk/c10t6d1 Alternate Link
PV Status available
Total PE 4314
Free PE 0
Autoswitch On

PV Name /dev/dsk/c8t6d2
PV Name /dev/dsk/c10t6d2 Alternate Link
PV Status available
Total PE 4314
Free PE 0
Autoswitch On


root@charv01:/usr/symcli/bin#
##Now i have 2 disks.How can i complete this task.
##Waiting...

Thnks


Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Hi Josep/Sivakumar,

Thanks for the reply and help us to do the step by step as it is critical server for us.
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

u have 2 disks, each 36GB and u like to place the disks in 2 separate volume groups, vg03_chardata and vg04_chardata. u can only add either both disks to either volume group or one disk to each volume group.

so, if u like to add 10GB to each filesystem, i.e. 40GB for vg03_chardata and 10GB for vg04_chardata. one disk must be added to each volume group.

also, since the disk is only 36GB, u may have to resize how many to allocate for each file system in vg03_chardata.

please reply on bdf and also exact size if u like to have the commands to apply.

another method is to do it from sam if u r unfamiliar with the commands.

r u also on OnlineJFS:

# swlist -l product|grep -i jfs

regards.
what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Hi thanks for the reply.
Any how please provide the steps and can try to to request to add one more disk for that VG.
root@charv01:/usr/symcli/bin# swlist -l product|grep -i jfs
PHCO_20030 1.0 Enhance ln(1) to work with JFS ACLs.
PHCO_20031 1.0 Enhance ls(1) to work with JFS ACLs.
PHCO_20032 1.0 Enhance mv(1) to work with JFS ACLs.
PHCO_20033 1.0 Enhance rm(1) to work with JFS ACLs.
PHCO_20034 1.0 Enhance shar(1) to work with JFS ACLs.
PHCO_20037 1.0 Enhance find(1) for JFS ACLs.
PHCO_20039 1.0 Enhance unpack(1) to work with JFS ACLs
PHKL_14763 1.0 JFS extended map inodes cause fsck failure
PHKL_18452 1.0 Invalid I/O sizes from JFS causes hangs
PHKL_18543 1.0 PM/VM/UFS/async/scsi/io/DMAPI/JFS/perf patch
PHKL_18800 1.0 Cumulative JFS patch - panic:dirty inval
PHKL_18801 1.0 Fix for JFS fsadm ENOSPC errors
PHKL_19991 1.0 Fixes mmap & I/O coherency, enables JFS ACLs
PHKL_20222 1.0 Fix boot,JFS; IO perf;PA8600; lg. data(1of8)
PHKL_20335 1.0 boot,JFS;IO perf;PA8600;3GB data;NFS;bcache
PHKL_20675 1.0 Fix JFS 3.1 hang, data corruption
PHKL_21349 1.0 mmap coherency, JFS ACLs, IDS/9000 support
PHKL_21491 1.0 fix VxFS(JFS 3.1) fsadm hang
PHKL_22393 1.0 VxFS 31 OnlineJFS cumulative patch
PHKL_24011 1.0 JFS 3.3 fix panic due to FS corruption
PHKL_24014 1.0 JFS 3.1 cummulative corruption and panic fix
PHKL_24745 1.0 VxFS 31 OnlineJFS cumulative patch
PHKL_27080 1.0 Fixes JFS3.1 hang.
root@charv01:/usr/symcli/bin#
root@charv01:/usr/symcli/bin#
root@charv01:/usr/symcli/bin#
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

I need to add 10GB on each File system.
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

follow this steps:

# pvcreate -f /dev/rdsk/c10t6d6
# pvcreate -f /dev/rdsk/c10t6d7

# vgextend /dev/vg03_chardata /dev/dsk/c10t6d6
# vgextend /dev/vg04_chardata /dev/dsk/c10t6d7

since u have online but u have not given me the bdf output, insert the :
added 8GB to these 4 logical volumes:
# lvextend -l 13936 /dev/vg03_chardata/lv_data02
# fsadm -F vxfs -b 114163712

# lvextend -l 13936 /dev/vg03_chardata/lv_data04
# fsadm -F vxfs -b 114163712

# lvextend -l 9632 /dev/vg03_chardata/lv_data05
# fsadm -F vxfs -b 78905344

# lvextend -l 9624 /dev/vg03_chardata/lv_data06
# fsadm -F vxfs -b 78839808

added 10GB to this logical volume:
# lvextend -l 14192 /dev/vg04_chardata/lv_data07
# fsadm -F vxfs -b 116260864


to verify:
# vgdisplay -v /dev/vg03_chardata
# vgdisplay -v /dev/vg04_chardata


regards.
what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Ohhh sorry ...

root@charv01:/usr/symcli/bin# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 155648 104989 47534 69% /
/dev/vg00/lvol1 99669 46899 42803 52% /stand
/dev/vg00/lvol8 2097152 1408034 648423 68% /var
/dev/vg00/lvol7 1191936 960060 217422 82% /usr
/dev/vg00/lvol6 524288 23973 469228 5% /tmp
/dev/vg00/lvol5 1024000 932332 85979 92% /opt
/dev/vg00/lvol4 524288 16095 476477 3% /home
/dev/vg00/lvarch 81920 1125 75752 1% /arch
/dev/vg02_charbaan/lv_tivoli
524288 473201 49293 91% /tivoli
/dev/vg02_charbaan/lv_msl4
6512640 1839534 4399589 29% /msl4
/dev/vg01_charapps/lv_eose
4194304 771882 3208544 19% /eose
/dev/vg01_charapps/lv_edi
8388608 6183610 2136288 74% /edi
/dev/vg03_chardata/lv_data06
70647808 68655592 1976656 97% /data/data06
/dev/vg03_chardata/lv_data05
70713344 70153656 555320 99% /data/data05
/dev/vg03_chardata/lv_data04
105971712 105566904 401648 100% /data/data04
/dev/vg03_chardata/lv_data03
105971712 105222608 743312 99% /data/data03
/dev/vg03_chardata/lv_data02
105971712 105616024 352968 100% /data/data02
/dev/vg03_chardata/lv_data01
105971712 105692632 276960 100% /data/data01
/dev/vg02_charbaan/lv_charhome
2097152 1184444 859818 58% /charhome
/dev/vg02_charbaan/lv_baanprint
1048576 1357 981775 0% /baanprint
/dev/vg02_charbaan/lv_baandata
16777216 14530772 2211524 87% /baandata
/dev/vg02_charbaan/lv_baanaudit
4194304 958051 3034045 24% /baanaudit
/dev/vg02_charbaan/lv_baanadmn
4194304 3214754 926788 78% /baanadmn
/dev/vg03_chardata/lv_arch02
106020864 10635624 94640216 10% /arch/arch02
/dev/vg03_chardata/lv_arch
71049216 60593336 10374336 85% /arch/arch01
/dev/vg01_charapps/lv_apps
4194304 3587910 568894 86% /apps
/dev/vg04_chardata/lv_data07
106020864 105283616 731496 99% /data/data07
/dev/vg05_chardata/lv_data08
106045440 92765592 13176168 88% /data/data08
/dev/vg00/tiv 307200 120120 175431 41% /tiv
/dev/vg00/patch 819200 289195 496894 37% /patch
/dev/vg00/vsa 258048 165647 86644 66% /vsa
root@charv01:/usr/symcli/bin#
Joseph Loo
Honored Contributor
Solution

Re: How to add disks to vg and need to extend the filesystem?

hi,

ok. follow this steps:

# pvcreate -f /dev/rdsk/c10t6d6
# pvcreate -f /dev/rdsk/c10t6d7

1 36GB disk to each volume group, unless u can add another disk.
# vgextend /dev/vg03_chardata /dev/dsk/c10t6d6
# vgextend /dev/vg04_chardata /dev/dsk/c10t6d7


as i have stated in your case, u can only have 1 disk allocated to each volume group, so given a 36GB, i have added 8GB to these 4 logical volumes in /dev/vg03_chardata:

# lvextend -l 13936 /dev/vg03_chardata/lv_data02
# fsadm -F vxfs -b 114163712 /data/data02

# lvextend -l 13936 /dev/vg03_chardata/lv_data04
# fsadm -F vxfs -b 114163712 /data/data04

# lvextend -l 9632 /dev/vg03_chardata/lv_data05
# fsadm -F vxfs -b 78905344 /data/data05

# lvextend -l 9624 /dev/vg03_chardata/lv_data06
# fsadm -F vxfs -b 78839808 /data/data06

added 10GB to this logical volume:
# lvextend -l 14192 /dev/vg04_chardata/lv_data07
# fsadm -F vxfs -b 116260864 /data/data07


to verify:
# vgdisplay -v /dev/vg03_chardata
# vgdisplay -v /dev/vg04_chardata

regards.
what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?


Hi please check the error..
root@charv01:/usr/symcli/bin# vgextend /dev/vg03_chardata /dev/dsk/c10t6d6
vgextend: Couldn't install the physical volume "/dev/dsk/c10t6d6".
Too many links
root@charv01:/usr/symcli/bin# vgdisplay /dev/vg03_chardata
--- Volume groups ---
VG Name /dev/vg03_chardata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 6
Cur PV 6
Act PV 6
Max PE per PV 17263
VGDA 12
PE Size (Mbytes) 8
Total PE 90615
Alloc PE 90615
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Hi joseph..its gone successfull.
root@charv01:/usr/symcli/bin# gextend /dev/vg04_chardata /dev/dsk/c10t6d7
root@charv01:/usr/symcli/bin# vgextend /dev/vg04_chardata /dev/dsk/c10t6d7
Volume group "/dev/vg04_chardata" has been successfully extended.
Volume Group configuration for /dev/vg04_chardata has been saved in /etc/lvmconf/vg04_chardata.conf
root@charv01:/usr/symcli/bin# vgextend /dev/vg04_chardata /dev/dsk/c10t6d6
Volume group "/dev/vg04_chardata" has been successfully extended.
Volume Group configuration for /dev/vg04_chardata has been saved in /etc/lvmconf/vg04_chardata.conf
root@charv01:/usr/symcli/bin#
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

for /dev/vg03_chardata, u cannot exceed the max physical volume which is 6 (in your case). default max_pv is 16 per volume group, someone must have change it when doing a vgcreate.

this is not going to be easy cause u have to re-create the entire volume group:

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063200398


for /dev/vg04_chardata, the max physical volume which is 16, thus u may go ahead with it.

regards.
what you do not see does not mean you should not believe
Devender Khatana
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

Hi,

Max_PV parameter was not defined properly when your vg03_chardata vg was created. It can only support 6 physical devices and it has allready got 6. This parameter can not be changed and you need to recreate atleast this VG from the scratch.

Backup files under all file systems in vg02_chardata VG, remove and recreate VG and restore backup.

The extending part can be accomplished with other VG allthough without problems.

Also you want to add 10GB in four file systems in vg03_chardata volume group. This require 4*10=40GB free space but the lun you are adding is of 34 GB only.

While resturcturing also take a note of this.

HTH,
Devender
Impossible itself mentions "I m possible"
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Hi Joseph i had done big mistake and added both disks in same VG...how can ireuce online...

Please sorry for the trouble.
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Hi Joseph/all

Is it possible to reduce harddisk from /dev/vg04_chardata.
Mistakely i added 2 hard disks on same vg.I supposed to add only one hard disk..
Urgency...
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

have u done lvextend for the logical volume /dev/vg04_chardata/lv_data07? if u have not:

# vgreduce /dev/vg04_chardata /dev/dsk/c10t6d6

and reply:

# strings /etc/lvmtab

to verify

regards.

what you do not see does not mean you should not believe
Sudhaadm
Regular Advisor

Re: How to add disks to vg and need to extend the filesystem?

Ohhh gr8 joseph..thanks alot

i reduced successfully..i did 't added this disks to lv..and what about that previous error.Devendra suggested that we can add one more disk on /dev/vg03_chardata.
root@charv01:/usr/symcli/bin# vgreduce /dev/vg04_chardata /dev/dsk/c10t6d6
Volume group "/dev/vg04_chardata" has been successfully reduced.
Volume Group configuration for /dev/vg04_chardata has been saved in /etc/lvmconf/vg04_chardata.conf
root@charv01:/usr/symcli/bin#

root@charv01:/usr/symcli/bin# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c3t5d0
/dev/dsk/c3t6d0
/dev/dsk/c6t5d0
/dev/dsk/c6t6d0
/dev/vg01_charapps
/dev/dsk/c8t5d7
/dev/dsk/c10t3d5
/dev/vg02_charbaan
/dev/dsk/c8t5d6
/dev/dsk/c10t3d3
/dev/vg03_chardata
/dev/dsk/c8t5d0
/dev/dsk/c8t5d1
/dev/dsk/c8t5d2
/dev/dsk/c8t5d3
/dev/dsk/c8t5d4
/dev/dsk/c8t5d5
/dev/dsk/c10t2d4
/dev/dsk/c10t2d5
/dev/dsk/c10t2d6
/dev/dsk/c10t2d7
/dev/dsk/c10t3d0
/dev/dsk/c10t3d2
/dev/vg04_chardata
/dev/dsk/c8t6d0
/dev/dsk/c8t6d1
/dev/dsk/c8t6d2
/dev/dsk/c10t6d0
/dev/dsk/c10t6d1
/dev/dsk/c10t6d2
/dev/dsk/c10t6d7
/dev/vg05_chardata
B7fg
/dev/dsk/c8t6d3
/dev/dsk/c10t6d4
/dev/dsk/c8t6d5
/dev/dsk/c10t6d3
/dev/dsk/c8t6d4
/dev/dsk/c10t6d5
root@charv01:/usr/symcli/bin#

Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

as i have mentioned, for /dev/vg03_chardata, u cannot exceed the max physical volume which is 6 (in your case). default max_pv is 16 per volume group, someone must have change it when doing a vgcreate.

this is not going to be easy cause u have to re-create the entire volume group:

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063200398

what devender mentioned is correct, backup data from /dev/vg03_chardata and recreate that volume group.

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: How to add disks to vg and need to extend the filesystem?

hi,

i found a doc which u may reference to:

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080059531

ignore the steps associated to mirroring.

regards.
what you do not see does not mean you should not believe