Logical Volume Manager — Solaris Flavor

lvdisplay devvg01lvol1 to check the newly created LV If there are more LVs, this step should be repeated: lvcreate −L 500 −n lvol2 devvg01 500 MB LV named lvol2 lvcreate −L 200 −n lvol3 devvg01 ....... 200 MB LV named lvol3 Any operation typical for the disk partition is also allowed on the LV. To use an LV to hold a filesystem, the corresponding filesystem must be created and mounted: newfs devvg01rlvol1 mkdir mnt_dir1 mount devvg01lvol1 mnt_dir1 4. HP−UX flavored LVM is discussed in greater detail in the case study in Chapter 27.

6.3.3 Logical Volume Manager — Solaris Flavor

A powerful, versatile, and up−to−date volume manager came with Sun Enterprise Volume Manager — VxVM on the Solaris 2.x platform. The original VERITAS Volume Manager is licensed to Sun Microsystems and is delivered as either optional or standard software depending on the system configuration. VxVMbuilds virtual devices called volumes on top of physical disks in an extraordinarily flexible way. Volumes are composed of other VM objects that can be manipulated to make different volume configurations: to optimize performance, to provide redundancy, and to perform backup. To achieve this goal, VxVM introduced some new virtual objects. VxVM manages the following physical and logical objects: Physical disk and partition, in the standard UNIX sense. • VM disk — assigned to one or more physical partitions or more precisely, to one or more physical partitions under VxVM control. • Disk group — a collection of VM disks that share a common configuration. • Subdisk — a basic logical unit to allocate disk space; a set of contiguous disk blocks. VM disks can be divided into one or more subdisks similar to the division of physical disks into partitions. • Plexe — a new logical entity that consists of one or more subdisks, organized in way that can provide concatenation, striping, mirroring, or RAID−5; plexes are also referred to as mirrors. • 160 The relationship between VxVM objects is presented in Figure 6.7. Figure 6.7: Relationship between VxVM objects. Let us try to establish a functional relationship between VxVM objects and the traditional UNIX ones: VxVM Standard UNIX Approach Physical disk Disk as an accessible physical unit Partition Disk partition VM disk None — assigned partitions Disk group Disk as a storage space Subdisk None — disk blocks Plexe None Volume Partition VxVM provides several kinds of user support tools to manage disk space. First, a suite of versatile VM commands is provided to accomplish any VM request. Second, a character−based, user friendly administration tool vxdiskadm enables an easy−to−use interface to manage disks. And finally, an attractive GUI visual administrator vxva presents a drag−and−drop tool for handling physical and logical entities. The usual procedure to manage attached physical disks is: 161 vxdisksetup −i disk_device_file Create a disk group with the first disk in it: vxdg init dg_name vmdisk_name= disk_device_file 2. Extend a disk group with other disks: vxdg −g dg_name adddisk vmdisk_name =disk_device_file 3. Create a volume within a disk group including a volume layout: vxassist −g dg_name −U fsgen make volume_name size layout = options disk_device_files 4. Mirror a created volume if requested: vxassist −g dg_name mirror volume_name layout = options disk_device_files 5. Create a filesystem in the volume and mount it into a selected directory: newfs devvxrdskdg _ namevolume_name mkdir mount_dir mount devvxrdskdg _ namevolume_name mount_dir 6. VxVM fully supports all of the steps necessary to accomplish the requested task. At the very end, the filesystems have to be created in the volumes and then mounted to be used. The same task can be accomplished in more steps by creating subdisks and plexes separately. This has to be done if there are some special requests. VxVM pays special attention to the boot disk and the root and swap partitions. VxVM is coming after UNIX installation, and the initial disk configuration is based on the traditional UNIX approach. Putting blank disks under VM control is much easier than to handle preexisting filesystems, especially crucial ones like the root filesystem and the swap partition also usr and var, if they were created as separate filesystems. The special procedure to put preexisting filesystems under VM control is known as encapsulation, and VxVM also fully supports its implementation. VxVM offers needed commands to deal with introduced entities: vxdg Handle disks and disk groups with a number of options subcommands vxassist Handle disks with a number of options subcommands vxdisksetup Initialize physical disks vxmake Create VM objects vxplex Handle plexes vxsd Perform subdisk operations vxprint Print display VM information vxtrace Trace kernel VM related activities vxrecover Recover VM entities vxinfo Identify volumes vxstat Print volume statistics vxvol Handle volumes Some of the listed commands are utilities with many options, or rather subcommands, to fulfill 162 Solaris−flavored LVM is also discussed in greater detail in the case study in Chapter 27.

6.3.4 Redundant Array of Inexpensive Disks RAID