By Eirik Overby ( IRC (efnet, webbnet): Ltning)© October 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.


  • Logical Volume Manager (LVM, the Warp Server eBusiness replacement for FDISK which will be used in the new IBM OS/2 Warp 4 Convenience Pak as well as Serenity System's eComStation)
  • Partition Magic, a proprietary disk partitioning application by PowerQuest.
  • FDISK (The original disk drive partitioning tool used in OS/2, as well as MS-DOS, PC-DOS, OpenDOS, Linux)

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.

Troubleshooting:

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:

Problem:

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

Possible causes:

  • The partition table has become corrupted and OS/2 cannot determine what filesystem is on the volume.
  • You used the wrong partition when recreating the volume, and/or a filesystem driver for the filesystem on the partition has not been loaded.

What to do:

  • In case OS/2 cannot determine the filesystem type, there are still several ways to fix this. If it is a HPFS partition, the GTDISK utility from Gammatech Utilities lets you "Fixup a HPFS partition". What this does is basically to re-set the partition type information in the partition table, so that OS/2 recognizes it as HPFS. I cannot remember at the moment, but I think the same utility can do this also for FAT partitions (NOT FAT32!!!).
  • Alternatively, you can use DiskEdit from Norton Utilities for DOS (at least up to version 8.0) to manually edit the partition table and set the partition type for the given partition.
  • A third way is to use a Linux program called CFDISK to set the partition type. (Download a bootdisk and rootdisk from for example the Slackware distribution, this should help you. As bootdisk choose bare.i or scsi.s (IDE or SCSI system), rootdisk color.gz)

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.

Problem:
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:

  • You simply lost track of your partitions, or didn't read this document through before starting ;-)

What to do:
  • A deleted partition isn't necessarily the end of things. All the data is still there, it's just that the operating system doesn't know the start and end of it, so to speak. All you have to do is to recreate the partition, EXACTLY as big as it was and in EXACTLY the same place on the disk. If the partition occupied the whole disk or was between two other partitions, this shouldn't be a problem as long as you use the same program to recreate it as you did to delete it (rebooting in the meantime doesn't do any harm, but doesn't help either).

  • Now the important thing, especially if you use Partition Magic, is that you DO NOT CREATE A FILESYSTEM ON THE NEW PARTITION! The thing is, if you create a partition with Partition Magic and tell it to use a particular filesystem on it, that is basically the same as formatting the partition. It overwrites the areas of the disk where the filesystem was with a new, empty filesystem. If this happens, there is NO WAY to recover your data (unless you go to a professional company, which will cost you $$$$$). So: Select "Unformatted" when Partition Magic asks what filesystem to put on the new partition! After creating the partition again, use LVM to create a volume using it, and it should be fine. In case you don't see any files on the partition, run CHKDSK; this will look for filesystem structures and restore the files on your disk.


Unless otherwise noted, all content on this site is Copyright © 2004, VOICE