| « How To Analyse HP-UX crash dumps | How to find the WWN (World Wide Name) in Sun Solaris » |
HP-UX LVM - Resizing Filesystem with Online JFS
HP-UXA quick guide to extend an LVM with a VXFS Filesystem.
1. Verify OnLineJFS is installed
# swlist -l product | grep -i vxfs
# swlist -l product | grep -i online
Look for OnlineJFS or AdvJournalFS
2. It is a good practice to defrag the filesystem first before extending
# fsadm -d - D -e - E /mountpoint
3. Determine the Logical Volume where the filesystem is mounted.
# bdf /mountpoint
Example:
[root@gmhpux02:/root]
# bdf /var/adm/crash
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lv_crash 5357568 2266637 2897770 44% /var/adm/crash
4. Obtain the current size of the Logical Volume (Mbytes)
# lvdisplay /dev/volumegroup/logicalvolume
Example:
[root@gmhpux02:/root]
# lvdisplay /dev/vg00/lv_crash
--- Logical volumes ---
LV Name /dev/vg00/lv_crash
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 5232
Current LE 327
Allocated PE 654
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
5. Our current size is 5232 Mbytes. Let us say that we will extend the filesystem by 100 Mbytes. Get the sum of the current size and the size to be added. This will add to 5332 Mbytes. Take note of this.
6. Adjust the size of the Logical Volume.
# lvextend -L new_size_in_mbytes
Example:
[root@gmhpux02:/root]
# lvextend -L 5332 /dev/vg00/lv_crash
Logical volume "/dev/vg00/lv_crash" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
7. Adjust the size of the Filesystem
# fsadm -b new_sizem /mountpoint
Example:
[root@gmhpux02:/root]
# fsadm -b 5332m /dev/vg00/rlv_crash
fsadm: /etc/default/fs is used for determining the file system type
UX:vxfs fsadm: INFO: V-3-23585: /dev/vg00/rlv_crash is currently 524288 sectors - size will be increased
8. Verify new size of the filesystem
# bdf /mountpoint
Regards Martin Rønde Andersen .. mra at miracleas.dk
Online create and extend af HPUX LVM , Eva SAN LUN,
HPUX 11.31
Prerequisites check for OnlineJFS
# swlist -l product | grep -i JFS
AONLINEJFS B.05.00.02 OnlineJFS Integration Product
JFS B.11.31 Base VxFS File System 4.1 for HP-UX
OnlineJFS01 5.0.1 Online features of the VxFS File System
Find newly allocated SAN disk...
MyHost # ioscan -funCdisk > /tmp/online-disk1.txt
MyHost # ioscan -fnCdisk > /tmp/online-disk2.txt
MyHost # insf -e
insf: Installing special files f ......
MyHost # diff /tmp/online-disk1.txt /tmp/online-disk2.txt
14a15,16
> disk 35 0/0/0/5/0/0/0.31.0.0.0.7.1 sdisk CLAIMED DEVICE HP HSV450
> /dev/dsk/c3t7d1 /dev/rdsk/c3t7d1
20a23,24
> disk 34 0/0/0/5/0/0/0.31.8.0.0.7.1 sdisk CLAIMED DEVICE HP HSV450
> /dev/dsk/c5t7d1 /dev/rdsk/c5t7d1
38a43,44
> disk 37 0/0/0/5/0/0/1.32.0.0.0.7.1 sdisk CLAIMED DEVICE HP HSV450
> /dev/dsk/c11t7d1 /dev/rdsk/c11t7d1
44a51,52
> disk 36 0/0/0/5/0/0/1.32.8.0.0.7.1 sdisk CLAIMED DEVICE HP HSV450
> /dev/dsk/c13t7d1 /dev/rdsk/c13t7d1
MyHost # ioscan -m dsf | grep t7d1
/dev/rdisk/disk38 /dev/rdsk/c5t7d1
/dev/rdsk/c3t7d1
/dev/rdsk/c13t7d1
/dev/rdsk/c11t7d1
MyHost # scsimgr lun_map | egrep '(disk|WWID)'
World Wide Identifier(WWID) =
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk2
World Wide Identifier(WWID) = 0x50000393482bc0fc
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk3
World Wide Identifier(WWID) = 0x50000393482bbdd4
World Wide Identifier(WWID) = 0x50014380025d07e0
World Wide Identifier(WWID) = 0x50014380025d0360
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk28
World Wide Identifier(WWID) = 0x6001438005deca110000400006740000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk30
World Wide Identifier(WWID) = 0x6001438005deca110000400006780000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk31
World Wide Identifier(WWID) = 0x6001438005deca1300005000053c0000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk32
World Wide Identifier(WWID) = 0x6001438005deca130000500005400000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk29
World Wide Identifier(WWID) = 0x6001438005deca1100004000069d0000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk33
World Wide Identifier(WWID) = 0x6001438005deca130000500005580000
LUN PATH INFORMATION FOR LUN : /dev/rdisk/disk38
World Wide Identifier(WWID) = 0x6001438005deca110000400006a40000
### CHECK WWID for new disk with SAN documentation from Storage Manager:
MyHost # pvcreate /dev/rdisk/disk38
Physical volume "/dev/rdisk/disk38" has been successfully created.
MyHost # vgcreate -s 32 vgtest /dev/disk/disk38
Increased the number of physical extents per physical volume to 1599.
Volume group "/dev/vgtest" has been successfully created.
Volume Group configuration for /dev/vgtest has been saved in /etc/lvmconf/vgtest.conf
MyHost # lvcreate -l 1599 -n testvol vgtest
Logical volume "/dev/vgtest/testvol" has been successfully created with
character device "/dev/vgtest/rtestvol".
Logical volume "/dev/vgtest/testvol" has been successfully extended.
Volume Group configuration for /dev/vgtest has been saved in /etc/lvmconf/vgtest.conf
MyHost # newfs -F vxfs /dev/vgtest/rtestvol
version 7 layout
52396032 sectors, 52396032 blocks of size 1024, log size 65536 blocks
largefiles supported
MyHost # mkdir /mnt/test
MyHost # mount /dev/vgtest/testvol /mnt/test
MyHost # bdf /mnt/test
Filesystem kbytes used avail %used Mounted on
/dev/vgtest/testvol
52396032 79486 49046769 0% /mnt/test
MyHost # vgmodify -E -ao vgtest
Current Volume Group settings:
Max LV 255
Max PV 16
Max PE per PV 1599
PE Size (Mbytes) 32
VGRA Size (Kbytes) 272
New configuration requires max_pes are increased from 1599 to 6652
The current and new Volume Group parameters differ.
"/dev/rdisk/disk38" size changed from 52428800 to 62914560kb
An update to the Volume Group IS required
New Volume Group settings:
Max LV 255
Max PV 16
Max PE per PV 6652
PE Size (Mbytes) 32
VGRA Size (Kbytes) 896
New Volume Group configuration for "vgtest" has been saved in "/etc/lvmconf/vgtest.conf"
Old Volume Group configuration for "vgtest" has been saved in "/etc/lvmconf/vgtest.conf.old"
Starting the modification by writing to all Physical Volumes
Applying the configuration to all Physical Volumes from "/etc/lvmconf/vgtest.conf"
Completed the modification process.
New Volume Group configuration for "vgtest" has been saved in "/etc/lvmconf/vgtest.conf.old"
Volume group "vgtest" has been successfully changed.
MyHost # vgdisplay vgtest
--- Volume groups ---
VG Name /dev/vgtest
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 6652
VGDA 2
PE Size (Mbytes) 32
Total PE 1919
Alloc PE 1599
Free PE 320
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 1.0
VG Max Size 3326g
VG Max Extents 106432
MyHost # lvextend -l 1919 /dev/vgtest/testvol
Logical volume "/dev/vgtest/testvol" has been successfully extended.
Volume Group configuration for /dev/vgtest has been saved in /etc/lvmconf/vgtest.conf
### Calculate new size in megabytes = extends x extendsize
# bc
1919*32
61408
MyHost # fsadm -b 61408m /mnt/test
fsadm: /etc/default/fs is used for determining the file system type
UX:vxfs fsadm: INFO: V-3-25942: /dev/vgtest/rtestvol size increased from 52396032 sectors to 62881792 sectors
MyHost # bdf /mnt/test
Filesystem kbytes used avail %used Mounted on
/dev/vgtest/testvol
62881792 82056 58874760 0% /mnt/test
CLEANUP:
MyHost # lvremove /dev/vgtest/testvol
The logical volume "/dev/vgtest/testvol" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vgtest/testvol" has been successfully removed.
Volume Group configuration for /dev/vgtest has been saved in /etc/lvmconf/vgtest.conf
MyHost # vgremove /dev/vgtest
Volume group "/dev/vgtest" has been successfully removed.
MyHost # pvremove /dev/rdisk/disk38
The physical volume associated with "/dev/rdisk/disk38" has been removed.