6.5 Forward Compatibility with Newer, Larger Capacity Disk Drives LVM supports just about any disk drive you can throw at it. You can mix and match disk drives within a volume group . The only exception is if you have old (and probably crumbling) HP-IB disks that need to be left on their own (to mumble gently to themselves ) in their own volume group. The wisdom of mixing disk types in a striping or mirroring configuration has to be challenged because we really want similar performance from our disks in such a situation in order to avoid a bottleneck with a single disk drive. However, LVM has at its core the well-worn UNIX ethos of "You know what you're doing, don't you?!" You can mix and match as much as you please but it's on your own head. There is one exception well it's sort of an exception . It's when you add new disk drives to your system. What I am thinking about here is the ever-expanding nature of disk space in the market place. When I started working on UNIX, 500MB was considered a substantial amount of storage for a server! These days, you need to shoehorn HP-UX into a 4GB root disk. Disk drives of 73GB-180GB are the norm in many circles. This expanding repertoire of disks is not necessarily a problem for LVM except when you come to expand an existing volume group. Take this example where I have a single disk in my volume group: root@hpeos003[] diskinfo /dev/rdsk/c3t15d0 SCSI describe of /dev/rdsk/c3t15d0: vendor: HP 36.4G product id: ST336753LC type: direct access size: 35566480 Kbytes bytes per sector: 512 root@hpeos003[] root@hpeos003[] mkdir /dev/vgSAP root@hpeos003[] mknod /dev/vgSAP/group c 64 0x020000 root@hpeos003[] vgcreate /dev/vgSAP /dev/dsk/c3t15d0 Increased the number of physical extents per physical volume to 8683. vgcreate: Volume group "/dev/vgSAP" could not be created: The path does not specify a valid physical volume. root@hpeos003[] vgdisplay -v /dev/vgSAP --- Volume groups --- VG Name /dev/vgSAP VG Write Access read/write VG Status available Max LV 255 Cur LV 0 Open LV 0 Max PV 16 Cur PV 1 Act PV 1 Max PE per PV 8683 VGDA 2 PE Size (Mbytes) 4 Total PE 8681 Alloc PE 0 Free PE 8681 Total PVG 0 Total Spare PVs 0 Total Spare PVs in use 0 --- Physical volumes --- PV Name /dev/dsk/c3t15d0 PV Status available Total PE 8681 Free PE 8681 Autoswitch On root@hpeos003[] In this example, we can see that vgcreate has expanded the number of physical extents to accommodate the size of the physical volume (35GB in this case). Later in the life of this system, we buy more disk drives (which are probably bigger) and want to expand the capacity of this volume group. This is simple; we just extend the volume group using the vgextend command. Yes, it is that simple, but what we have to remember is that the extent map created in the VGRA is sized based on the size of the biggest disk when the volume group was created. Here we are trying to add a 73GB disk to this volume group. root@hpeos003[] diskinfo /dev/rdsk/c4t12d0 SCSI describe of /dev/rdsk/c4t12d0: vendor: HP 73.4G product id: ST373307LC type: direct access size: 71687369 Kbytes bytes per sector: 512 root@hpeos003[] vgextend /dev/vgSAP /dev/dsk/c4t12d0 vgextend: Warning: Max_PE_per_PV for the volume group (8683) too small for this PV (17501). Using only 8683 PEs from this physical volume . Volume group "/dev/vgSAP" has been successfully extended. Volume Group configuration for /dev/vgSAP has been saved in /etc/lvmconf/vgSAP.conf root@hpeos003[] root@hpeos003[] vgdisplay -v /dev/vgSAP --- Volume groups --- VG Name /dev/vgSAP VG Write Access read/write VG Status available Max LV 255 Cur LV 0 Open LV 0 Max PV 16 Cur PV 2 Act PV 2 Max PE per PV 8683 VGDA 4 PE Size (Mbytes) 4 Total PE 17364 Alloc PE 0 Free PE 17364 Total PVG 0 Total Spare PVs 0 Total Spare PVs in use 0 --- Physical volumes --- PV Name /dev/dsk/c3t15d0 PV Status available Total PE 8681 Free PE 8681 Autoswitch On PV Name /dev/dsk/c4t12d0 PV Status available Total PE 8683 Free PE 8683 Autoswitch On root@hpeos003[] As you can see, vgextend can only create an extent map on the new disk, which is as large as the original extent map i.e., to accommodate a 35GB of disk space. This means we have two choices (1) we accept this compromise for the time being, or (2) we create a new volume group with the new disk and then go through a process of creating new volumes and copying the data from the old volumes to the new ones. There is an off-the-wall solution to this. When you create a volume group your create it an extent map capable of the biggest disk you will ever buy. This is difficult for two reasons: (1) you will need a crystal ball to look into the future to predict the biggest disk, ever (2) there is a finite size to the VGRA which means you may have to tweak the extent size as well as the MAX PV per PV parameter (-e <size> ) to vgcreate . Here's an example where I think the biggest disk, ever will be 180GB (short-sighted or what): root@hpeos003[] vgcreate -e 46080 /dev/vgSAP /dev/dsk/c3t15d0 vgcreate: Volume group "/dev/vgSAP" could not be created: VGRA for the disk is too big for the specified parameters. Increase the extent size or decrease max_PVs/max_LVs and try again. root@hpeos003[] I warned you about the size of the VGRA. Now I must increase the extent size. If I want to implement Distributed volumes, this will have a direct impact on their performance ”so be it. root@hpeos003[] vgcreate -s 8 -e 46080 /dev/vgSAP /dev/dsk/c3t15d0 Volume group "/dev/vgSAP" has been successfully created. Volume Group configuration for /dev/vgSAP has been saved in /etc/lvmconf/vgSAP.conf root@hpeos003[] root@hpeos003[] vgdisplay -v /dev/vgSAP --- Volume groups --- VG Name /dev/vgSAP VG Write Access read/write VG Status available Max LV 255 Cur LV 0 Open LV 0 Max PV 16 Cur PV 1 Act PV 1 Max PE per PV 46080 VGDA 2 PE Size (Mbytes) 8 Total PE 4340 Alloc PE 0 Free PE 4340 Total PVG 0 Total Spare PVs 0 Total Spare PVs in use 0 --- Physical volumes --- PV Name /dev/dsk/c3t15d0 PV Status available Total PE 4340 Free PE 4340 Autoswitch On root@hpeos003[] root@hpeos003[] vgextend /dev/vgSAP /dev/dsk/c4t12d0 Volume group "/dev/vgSAP" has been successfully extended. Volume Group configuration for /dev/vgSAP has been saved in /etc/lvmconf/vgSAP.conf root@hpeos003[] root@hpeos003[] vgdisplay -v /dev/vgSAP --- Volume groups --- VG Name /dev/vgSAP VG Write Access read/write VG Status available Max LV 255 Cur LV 0 Open LV 0 Max PV 16 Cur PV 2 Act PV 2 Max PE per PV 46080 VGDA 4 PE Size (Mbytes) 8 Total PE 13089 Alloc PE 0 Free PE 13089 Total PVG 0 Total Spare PVs 0 Total Spare PVs in use 0 --- Physical volumes --- PV Name /dev/dsk/c3t15d0 PV Status available Total PE 4340 Free PE 4340 Autoswitch On PV Name /dev/dsk/c4t12d0 PV Status available Total PE 8749 Free PE 8749 Autoswitch On root@hpeos003[] This is a tricky configuration to set up unless you are clairvoyant! |