LVM on the HP−UX Platform

SEAGATE_ST12400N_swap|SEAGATE_ST12400N_150MB:\ :150 MB reserved for swap boot:ns41:nt19:nc2423:\ :s01887517:b08192:f01024:\ :se512:rm5400: ..... ..... Once disk partitioning and filesystem creation are performed, the filesystem must be mounted. For future system booting, the filesystem configuration file etcvfstab, etcfstab, or on HP−UX 9.0x as etcchecklist should also be updated to add the new entries. In this specific case, on HP−UX 9.0x, the configuration file before the update was: cat etcchecklist devdskc201d6s0 hfs rw,quota 0 1 0 devdskc201d2s0 cdrom cdfs ro,suid, 0 0 0 devdskc201d6s0 ...... swap pri = 0 0 0 0 … and after the update: cat etcchecklist devdskc201d6s0 hfs rw,quota 0 1 0 devdskc201d2s0 cdrom cdfs ro,suid, 0 0 0 devdskc201d6s0 ..... swap pri = 0 0 0 0 devdskc201d5s0 disk 2 hfs rw,suid, 0 2 0 devdskc201d5s0 ..... swap end,pri = 1 0 0 0

27.2 Logical Volume Manager Case Study

Case description: The system includes 12 disk units divided between two SCSI controllers. The operating system and the logical volume manager are installed on the root volume disk the first disk of the dozen. Our task is to mirror the root and swap volumes and to create new mirrored volumevolumes among the remaining disks. The RAID0+1 is preferable. We will show the procedure for two UNIX flavors: HP−UX 10.20 and Solaris 2.6. In both cases, the procedure will be managed from the command line. Both flavors, however, include higher−level administration tools: HP−UX SAM and Solaris GUI Volume Administrator V×VA. Notice: All included data about special device files, volume and group names, and sizes, are system dependent.

27.2.1 LVM on the HP−UX Platform

LVM is a standard part of the OS distribution for HP−UX 9.04, HP−UX 10.x, and future releases. The regular installation procedure implements LVM, and the OS is installed on volumes. Let us suppose the following OS layout upon the installation this is, by the way, default: Volume Volume Group Mount Directory Description lvol1 vg00 stand kernel lvol2 vg00 swap lvol3 vg00 root FS To mirror the root disk to the second disk identified by devdskc2t5d0 and devrdsk c2t5d0: 687 pvcreate −B devrdskc2t5d0 Add the physical volume to the root volume group vg00: vgextend devvg00 devdskc2t5d0 • Place the boot utilities into the disk boot area make the disk bootable: mkboot devrdskc2t5d0 • Add the AUTO file into the disk boot LIF area: mkboot −a hpux 52.5.0;0 standvmunix devrdskc2t5d0 • Mirror logical volumes incl. swap: lvextend −m 1 devvg00lvol1 devdskc2t5d0 lvextend −m 1 devvg00lvol2 devdskc2t5d0 lvextend −m 1 devvg00lvol3 devdskc2t5d0 • Verify the boot information: lvboot −v • The ten remaining disks will be placed into the volume group vg01, and new logical volumes will be created. Please note that HP−UX LVM supports RAID0 striping or RAID1 mirroring only. RAID0+1 is not supported; however, there is a tricky way to accomplish RAID0 +1 which is not recommended. The implementation of striping and mirroring separately follows: Create initialize physical volume for each of the ten disks: pvcreate devrdskc0t1d0 pvcreate devrdskc0t2d0 ... pvcreate devrdskc1t4d0 pvcreate devrdskc1t5d0 • Create the special device file for the volume group vg01: mkdir devvg01 chmod 755 devvg01 mknod devvg01group c 64 0×010000 chmod 640 devvg01group • Create the volume group vg01: vgcreate devvg01 devdskc0t1d0 vgextend devvg01 devdskc0t2d0 ... vgextend devvg01 devdskc1t4d0 vgextend devvg01 devdskc1t5d0 • Check the created volume group: vgdisplay −v devvg01 • To make the 3.8 GB mirrored logical volume lvol4 supposing 2 GB disks: Create the 1.9 GB logical volume lvol4 on the first available disk devdsk c0t0d0: lvcreate −n lvol4 −M n −C y −L 1900 devvg01 • Increase the logical volume size of the next disk devdskc0t2d0: • 688 Mirror to disks devdskc1t1d0 and devdskc1t2d0: lvextend −m 1 devvg01lvol4 devdskc1t1d0 devdskc1t2d0 • Check physical volume layout: pvdisplay −v devdskc0t1d0 pvdisplay −v devdskc0t2d0 pvdisplay −v devdskc1t1d0 pvdisplay −v devdskc1t2d0 • To make a journaled VxFS filesystem: Create VxFS filesystem: newfs −F vxfs devvg01rvol4 • Mount the new filesystem: mkdir mntvol4 mount devvg01lvol4 mntvol4 • Modify the etcfstab file; add the entry: devvg01lvol4 mntvol4 vxfs delaylog, datainlog,rw,suid 0 2 • To make 4 GB striped logical volume lvol5 across the six remaining disks: Create the logical volume LVM will select all disks: lvcreate −n lvol5 −i 6 −I 4 devvg01 • Check physical volume layout: pvdisplay −v devdskc0t3d0 pvdisplay −v devdskc0t4d0 pvdisplay −v devdskc0t5d0 pvdisplay −v devdskc1t3d0 pvdisplay −v devdskc1t4d0 pvdisplay −v devdskc1t5d0 • Create VxFS filesystem: newfs −F vxfs devvg01rvol5 • Mount the new filesystem: mkdir mntvol5 mount devvg01lvol5 mntvol5 • Modify the etcfstab file; add the entry: devvg01lvol5 mntvol5 vxfs delaylog, datainlog,rw,suid 0 3 • The remaining disk space can be managed in a similar way.

27.2.2 LVM on the Solaris Platform