Site icon Free Linux Tutorials

Create and Extend Logical Volume on HP-UX

HP-UX tutorial on a Linux website? why not…

To take a break, I decided to post a tutorial here on Creating and Extending LV on HP-UX. It’s better for me to post it here so it will serve my guide once I get my hands again on HP-UX servers. This is the one I used when my colleague asked me  to check if I can find a way to increase the Filesystem  of these servers.  Here it is:

To create the LV on HP-UX server

1.verify first if JFS is online (if online, no need to mount/unmount so no downtime)
# swlist -l product | grep -i online
OnlineJFS01           4.1.008        Online features of the VxFS File System

2. verify if there’s avail space
#bdf
#vgdisplay
e.g.
PE Size (Mbytes)            32
Total PE                    8692
Alloc PE                    4618
Free PE                     4074

FreePE X PE Size = 4074  X 32 = 130GB

3. To create let say a 2GB
#lvcreate -L 2048 -n lv_back /dev/vg00
Logical volume “/dev/vg00/lv_back” has been successfully created with
character device “/dev/vg00/rlv_back”.
Logical volume “/dev/vg00/lv_back” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

4. create filesystem,
# newfs -F vxfs /dev/vg00/rlv_back
version 6 layout
2097152 sectors, 2097152 blocks of size 1024, log size 16384 blocks
largefiles supported

5.create dir and mountpoint
#mkdir /backup
#mount /dev/vg00/lv_back /backup

6.check the new LV
#bdf

To enable mirroring

1. verify status
# vgdisplay -v | grep PV

2. check LV
#lvdisplay -v /dev/vg00/lv_back

00125 /dev/dsk/c2t1d0s2       02242 current
00126 /dev/dsk/c2t1d0s2       02243 current

only writing to c2t1d0s2

compare to others,

2. check LV
#lvdisplay -v /dev/vg00/lv_vol03
LE    PV1                     PE1   Status 1 PV2                     PE2   Status 2
00000 /dev/dsk/c2t1d0s2       00312 current  /dev/dsk/c2t0d0s2       00312 current

writing on both c2t1d0s2 and c2t0d0s2

3. to mirror

# lvextend -m 1 /dev/vg00/lv_back /dev/dsk/c2t0d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ….

Extend LV on HP-UX server
Since HP-UX server JFS is online, then we use this procedure

1. example, to extend 2G to 20GB
#lvextend -L 20480 /dev/vg00/lv_back
# fsadm -F vxfs -b 20480M /backup

2.verify
#bdf

If server has no online JFS, procedure as follows:
root@darwin-ux [/]
# umount /backup
root@darwin-ux [/]
# lvextend -L 20480 /dev/vg00/lv_back
Logical volume “/dev/vg00/lv_back” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root@darwin-ux [/]
# extendfs -F vxfs /dev/vg00/rlv_back
root@darwin-ux [/]
# mount /dev/vg00/lv_back /backup
root@darwin-ux [/]
# bdf /backup
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lv_back  4194304   18118 3915182    0% /backup
root@darwin-ux [/]

Finally, put on /etc/fstab , so it will auto mount even after reboot

add:
/dev/vg00/lv_back /backup vxfs delaylog 0 2

 

Enjoy 🙂

Exit mobile version