How to mirror disk at HP-UX - 1


If we want mirror only 1 Volume Group.
Show your disk layout partition
# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE _NEC DVD+-RW ND-6650A
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GST3146855LC
/dev/dsk/c2t0d0 /dev/dsk/c2t0d0s2 /dev/rdsk/c2t0d0 /dev/rdsk/c2t0d0s2
/dev/dsk/c2t0d0s1 /dev/dsk/c2t0d0s3 /dev/rdsk/c2t0d0s1 /dev/rdsk/c2t0d0s3
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 146 GST3146855LC
/dev/dsk/c2t1d0 /dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s1 /dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s1 /dev/rdsk/c2t1d0s3
disk 3 0/3/1/0.0.0 sdisk CLAIMED DEVICE COMPAQ BF1468B26B
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 4 0/3/1/0.1.0 sdisk CLAIMED DEVICE COMPAQ BF1468B26B
/dev/dsk/c4t1d0 /dev/rdsk/c4t1d0

We will use 3rd and 4th disks.
Show disk capacity in MB
# diskinfo -b /dev/rdsk/c4t0d0 | awk '{print $1 / (1024)}'
140014
# diskinfo -b /dev/rdsk/c4t1d0 | awk '{print $1 / (1024)}'
140014

Create physical volume for LVM on both disks
# pvcreate -f /dev/rdsk/c4t0d0
# pvcreate -f /dev/rdsk/c4t1d0

Creating vg01 partition
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
( 0x010000 is the magic number and this number has last 4 digits as 0000. The first two digits have to be unique and the maximum limit is 10 )

# vgcreate /dev/vg01 /dev/dsk/c4t0d0 /dev/dsk/c4t1d0
( use 'vgcreate -s 8 /dev/vg01 /dev/dsk/c4t0d0 /dev/dsk/c4t1d0' if there is an error about max_pvs )

Create logical volume on both disks
# lvcreate -n datalvol vg01
# lvextend -l 1 /dev/vg01/datalvol /dev/dsk/c4t0d0
# lvextend -m 1 /dev/vg01/datalvol /dev/dsk/c4t1d0
# lvextend -L 140000 /dev/vg01/datalvol

Create file system for logical volume that you created
# newfs -F vxfs -o largefiles /dev/vg01/rdatalvol

Mount logical volume
# mkdir /data
# echo "/dev/vg01/datalvol /data vxfs delaylog 0 2" >> /etc/fstab
# mount /dev/vg01/datalvol /data

Thanks to Leo Sutinen (HP Finland) for tutoring me privately.

Popular posts from this blog

Howto configure boot device order on ILOM

Installing Depot files on HP-UX 11.23 ia64

SAN Switch Config Command