VOICE Home Page: http://www.os2voice.org
[Newsletter Index]
[Previous Page] [Next Page]
[Features Index]

November 2000

LVM, FDISK and Partition Magic

By Eirik Overby ( IRC (efnet, webbnet): Ltning)©November 2000

Partition Magic:http://www.powerquest.com                       
Please note that this article is not meant to encourage people to experiment with different disk partitioning tools, but to offer solutions to problems one may encounter once a system has been updated to using LVM, the new disk partitioning tool for OS/2 and eComStation.

Recently there has been a lot of discussions in different fora, especially the eComStation mailing list (previously at egroups, now a newsgroup at news.ecomstation.nl) about the consequences of using LVM, Partition Magic and FDISK on the same hard drives and partitions. The conclusions of most of these discussions have been that using utilities like Partition Magic or FDISK (in particular the OS/2 version) on harddrives on which LVM has been used would be dangerous and possibly fatal for the content of, in particular, HPFS and JFS partitions and volumes.

In this document I want to tell you why this conclusion is wrong, and how you can successfully combine using LVM, Partition Magic, and any flavour of FDISK you might desire.

Some LVM theory

LVM is a very powerful disk/partition managing tool. It lets you do many things that good old FDISK never could do, and that gives OS/2 users a hint of the UNIX-world-of-no-driveletters (but in fact you are still limited to 26 single letter partition names). For example, LVM lets you mount any existing partition on your drive to any (free) driveletter. It lets you create volumes consisting of several partitions, for example to link several hard drives to seem as one large drive. It lets you shuffle around driveletters as you wish. It lets you name partitions, drives and volumes for easy recognition.

The key issue in this discussion is the fact that any existing partition on your drives can be assigned as a volume and thus given a driveletter. Many people seem to think that if a partition on your drive doesn't show up in LVM on the first run, their data is lost forever, or at least not accessible from OS/2. This is wrong.

People who use Partition Magic or some other tool to partition their drives after OS/2 (with LVM) has been installed, often experience that some or all of the volumes they had defined in LVM disappear when doing this, and thus they think their OS/2 partitions (be it JFS or HPFS) are lost forever. This is also wrong. Even volumes consisting of several partitions on several drives aren't usually lost even though they don't show up in OS/2 and LVM.

So .. What REALLY happens when volumes seem to disappear? The answer is simple: The "standard" layout of a partition table doesn't allow for very much "extra" information to be stored about each partition, so LVM has to use some kind of "hack" to keep track of its partitions and volumes. What happens when you use FDISK, Partition Magic or any other disk partitioning program, is that you might "confuse" LVM; it might lose track of the partitions that form its volumes. This can be a serious problem of course, but it's not fatal if you know how to handle it. Once you do, you should be able to utilize any function you might find in any disk partitioning program (as long as you don't delete your partitions that is (oh btw, even then you might be able to get out of it - I'll get to that later) ), without risking your data.

As an example, I just moved all my partitions from an old 9gig drive to a 18gig drive, including OS/2's boot partitions, one JFS partition, and half of a LVM volume that spanned two drives. After running LVM and reinstating all the volumes I had, everything is working perfectly. And it's not even difficult, you just have to know what you're doing at all steps in the process.

Basic rule of thumb:

If a volume disappears from LVM after using Partition Magic or FDISK, all you have to do is to recreate the volume using the same partitions that previously formed the volume, in the same order.

Important things to remember:

How the volumes were created in the first place. Remember whether you chose to "Create a volume that does not need to be bootable" or to "Create a volume that can be made bootable". In case of having selected "Create a volume that does not need to be bootable", it's even more important to remember if it used to be a compatibility volume or a LVM volume. (As a helper here, any bootable partitions and any FAT/NTFS/Ext2 etc. partitions will usually be compatibility volumes, or they wouldn't be accessible from other operating systems).

When recreating a volume consisting of several partitions, make sure you add the partitions in the same order as you did the first time. And make sure you don't forget any "parts" of the puzzle, this will render the partition unusable and your data lost.


If LVM complains that the partition table on a drive is corrupt, simply go to physical view and change the name of a drive. This will probably be the only operation it lets you do. Then exit LVM, and start it again. In 90% of the cases, this will have fixed the problem. If not, go on and try to change the names of the partitions on the drive, if possible. (Still in physical mode).

You will not be able to create a bootable partition on anything but the first harddrive unless you have Boot Manager installed. If, however, Boot Manager is installed and you still can't create bootable partitions on other drives than the first (or make logical partitions bootable), removing and re-installing Boot Manager will probably help (and perhaps also the above mentioned problem can be solved in this way).

Notes about Boot Manager:

When I talk about Boot Manager, I mean IBM Boot Manager, not any other boot manager application (PQBoot, System Commander etc.). The reason that the IBM Boot Manager should ALWAYS be installed, whether you plan to use it or not, is that LVM needs to 'know' that it has a 100% sure way of being able to boot off a given partition. This can be done in two ways:
Either it's a primary partition on the first hard drive, in that case all OS/2 has to do is to set its own partition active and it will boot.

Or, it can rely on a boot manager to handle it, but since it only knows its own boot manager, that one has to be installed. There is no way for LVM to know that System Commander or PQBoot or whatever is installed.

More troubleshooting:

When trying to access a volume after "restoring" it with LVM, it fails or shows an empty partition.

Possible causes:

What to do:

If you chose the wrong partition, DO NOT DELETE THE VOLUME!
Deleting a volume also deletes the partition(s) it uses! So what you might have to do is to select to hide the volume from OS/2 (in LVM), and create a new volume using the correct partition. You can then later assign another driveletter to the hidden volume if you choose to install a filesystem driver for it.

If you are 100% sure you mounted the right partition, and that it does indeed show signs of having a filesystem on it that OS/2 can read, run CHKDSK on the volume. This might get rid of the last possible problems. You should run CHKDSK /F on all partitions anyway, to make sure no inconsistencies exist.

You deleted the wrong partition with Partition Magic or FDISK, or you deleted a volume after realizing you had used the wrong partition.

Possible causes:

What to do: