Notes on using logical volumes and the Logical Volume Manager (LVM) Introduction This is a summary of experiences and information about logical volumes as implemented on Warp Server for e-business, and on later fix levels of Warp 4; also on eComStation. I've been using logical volumes for a while and have been through quite a few scenarios. The term LVM strictly applies to the Logical Volume Manager (the replacement for FDISK) but it is commonly used as a name for the whole 'system' that implements logical volumes. Rationale The first thing many people ask is: why do it? What does LVM give me? The main features are: The ability to assign drive letters as required, rather than be dictated to by the rather baroque historical 'rules'. The ability to have a single drive letter span multiple disks. Many people have been in the situation where they have enough space to do a particular job, but it is spread across multiple physical disks. In this case, a simple repartition doesn't solve the problem. The ability to add space to a 'drive' (specified by a drive letter, not a physical drive) dynamically. Like it or not, LVM is with us (or will be soon). Learn to love it. Basic concepts The first thing to understand is that LVM and JFS are completely separate issues. In principle, you don't need an LVM system to use JFS, although I personally haven't tried to do that. Now that we have the FP14 kernel, I suspect one could. So, forget JFS for now. HPFS is probably what you want, especially as you can't boot from a JFS volume. The point about the LVM system is that it separates the concepts of 'partitions' and 'volumes'. A partition is a chunk of disk, and a volume corresponds pretty well to a drive letter (which is obvious if you think of VOL C: as a meaningful command). These two are the same on non-LVM systems, of course. With LVM, it is possible for a volume to be spread over several partitions. Moreover, those partitions don't have to be on the same disk. Additionally, you can add new partitions to the volume post facto to increase the size of the volume. Currently, multi-partition volumes are possible only with JFS (that's the only real connection between LVM and JFS). However, JFS volumes are not currently bootable. Installation So, what happens when you first install an LVM-aware system? It runs a utility (VCU, the Volume Conversion Utility; you'll see it in the root directory of the installation CD) to convert all volumes so that they are marked as single-partition volumes (which is what they were, anyway). The conversion is benign and backwards compatible. The partition tables remain the same (you are not, after all, altering partitions in any way, only volumes). However, an unused sector on each physical disk (actually, the last sector on the first track) is filled in with information indicating the volumes to which each partition belongs, and sundry other related information. Note that this is not going to make any difference to other systems (Warp 4, 3, 2, 1, Windows, DOS, whatever) as they'll see exactly the same partition table and partitions they always did. Boot Manager If changing to an LVM system, it is probably wise to re-install Boot Manager. That is, use LVM to delete any existing Boot Manager, then install it again (thus updating the copy on your hard disk to the version embedded in LVM). It is reasonable to surmise that this is a newer copy that is more LVM-aware. Operation When an LVM-aware system loads, it loads the LVM module. OS2LVM.DMD, which sits above the base disk access module (OS2DASD.DMD)and presents the 'volumes' to the layers above it (the FAT file system manager, also HPFS.IFS and JFS.IFS). In the immediately converted system, the drive letters will be the same as they were before conversion. So, what are 'compatibility' volumes? Simply, they are volumes that consist of only one partition (the vast majority). Once you have a multi-partition volume, other systems won't be able to understand that volume (in any case, it'll be a JFS volume since that's the only file system that supports multi-partition volumes). The nice thing about an LVM system is that any volume (not partition) can have a particular drive letter assigned to it, and it 'sticks'. It's written in the information sector on the first track of each physical disk, as mentioned above. Of course, other systems won't 'see' that information, so if you have a mixed boot system it's best not to assign drive letters explicitly or you'll get confused when you boot the non-LVM systems (more about that below). You'll notice that you can't reassign CD drive letters; this fits, of course, because there is nowhere, on the read-only medium, to store the assigned drive letter! RESERVEDRIVELETTER still works, though. I personally prefer the full screen non-GUI LVM utility. The GUI is supposed to be buggy and, being a Java app, it's a bit sluggish too. The LVM utility LVM provides you with two 'views' of the system: 1.A logical (volume) view (which shows drive letters) 2.A physical (partition) view (which shows disks and partitions) The various user-definable names assigned are a bit confusing; remember that one set of names defines volume labels (as in VOL x:), and the other set are menu names for Boot Manager. When you get asked if you want to make a partition bootable (or unbootable), all it's really asking is if you want it on the Boot Manager menu. That's how you manipulate the BM menu using LVM; there is no specific 'add to Boot Manager' menu item. You may also be concerned that the 'install Boot Manager' menu item doesn't appear to do anything; that's because Boot Manager is a partition, not a volume, and it is shown only when you display the physical (partition) view by toggling the F5 key. Running LVM and non-LVM systems side by side It is perfectly possible to run (say) Warp 4 and Warp Server for e-business on the same system, using Boot Manager to select between them. However, some caution is needed to ensure that drive letters stay the same on both systems. Note the following: Don't reassign drive letters when using LVM. The assignments you make may be very convenient, but they won't 'stick' when booting Warp 4. When LVM creates a volume, and assigns a partition from free space, it does so by default from the end of free space. This is undesirable (see below for the reason). So, it's best to toggle F5 to switch to the physical view, then create the partition explicitly. If you do this, you get a chance to specify that the partition is allocated from the start of the free space. Then toggle F5 to return to the logical view, and create your volume using the existing partition (just created). Why is it a problem if partitions are created at the end of free space? Well, Warp 4 seems to letter drives (partitions) starting at the beginning of free space. So, if you let LVM allocate partitions for (say) drives D, E and F, you might find that Warp 4 sees them as F, E and D respectively. Repartitioning If you use PartitionMagic (for example) on a volume (which would have to be a compatibility one), the volume disappears from LVM! This causes consternation, panic and much more! Here's a typical scenario. You boot an LVM aware system and set up volumes. You install stuff and then want to resize, say, volume F:. So you boot from diskettes and run PartitionMagic to do that. Let's also assume that F: is on the Boot Manager menu. Reboot, and Boot Manager has an entry for F: that says something like: '--> LVM', which means quite simply, 'run LVM'. Boot a maintenance system or the install diskettes. (If using the install diskettes, LVM is not included on them; you need to insert the installation CD and change to the \OS2IMAGE\DISK_6 directory which contains all necessary files including LVM.EXE.) You'll see that F: has vanished off the map! Panic not. You'll be able to see the partition that really is F:, but it will have lost the information in the spare sector (well, it's probably there, but wrong and inconsistent and therefore ignored). Ask LVM to create a new volume, and when it asks if it's to use an existing partition, say yes and then tell it the partition that used to be drive F:. Assign the right drive letter if LVM doesn't. Reboot, and you're back in business. I use PartitionMagic with impunity on LVM systems now. I tend to alter one partition at a time, which takes a bit longer but stops me getting temporarily confused about which anonymous partition is which volume. I hope this is useful; feedback and other information is welcome. Last Updated: 9th November 2000 ¸ 2000 by Bob Eager, Tavi Systems **************************************************************************************8 -------------------------------------------------------------- VOLUME MANAGEMENT "Volume management" is the system by which eComStation makes use of hard disk drives. Traditionally, before the storage space on a hard disk drive can be used, that space must be made available by defining one or more allocation units called "partitions". This process was introduced by IBM Corporation many years ago, when the PC was first designed. Internally, the computer sees partitions as simple allocation units of raw disk space, defined by a physical geometry. In order to make partitions useful to the user, most operating systems give each partition a designator, typically in the form of a "drive letter" (such as 'C:', 'D:', or 'E:'). These appear to the user as logically separate drives, even though they may exist on the same physical disk drive. These "logical drives" are then formatted for use with a file system. (A file system is the storage and indexing system by which files and related data are saved on disk.) Traditionally, then, a partition is two things. From the point of view of the computer and operating system, it is a physical disk allocation unit. But from the user's perspective, it is a logical drive (with a drive letter and file system). eComStation's system of volume management changes this. The two different perspectives (physical units and logical drives) have been conceptually separated. Partitions are now considered purely in terms of how the computer sees them: as physical disk allocation units. In this sense, they are unchanged from the traditional use. The sense of a partition as a logical drive, however, has been eliminated, and the term "volume" introduced instead. A volume is a logical drive. In other words, it has a "drive letter", an optional volume label, and a file system. In most cases, this separation is simply a matter of new terminology. The simplest (and most common) type of volume is exactly the same thing as a partition, in the traditional sense. This is called a "compatibility volume". When eComStation is first installed, any partitions which already exist on the system are automatically treated as compatibility volumes. However, by abstracting the concept of a "volume", logical drives are no longer forced to adhere to a one-to-one relationship with partitions. In other words, it is possible to create volumes which consist of more than one partition. eComStation's volume management technology allows the creation of a special kind of volume called a "LVM volume". LVM volumes have the following new features: + Multiple partitions may be combined into one volume. That is, two or more partitions in the same volume will collectively appear to the user as a single logical drive: with a one drive letter, and one file system. + Partitions on physically different disk drives may be included in the same volume in exactly the same way. This is referred to as "drive spanning". + New partitions may be added to an existing volume on the fly. This means that volumes may be increased in size without needing to delete and then recreate them. However, this is a one-way procedure: partitions may not be removed from a volume. eComStation's volume management system does more than simply allow the creation of LVM volumes. It provides a number of special features which apply to all volumes (both compatibility and LVM): + The user may select or change the drive letter any volume uses, in most cases without rebooting the system. + Volumes may be "hidden", so that eComStation no longer sees them. (They may be "unhidden", or made visible again, at a later time.) + In most cases, volumes may be created or deleted without the need to reboot the system. Logical Volume Manager (LVM) is the software used to create and manage volumes. It has been designed by IBM Corporation, and is based on technology used in AIX and OS/2 Warp Server for e-business. It is also being developed for the Linux operating system, and is available through IBM DeveloperWorks under the project name "EVMS". LVM keeps track of its volumes by giving them a "tag", containing the extra information required to support LVM's special features. This information is invisible to other operating systems and utility programs which are not designed for volume management. Therefore, the special features offered by LVM -- including the ability to use and manage LVM volumes -- will not be available under most other operating systems. (Since other operating systems, and third-party software which works with disks and partitions, generally do not understand volume management, it is recommended that partition-management software other than LVM not be used after eComStation is installed.) -------------------------------------------------- Moving from Partitions to Volumes In order to install eComStation, all existing disk partitions must be marked as logical volumes. Logical volumes represent a new layer of abstraction on top of disk partitions. The partitions themselves are not altered; instead, the Logical Volume Manager (LVM) uses a "fingerprinting" technique to interpret partitions in a new way. This approach maintains compatibility with other operating systems which do not understand logical volumes, while at the same time allowing the introduction of some powerful new features under eComStation. In order to access any hard disks, eComStation needs to run the Volume Conversion Utility (VCU). The VCU is a component of LVM which examines the system, and "tags" all existing partitions with a LVM "fingerprint". This fingerprint is used by LVM to store some extra information for its own use. Partitions which are tagged in this way are called "compatibility volumes". "Conversion Utility" is an unfortunate misnomer, because this process does not actually alter any disk partitions. The only change made is the saving of the "fingerprint", which is written to a normally-unused area of the disk. This fingerprint should not affect or interfere with any other software or operating system. Operating systems which do not "understand" logical volumes will simply continue to treat compatibility volumes as partitions in the traditional sense. However, if non-LVM-aware software which performs partition-level disk management is used, then this "fingerprint" may be inadvertently erased. Such programs include the "FDISK" utilities from most other operating systems, and also software such as Partition Magic from PowerQuest. For this reason, it is strongly recommended that you do not use such software on your system after installing eComStation. If you must do so, then please read the following information carefully first. If your system does not contain any special "LVM volumes" (as opposed to simple compatibility volumes), then the use of such programs is not likely to cause permanent data loss. In all probability, however, eComStation will not be able to boot from the affected disk drive until the LVM "fingerprints" are recreated. To do this, it will be necessary to boot the system off the eComStation CD-ROM or recovery diskettes, and run the VCU utility from there. Once the fingerprints have been recreated, the system should function normally again, with no loss of data. (Serenity Systems does not, however, provide any guarantees that this will be the case. Partition management is inherently risky. Always back up your data before working with disk partitions.) The situation changes, however, if the system contains any "LVM volumes". Unlike compatibility volumes (which are simply standard partitions), LVM volumes depend on a special data format which other partition management software (like FDISK or Partition Magic) does not recognize. In such a case, the volume information could be corrupted beyond recovery, resulting in the loss of all data stored on the LVM volume. Therefore, if you believe you will have cause to use third-party partition management software on your system, avoid using LVM volumes. As noted above, you are strongly discouraged from using such software at all. ALWAYS BACK UP ALL DATA ON THE SYSTEM, BEFORE WORKING WITH PARTITIONS OR VOLUMES. ----------------------------------------------------------------- Alex Taylor BA - CIS - University of Guelph alex@eddie.cis.uoguelph.ca http://eddie.cis.uoguelph.ca/~alex ----------------------------------------------------------------- *******************************************************8