# Title page

    32 bits Linux ext2 file system driver for OS/2

    EXT2-OS2 VERSION 2.40

    Copyright (C) Matthieu WILLM 1995, 1996, 1997 (willm@ibm.net)

# Introduction

ext2-os2 is a file system driver that allows OS/2 to seamlessly access Linux native partitions (ext2fs partitions) in both read and write modes. Once installed, Linux partitions appear as standard OS/2 drive letters.

My initial purpose was to get limited read only access to ext2fs partitions from my OS/2 system, so at the beginning (version 0.1 alpha back in June 1995), it was more a quick and dirty rewrite than a clean and full port of the Linux ext2fs file system kernel code.

I've improved it to reuse as much original ext2fs code as possible in order to get an almost full featured ext2fs driver on OS/2. I wrote a kind of IFS to VFS translation layer, and ported some Linux kernel services in order to minimize the changes required into the ext2fs sources. Now that ext2-os2 is 32 bits, these changes are minimal.

This version is almost full featured : the main restriction is that ext2-os2 does not support extended attributes (EAS). Here are the main features of ext2-os2 :

- full 32bits ring 0 implementation
- allows read-write access to Linux ext2 partitions
- allows OS/2 to swap on Linux ext2 partitions
- allows OS/2 to boot from a Linux ext2 partition
- supports huge cache sizes
- contains a port of most of the Linux ext2 file system utilities from the e2fsprogs-1.10 package :
  - mke2fs, to format drives as Linux ext2
  - e2fsck, to check and repair Linux ext2 file systems
  - tune2fs, to change Linux ext2 file systems parameters
  - debugfs, an interactive Linux ext2 file system debugger
  - lsattr and chattr, to see or change attributes of files on Linux ext2 file systems
- can reorder all hard disk drive letters, to avoid partition headaches
- hard links are supported under OS/2 and can also be created from OS/2

DISCLAIMER :

THE FACT THAT I WORK FOR IBM HAS NOTHING TO DO WITH THIS DRIVER. I'M WRITING IT AT HOME, DURING MY SPARE TIME, FOR MY OWN PURPOSES, ON MY OWN MACHINE, WITHOUT ANY IBM MEANS. I USED ONLY IBM PUBLISHED DOCUMENTS TO WRITE IT : I AM ABSOLUTELY NOT RELATED TO THE OS/2 DEVELOPMENT TEAM AND THUS I HAVE ABSOLUTELY NO ACCESS TO ANY CONFIDENTIAL OS/2 IFS RELATED INFORMATION.

Anyway I hope you'll enjoy trying this driver, and even if I don't have much time, I'll try to keep improving it. I wait for your feedback on this version : comments, ideas, bug reports and contributions are welcome. Success stories do also interest me, and disasters too !

Matthieu WILLM

willm@ibm.net
  Home
mwillm@vnet.ibm.com
  Work

Note : English is not my native language (I'm french) ... so this document isn't certainly perfect.

# *** IMPORTANT WARNING - READ THIS FIRST ***

ext2-os2 is a FILE SYSTEM DRIVER. Being a driver it runs at the most privileged level of the OS/2 operating system, known as "kernel mode". IN KERNEL MODE THERE IS NO MORE CRASH PROTECTION. It means that if a bug occurs in the driver IT CAN CAUSE A HANG OR A SYSTEM HALT, AND THUS CAN CAUSE LOSS OF DATA.

- I STRONGLY SUGGEST YOU TO MAKE A BACKUP OF ALL YOUR DATA (EVEN IF THEY ARE NOT LOCATED ON A LINUX PARTITION) PRIOR TO USE THIS DRIVER.
- DON'T USE THIS DRIVER ON A PRODUCTION MACHINE, OR IF YOU MANIPULATE CRITICAL DATA.
- IF HUMAN LIFE DEPENDS ON YOUR SYSTEM, DON'T INSTALL THIS DRIVER ON IT.
- USE IT AT YOUR OWN RISKS, AND ONLY ON A MACHINE YOU ACCEPT TO CRASH AND REINSTALL.
- BE AWARE THAT THIS DRIVER WILL GIVE FULL UNRESTRICTED (ROOT) ACCESS TO ALL YOUR EXT2FS PARTITIONS FROM OS/2.

From experience, ext2-os2 is now stable for normal use, and it is unlikely that a disaster will occur. But as any piece of software, it cannot be bulletproof. Doing regular backups is still the best method to protect against disasters of any kinds ...

# Copyright information

    Copyright notice for the ext2fs IFS driver
    Copyright notice for the ext2fs partition filter
    Authors of the original Linux ext2 file system

## Copyright notice for the ext2fs IFS driver

        32 bits Linux ext2fs file system driver for OS/2 WARP - Allows OS/2 to
        access your Linux ext2fs partitions as normal drive letters.
        Copyright (C) 1995, 1996, 1997  Matthieu WILLM

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public
    License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

## Copyright notice for the ext2fs partition filter

    /************************************************************************/
    /*                       Linux partition filter.                        */
    /*          (C) Copyright Deon van der Westhuysen, July 1995.           */
    /*                                                                      */
    /*  Dedicated to Jesus Christ, my Lord and Saviour.                     */
    /*                                                                      */
    /* This program is free software; you can redistribute it and/or modify */
    /* it under the terms of the GNU General Public License as published by */
    /* the Free Software Foundation; either version 2, or (at your option)  */
    /* any later version.                                                   */
    /*                                                                      */
    /* This program is distributed in the hope that it will be useful,      */
    /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
    /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
    /* GNU General Public License for more details.                         */
    /*                                                                      */
    /* You should have received a copy of the GNU General Public License    */
    /* along with this program; if not, write to the Free Software          */
    /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            */
    /*                                                                      */
    /*  This code is still under development; expect some rough edges.      */
    /*                                                                      */
    /************************************************************************/

## Authors of the original Linux ext2 file system

Parts of the ext2-os2 package are based on GNU GPL copyrighted code whose owners are :

- Linus Torvalds, the main author of the Linux kernel.
- Remy Card, the main author of the Linux ext2fs file system kernel code, as well as part of the ext2fs utilities.
- Theodore Ts'o, the main author of the Linux ext2fs file system utilities.
- Stephen Tweedie, who improved the Linux ext2fs allocation algorithms.
- Werner Almesberger, the author of the Linux FAT file system.
- Jean Loup Gailly, the author of gzip
- ...probably many other contributors to the Linux kernel.

# Installation instructions

This chapter describes the installation and setup instructions

    Step 1 - Things to do BEFORE installing ext2-os2
    Step 2 - Make OS/2 see your Linux ext2fs partitions
    Step 3 - Copying the files to your hard drive
    Step 4 - Using the ext2-os2 monitoring tool
    Step 5 - Specifying command line parameters

## Step 1 - Things to do BEFORE installing ext2-os2

Here are things you must do before installing this version of ext2-os2 :

1. Please run e2fsck from Linux on ALL your ext2fs partitions BEFORE installing ext2-os2. (You might have to boot Linux from floppy to do this, especially to run e2fsck on your root partition).
2. I STRONGLY suggest you to first backup any data you don't want to loose BEFORE trying this driver.
3. Make a backup copy of your CONFIG.SYS
4. Have the two OS/2 kicker diskettes handy , with a full screen editor, so that you can restore your CONFIG.SYS if the system crashed at boot time. (This is not needed with WARP : Alt+F1 C at boot time will do the trick)
5. Prepare a Linux boot diskette, with e2fsck on it.
6. If you installed a previous version of ext2-os2, then comment out the following CONFIG.SYS statements and reboot your system to ensure that no ext2-os2 file is locked while installing the new version.
   - IFS = <path>\ext2-os2.ifs parms
   - RUN = path\ext2_lw.exe
   - BASEDEV = ext2flt.flt parms
   - BASEDEV = mwdd32.sys parms

## Step 2 - Make OS/2 see your Linux ext2fs partitions

This chapter describes how to make OS/2 see your Linux ext2fs partitions

### Understanding how does OS/2 assign drive letters

OS2DASD.DMD is the block device managing fixed partitionnable disks and floppies. It is always (as far as I know) the first block device loaded by the system. It first scans every .add drivers for physical disks. Then it reads the partition table of each disk. It first looks for active primary OS/2 partitions (Types 01, 04, 06 and 07) and installs a block device for each of them It repeats this for each physical drive in the system. Then it looks for extended volumes on the first physical drive (type 05 partition), reads the extended boot record, looks for an OS/2 partition and assign it a drive letter, looks for another extended volume ... and so on until no more extended volume is found on the first disk. It them repeats this for each physical drive.

Example :

    þ Scans all *.add driver for fixed disks - found 2
    þ Reads the MBR of physical disk 1
            þ Found an OS/2 type 7 partition (active primary OS/2 IFS)  - Install a block device (C:)
            þ Found an unknown type 0x83 partition                      - skip it
            þ Found an OS/2 type 5 partition (extended volume)          - skip it
            þ No more primary partition
    þ Reads the MBR of physical disk 2
            þ Found an OS/2 type 7 partition                            - Install a block device (D:)
            þ Found an unknown type 17 (inactive primary OS/2 IFS)      - skip it
            þ Found an OS/2 type 5 partition (extended vol)             - skip it
            þ No more primary partition
    Now done for primary partitions - processing extended volumes
    þ Reread the MBR of physical disk 1
            þ Found an OS/2 type 5 partition (extended volume)
                    þ Reads the extended boot record of the extended volume
                            þ Found a OS/2 type 7 partition             - Install a block device (E:)
                            þ Found an OS/2 type 5 partition
                                    þ Reads the extended boot record
                                        þ Found a OS/2 type 7 partition - Install a block device (F:)
                                        þ No more partition
    þ Reread the MBR of physical disk 2
            þ Found an OS/2 type 5 partition (extended volume)
                    þ Reads the extended boot record of the extended volume
                            þ Found a OS/2 type 7 partition             - Install a block device (G:)
                            þ No more partition

Make OS/2 see your Linux ext2fs partitions

### Make OS/2 see your Linux ext2fs partitions.

During "normal" operations, OS/2 will not assign a drive letter to the Linux partitions, because their type (0x83) is not one of the types OS/2 normally recognize. An installable file system driver does not have any control on how block devices are assigned : this is a device driver issue. If we don't do anything, the ext2fs IFS won't be very useful, since OS/2 doesn't even call it (no block device allocated).

In order for OS/2 to see your ext2fs partition, you must either change your Linux ext2fs partition ID from 0x83 (Linux native) to 0x7 (OS/2 IFS - and not OS/2 HPFS as stated in the Linux fdisk documentation), or make OS/2 think type 0x83 partitions are type 0x7 partitions.

In the first case we must manually alter the partition table, and in the second case we must use a special filter device driver - ext2flt.flt - whose purpose is to show a "hacked" partition table to OS2DASD.DMD.

Here's how ext2flt.flt works : A virtual fixed disk is created for each partition under control of the driver. These virtual fixed disks each contain one extended partition with a logical drive in it. Since OS2DASD.DMD that controls fixed disks first assigns drive letters to primary partitions the virtual partitions are tacked on at the end of allocated drive letters. (To control the mounting order of all partitions OS2DASD is prevented from directly accessing the fixed disks and the filter presents it with an alternate list of partitions.)

BE CAREFUL : IF YOU DECIDE TO CHANGE PARTITION ID MANUALLY BE AWARE THAT IT CAN CHANGE YOUR DRIVE LETTERS AND MAKE OS/2 UNBOOTABLE !!

Examples being better than a long speach, let's look at some different situations :

    Example 1
    Example 2
    Example 3

## Step 3 - Copying the files to your hard drive

- Installation using the "Device Driver Install" object
- Manual installation

### Installation using the "Device Driver Install" object

1. Open the "OS/2 System" folder
2. Open the "System Setup" folder
3. Open the "Device Driver Install" object
   1. Type in the "source directory" entry field the path where you decompacted the files
   2. Type in the "target directory" your OS/2 boot drive
   3. Click on the "Install..." push button
   4. Select the drivers to install (select both of them) :
      - "Linux ext2fs file system driver (IFS) version 2.40 for OS/2"
      - "ext2flt - Filter to make Linux partitions visable to OS/2."
   5. Click on OK
4. Add <boot drive>:\OS2\FS\EXT2 to the PATH and LIBPATH statements in your CONFIG.SYS
5. Set and/or change command line parameters for ext2-os2.ifs and ext2flt.flt.
6. Reboot your computer

### Manual installation

ext2flt installation

1. copy ext2flt.flt and ext2flt.sym in <boot drive>\OS2 or in boot drive\OS2\BOOT (WARP only)
2. add the following line in CONFIG.SYS

       BASEDEV=EXT2FLT.FLT

3. if necessary, adjust ext2flt command line parameters (for instance /W if you want write access)

ext2-os2 installation

1. copy mwdd32.sys and mwdd32.sym in boot drive\OS2 or in boot drive\OS2\BOOT (WARP only)
2. add the following line in CONFIG.SYS

       BASEDEV=MWDD32.SYS

3. make a directory to hold ext2-os2 files somewhere but NOT on a Linux partition.
4. add this directory at the end of the PATH and LIBPATH statements in CONFIG.SYS
5. copy the following files to that directory :
   - ext2-os2.ifs
   - ext2-os2.exe
   - sync.exe
   - hardlink.exe
   - umount.exe
   - remount.exe
   - ext2_lw.exe
   - ext2-os2.inf
   - ext2-os2.htm
   - ext2-os2.sym
   - ext2-os2.ddp
   - vfsapi.dll
   - vfsapi.lib
   - uext2.dll
   - uuid.dll
   - et.dll
   - ext2fs.dll
   - badblks.exe
   - mke2fs.exe
   - e2fsck.exe
6. add the following lines in your CONFIG.SYS

       IFS=path\ext2-os2.ifs -cache:256 -errors=continue
       RUN=path\ext2_lw.exe

7. if necessary, adjust ext2-os2.ifs command line parameters (for instance -rw if you want write access)

Note : In CONFIG.SYS, ext2-os2.ifs MUST be located AFTER the IFS managing the boot drive (HPFS.IFS usually). ext2-os2.ifs can appear at the head of CONFIG.SYS only if you boot OS/2 from a Linux partition.

## Step 4 - Using the ext2-os2 monitoring tool

ext2-os2.exe is a monitoring tool to retrieve data from ext2-os2.ifs. It is a PM notebook containing :

- page 1 : disk cache information
- page 2 : I-node and open file information
- page 3 : ext2-os2.ifs standard output
- page 4 : ext2-os2.ifs swapper information (active only when SWAPPER.DAT is located on a Linux ext2fs partition)

## Step 5 - Specifying command line parameters

ext2-os2.ifs command line in CONFIG.SYS :

    IFS = <drive>:path\ext2-os2.ifs [-q]
                                      [-cache:max. disk cache size]
                                      [-rw]
                                      [-no_auto_fsck]
                                      [-case_retensive]
                                      [-IFS entry point to trace]
                                      [-no_strat2]
                                      [-errors=[panic|continue]]
                                      [-output=[com1|com2]]
                                      [-tz:time zone in minutes from UTC]
                                      [-force_strat2:removable drive number to be forced to use strat 2 I/O]

NOTE : case is not significant (-q and -Q are equivalent), and '-' as well as '/' can be used as a command line switch on the ext2-os2.ifs command line.

ext2flt.flt command line in CONFIG.SYS :

    BASEDEV = EXT2FLT.FLT [/Q]
                          [/V]
                          [/W]
                          [/A]
                          [/M mount list]

# Usage instructions

This chapter describes some imortant usage instructions.

1. Lazy writes considerations
2. Automatic check disk
3. Fatal ext2-os2 errors
4. Case sensitivity considerations
5. Note to "System Commander" Users
6. Dynamic disk cache considerations
7. Time zone considerations
8. Important removable media considerations

## Lazy writes considerations

This file system driver makes heavy use of lazy writes : it means that data are not committed to the disk immediately for performance purposes. This means that YOU *MUST ALWAYS* SHUTDOWN YOUR SYSTEM PROPERLY so that data can be written to disk. IF YOU DON'T FOLLOW THIS RULE, YOUR EXT2FS PARTITION WILL BE PROBABLY DAMAGED, AND YOUR DATA LOST.

If you need to commit data to disk without shutting down the system, you can use the sync.exe utility. This utility behaves exactly like its UNIX equivalent (but only on Linux ext2fs file systems).

There is an automatic flush during system shutdown., so running sync.exe prior system shutdown is not necessary.

Note : You will notice that the shutdown process is slightly longer, especially if you used a huge cache size : this is a normal behaviour.

## Automatic check disk

When ext2-os2 mounts an ext2fs partition and when read writes are enabled, it will set the mount count in the superblock to its maximum value in order to force a disk check when Linux mounts the drive.

This is a safety precaution to ensure that ext2-os2.ifs didn't corrupt the file systems. I do NOT recommend to disable this automatic check ; I only included the -no_auto_fsck switch for those who have very large drives, where e2fsck takes ages to complete.

## Fatal ext2-os2 errors

ext2-os2 fatal errors can appear in several forms :

1. A system halt with a register dump : this is a fatal exception trapped by the OS/2 kernel, due for example to a NULL pointer assignment. In this case the kernel debugger or a system dump is needed to track down the problem.
2. A system halt with a message like "> EXT2-OS2 FATAL ERROR <". This is a system halt initiated by ext2-os2.ifs due to an unexpected error. Normally there should be a few lines with a cryptic message. Please write it down, as it will tell me where the error occured.
3. The whole system is frozen : it is probably because an infinite loop was entered. Here also the kernel debugger is the only solution.
4. One or more applications are frozen : it is probably a deadlock.

In either case, your ext2fs partition is in great danger ; To minimize the risk of data loss, please do the following :

1. In case of a system halt, write down the error message.
2. In case of a system hang, try to press CTRL+ALT+DEL : this will commit dirty buffers to disk and thus minimise the damages on the partitions (ext2fs as well as FAT or HPFS). If it didn't work, the big red button is the only solution.
3. Reboot Linux and run e2fsck ON ALL YOUR LINUX EXT2FS PARTITIONS to check and repair them if needed. DO NOT RESTART OS/2 WITH EXT2-OS2.IFS WITHOUT HAVING RUN E2FSCK ON ALL YOUR PARTITIONS, THIS COULD SPREAD FILE SYSTEM ERRORS AND MAKE THINGS EVEN WORSE !
4. Please e-mail me the error, as well as a test case if possible, and please join your partition scheme (FDISK /QUERY from OS/2 or fdisk -l from Linux) and your CONFIG.SYS.

## Case sensitivity considerations

ext2fs is a case sensitive file system ; ext2-os2.ifs by default does case sensitive comparisions, but even if OS/2 supports case sensitive file systems, all the apps that uppercase or lowercase file names are broken. Some parts of OS/2 are also broken : for instance the OS/2 program loader itself will uppercase executable names, and so will fail loading programs or DLL if they reside in a path with low case components.

As a workaround, I introduced a command line switch (-case_retensive) to make ext2-os2.ifs behave like HPFS : once set, it will ignore case when comparing file names, but it will retain the case within the file system. It means that FILE, File, FiLe and file will be treated as the same file if they reside in the same directory ; but if you create FiLe, it will keep the case in the file system.

Note : If you plan to run OS/2 programs from a Linux partition, this option is necessary because the OS/2 program loader uppercase executable names.

There's a drawback to this case retensive mode : if 2 files created from Linux in the same directory exist with the same name but different case (FILE and File for instance), and you run ext2-os2.ifs in case retensive mode, RESULTS WILL BE UNPREDICTABLE AND YOU CAN TRASH ONE OR EVEN BOTH FILES ! In fact only the first entry in the "." file of the parent directory will be used by ext2-os2.ifs ; This "first" entry is not necessarily the first entry displayed by the 'DIR' command, nor is it the first one created. EXT2-OS2.IFS DOES NOTHING TO SOLVE SUCH FILE NAME CONFLICT IN CASE RETENSIVE MODE.

If you want to use this case retensive mode, please make sure from Linux that there are never several files with the same name but different case in ANY directory on ANY ext2fs partitions on your system BEFORE trying case retensive mode. If there are some, then rename these files from Linux so that they have have different names.

## Note to "System Commander" Users

Note that "System Commander" (from V-Communications) may make changes to the partition table at boot time. This may affect which partitions are visible, or what drive letters are assigned by OS/2 when booting from System Commander. In particular, by default System Commander will make primary partitions on the second hard drive invisible to OS/2. If one of these other primary paritions contains a Linux partition, it will not be visible to OS/2 or EXT2-FS, (even though you are using the /V /A /M options with EXT2FLT.FLT). To make a primary partition on a second hard drive visible when booting OS/2 from System Commander, do the following:

1. From the main System Commander screen, move to the OS/2 boot selection, and press Alt-S for the setup screen.
2. Select "Local special options" from the setup screen.
3. Select "YES" for the "Make primary partitions visible on drive 1".
4. That's all

This has been reported by Steve Enns (ennss@eris.nhrc.sk.doe.ca)

## Dynamic disk cache considerations

ext2-os2.ifs now has a dynamic disk cache. The disk cache code is in fact a port of the Linux disk cache, but with a few important differences.

In Linux, the dynamic cache code is coupled to the virtual memory manager code, so that all free physical memory can be used as cache : when there's some free physical memory, the cache can grow, and when there's not enough free physical memory, the virtual memory manager asks the disk cache to free some pages (this can range from "Could you please give me some free pages" ... to "I URGENTLY need some memory so make whatever you can to free some pages"). On OS/2 I couldn't make things work that way, simply because I can't hack the OS/2 kernel code !! On OS/2, you MUST specify an upper limit for the amount of physical memory the disk cache can allocate. When needed, ext2-os2.ifs will allocate this memory as disk cache, but to simulate VMM calls to shrink the cache, a daemon (ext2_lw.exe) periodically tries to shrink the cache. While it is not a perfect solution, it seems to be a good compromise, at least if the max cache size is reasonable (small enough so that it doesn't cause physical memory starvation to the kernel).

Some important points :

- Disk cache memory is allocated/freed by chunks of 4 Kb (a page).
- The disk cache is allocaled in PHYSICAL MEMORY, it means that this memory CANNOT BE SWAPPED OUT to make room for other needs by the kernel (Having a swappable disk cache would be stupid IMHO !). It means that the maximun cache size passed to ext2-os2.ifs command line in CONFIG.SYS (-cache:xxx option) should be reasonable.
- You MUST ALWAYS HAVE EXT2_LW.EXE RUNNING, even in read only mode. If you kill it or if you suppress the starting of ext2_lw.exe in CONFIG.SYS, the disk cache size WILL NEVER SHRINK.
- You can monitor the disk cache size using ext2-os2.exe.

## Time zone considerations

ext2-os2 can now take your local time zone into account. File times should match Linux file times (local time) instead of being relative to UTC . The time zone can be set in CONFIG.SYS on the ext2-os2.ifs command line through the -tz switch . It should be set to the minute shift from UTC (-1440 to +1440). 0 means GMT, 60 means GMT+1, 120 means GMT+2, -60 means GMT-1 and so on.

This option is rather experimental and can't be perfect because OS/2 does not natively support time zones. Please tell me if you find it useful and if it works correctly, otherwise simply remove the -tz switch and tell me the problems you encountered.

Note : The OS/2 system time is not affected by this variable, so when you use -tz, you make ext2-os2.ifs consistent with Linux, but you introduce a shift between OS/2 system time, and file times. In some cases this can be a problem. Please tell me if you encountered some problems due to this (makefiles ?).

## Important removable media considerations

ext2-os2 does support removable media formatted with the Linux ext2fs file system. To safely use ext2-os2 on removable media, you MUST FOLLOW THE THE PROCEDURE DESCRIBED BELOW !!! If you don't follow this procedure, you can face data loss or even system halts.

When you insert a new media in its drive, OS/2 will automatically attach the correct file system on it. No special step is required to make OS/2 recognize this new media. If you cannot access the drive, then you can try to run the remount.exe program to make OS/2 redetermine the file system to be attached to the drive. If it still fails, then check that it is actually formatted with the ext2 file system, and if it is the case, try to run e2fsck on that drive.

When you plan to remove a media from its device, YOU MUST RUN THE UMOUNT.EXE PROGRAM ON THAT DRIVE TO COMMIT ALL DATA TO DISK AND MAKE EXT2-OS2 FREE ANY REFERENCES TO THAT PARTICULAR VOLUME. After that, the media can be safely removed from its device. umount.exe actually issues an unmount operation, like on UNIX.

Note : The old method of using sync.exe before removing a media could cause problem in some cases. That's why I strongly recommend to use umount.exe instead each time you need to remove a volume from its device (umount.exe does a lot more work than sync.exe, as it does exactly what the UNIX "umount" call does).

# Features, limitations and known bugs for this release.

1. Features and limitations
2. Known bugs

## Features and limitations

- ext2-os2.ifs is a full 32 bits ring 0 FLAT memory model file system driver (like WARP Server's HPFS386).
- All flavours of OS/2 WARP are supported (V3 and V4) except SMP versions.
- I used the Linux 1.2.1 kernel sources, corresponding to ext2fs 0.5b. It should work even with ext2fs from latest linux kernels (up to 2.1.13 which is the latest kernel as of today).
- Pseudo dynamic disk cache size (limited by the physical memory available), ported from Linux.
- Global I-node cache, identical to Linux one.
- Global directory entry cache, identical to Linux one.
- Uses almost only original Linux ext2fs routines.
- Can use a blocksize of 1024, 2048 or 4096 bytes (1024 is the default).
- Doesn't support fragments (neither do the original Linux ext2fs 0.5b code)
- Linux special files (fifo, symbolic links, sockets, block and character devices) are mapped as SYSTEM files : you can see them with DIR /A but you normally can't read them
- OS/2 mounts ext2fs partitions as root : it means that from OS/2 you have full unrestricted access to your Linux partitions.
- Unlike Linux, file names beginning with '.' are not hidden
- Hard links are properly handled and can be created from OS/2.
- Symbolic links are not followed (treated as SYSTEM regular files)
- Each ext2 partition has its own drive letter (provided you made them visible from OS/2)
- OS/2 extended attributes are not supported, because Linux ext2fs does not support them for the moment.
- Swapping on a Linux ext2fs partition is supported : it means you can put SWAPPER.DAT on a Linux partition.
- Booting OS/2 from a Linux ext2fs partition is now supported, but you must still have a FAT or HPFS partition to store the WPS desktop tree.
- Some OS/2 API are not or partially supported, for instance :
  1. DosSetFileInfo : level 2 (used to store/change EAS) is ignored because EAS are not supported by ext2fs.
  2. DosSetPathInfo : level 2 (used to store/change EAS) is ignored because EAS are not supported by ext2fs.
  3. DosSetVerify : completely ignored on ext2fs partitions !
- ext2fs specific behaviour of some OS/2 API :
  1. DosQueryFSInfo with FSIL_ALLOC (level 1) information returns the free space minus the reserved space. This should be consistent with Minix style df output (no fs overhead taken into account).
  2. DosQueryFSInfo with FSIL_VOLSER (level 2) information returns the Linux ext2 volume name (if any) truncated to 11 characters, and a 32 bits CRC checksum of the Linux ext2 UUID as the volume serial number.
- A file is considered read only if neither UNIX user, group and other 'write' bits are set.
- When a file is set read-write, the UNIX user 'write' bit is set.
- When the block device driver supports it, strategy 2 I/O are used on non removable media. They provide the following advantages :
  - Uses asynchronous I/O request lists.
  - Priorities can be assigned to I/O.
  - Multiple non contiguous I/O requests can be sent to the device driver in one shot, this permits the the IFS and the device driver to sort requests for better performance.
- OS2DASD.DMD, the standard fixed disk block device driver does support strategy 2 requests.

## Known bugs

The following list includes some common problems encountered with ext2-os2. There are of several kinds : permanent restrictions, problems due to bugs in the OS/2 operating system itself, or problems I couldn't reproduce yet (for instance because I don't have the related hardware). This list is not complete but I'll try to keep it as much up to date as possible , if you give me your feedback...

- The mount process will mount the ext2fs partition even if it has not been unmounted cleanly : I STRONLY SUGGEST YOU TO UNMOUNT YOUR FILE SYSTEMS CLEANLY FROM LINUX - RUNNING THIS DRIVER ON A CORRUPTED EXT2FS PARTITION IS LIKELY TO CRASH YOU SYSTEM.
- DosFindNext() called from a 32 bits app (aka DosFindFromName) doesn't restart from the specified name, but from the last directory entry found.
- As ext2fs doesn't support EAS, there are many cosmetic bugs with the workplace shell (some icons stay hatched....)
- Error codes returned from the IFS to OS/2 are sometimes not translated from Linux to OS/2. This will result in messages like "Cannot find message 56347" instead of "Directory not empty" for instance.
- Some people may encounter a hang or a system halt at boot time, if they have removable devices like MO drive, Syquest and such. There's apparently a problem between EXT2FLT.FLT and some filter device drivers that attempt to make these devices appear like fixed disks (these drivers are LOCKDRV.FLT, SYQLOCK.FLT ...). To solve the problem, edit CONFIG.SYS so that EXT2FLT.FLT appears as the first .FLT driver.

# How to build ext2-os2.ifs

This chapter describes how to build the IFS.

1. Tools needed
2. The build tree - How to build

## Tools needed

Table or required compiler, assembler and linker :

                          32 bits C  16 bits C  80x86      Linker
                          compiler   compiler   assembler

     ext2-os2.ifs         ?????????? (none)     ?????????? ??????????
                          (1)               (2)    (7)

     mwdd32.sys           ?????????? (none)     ?????????? ??????????
                          (1)               (2)    (7)

     ext2flt.flt          (none)     ?????????? ?????????? ??????????
                                     (3) or (5) or (8) or
                                     ?????????? ?????????? (9)
                                     (4)    (6)

     vfsapi.dll           ?????????? (none)     (none)     ??????????
                          (1)                          (7)

     ext2-os2.exe         ?????????? (none)     (none)     ??????????
                          (1)                          (7)

     ext2_lw.exe          ?????????? (none)     (none)     ??????????
                          (1)                          (7)

     sync.exe             ?????????? (none)     (none)     ??????????
                          (1)                          (7)

     uext2.dll            ?????????? (none)     (none)     ??????????
                          (1)                          (7)

     microfsd.fsd         (none)     ?????????? ?????????? ??????????
                                     (3)    (5)    (8)

     minifsd.fsd          (none)     ?????????? ?????????? ??????????
                                     (3)    (5)    (8)

List of required toolkits :

- The IBM OS/2 WARP developer's toolkit (included in IBM Visualage C++ package)
- The IBM OS/2 Developer Connection Device Driver Kit version 2 or later
- The IBM 'IFS toolkit'. I don't know the exact status of this package ; it seems to be publically available (I've seen it on Hobbes - a file named ifsinf.zip). If it's not publically available, ask your local IBM rep for a copy.

## The build tree - How to build

1. make a directory somewhere on your disk.
2. in that directory, unzip the file ext2_src.zip
3. in that directory, unzip the file mwdd_src.zip (included in 32drv130.zip included in this package).
4. update the file <your directory>\32bits\ext2-os2\makefile.inc, according to the table below.
5. open a DOS session, and in that session :
   - change the current directory to your directory\32bits\ext2-os2\ext2flt
   - type 'nmake -f makefile.msc' to build ext2flt.flt.
6. exit from the DOS session
7. change the current directory to your directory\32bits\ext2-os2
8. type "nmake" to build the whole ext2-os2 package

     EXT2OS2_BASE       The root path of ext2-os2 (usually \ext2-os2)

     DDKPATH            The path where is installed your DDK (usually
                        \DDKX86 or \DDK)

     IFSTKTPATH         The path where you put the "IFS toolkit" (fsd
                        .h, fsh.h and fshelper.lib)

     MSVCPATH           The path where MS Visual C++ is installed (
                        usually \MSVC)

     VACPATH            The path where IBM Visualage C++ is installed
                        (usually \IBMCPP)

The build tree looks like :

     .\                   contains the main makefile an the files I
                          couldn't put elsewhere.

     .\vfs                Linux kernel services and VFS interfaces.

     .\ext2               Linux ext2fs sources (from /usr/src/linux-1.2
                          .1/fs/ext2)

     .\include\os2        OS/2 specific include files

     .\include\linux      Linux include files (/usr/src/linux-1.2.1/
                          include/linux)

     .\include\asm        Linux include files (/usr/src/linux-1.2.1/
                          include/asm)

     .\console            ext2-os2.exe monitoring tool sources

     .\doc                The ext2-os2 documentation

     .\distrib            The directory in which is built the ZIP file.

     .\vfsapi             The VFSAPI library sources.

     .\ext2flt            contains Deon van der Westhuysen's ext2flt.
                          flt sources, patched to compile with MS
                          Visual C++ as well as Borland C++.

     .\microfsd           The ext2-os2 micro FSD (used to boot OS/2
                          from a Linux partition)

     .\minifsd            The ext2-os2 mini FSD (used to boot OS/2 from
                          a Linux partition)

     .\uext2              The dummy uext2.dll library sources (
                          necessary to make BOOTOS2 happy)

# The VFSAPI library

The purpose of the VFSAPI library is to provide an extension of the standard OS/2 standard file system oriented calls to access Linux VFS specific features like I-nodes, UNIX file modes, file ownership and so on. For the moment the library is quite limited, but with the time I'll include some more calls !

To be able to do what they are designed for, these routines talk directly to the ext2-os2.ifs file system driver, through the DosFsCtl call. DosFsCtl (almost) directly calls the IFS's FS_FSCTL entry point. Most of the work is done in kernel mode inside ext2-os2.ifs. DosFsCtl is the IFS equivalent of DosDevIOCtl : an extended interface to the IFS.

The library is compiled using IBM Visualage C++ 3.0, but it should also compile without problem with emx/gcc. The precompiled vfsapi.dll should work with emx/gcc (and other compilers) without recompilation.

The entry points follow the standard OS/2 32 bits API linkage convention (_System for IBM Visualage C++, _syscall for Borland C++).

Note : The funtion names, as well as data structure names, have been prefixed with "vfs_" in order to prevent name collisions with existing C/C++ runtime libraries.

- vfs_fstat
- vfs_stat
- vfs_sync
- vfs_link

## vfs_fstat

    int vfs_fstat(int fd, struct new_stat *s);

This is the ext2-os2 implementation of the Unix fstat() system call. It returns a "true" stat structure containing the "true" Unix file mode, the "true" file ownership... This stat structure is the same as the Linux stat structure defined in /usr/include/sys/stat.h. All the macros and definitions for file modes and file ownership are also the same as in Linux.

     Parameter type       Input      Description
                          Output

     int fd               input      must be a valid OS/2 file handle (for example
                                     returned by DosOpen, or DosDupHandle).

     struct vfs_stat *s   in/out     On input  must point to a vfs_stat structure.
                                     On output  contains the I-node information.

## vfs_stat

    int vfs_stat(const char *pathname, struct new_stat *s);

This is the ext2-os2 implementation of the Unix stat() system call. It returns a "true" stat structure containing the "true" Unix file mode, the "true" file ownership... This stat structure is the same as the Linux stat structure defined in /usr/include/sys/stat.h. All the macros and definitions for file modes and file ownership are also the same as in Linux.

     Parameter type       Input      Description
                          Output

     const char *pathname input      Must be a valid OS/2 file name (a file name
                                     acceptable by DosOpen).

     struct vfs_stat *s   in/out     On input  must point to a vfs_stat structure.
                                     On output  contains the I-node information.

## vfs_sync

    int vfs_sync(void);

This is the ext2-os2 implementation of the Unix sync() system call. It commits all data to the disk.

Note : vfs_sync will ONLY work on ext2fs partitions, not on other partitions (FAT, HPFS).

## vfs_link

    int vfs_link(const char *from, const char *to);

This call creates a hard link to an existing file.

     Parameter type       Input      Description
                          Output

     const char *from     input      File name to be linked. Must be a valid OS/2
                                     file name (a file name acceptable by DosOpen)
                                     .

     const char *to       input      New file name. Must be a valid OS/2 file name
                                     (a file name acceptable by DosOpen).

# Booting OS/2 from a Linux ext2fs partition

Ext2-os2 allows OS/2 to boot from a Linux ext2fs partition. It can even makes OS/2 reside alongside Linux on the same partition (I mean, having vmlinuz and OS2KRNL on the same file system !).

Note : There is only one restriction : you must still have a small FAT or HPFS partition to store the WPS desktop tree (usually <boot drive>:\DESKTOP\*), because the Linux ext2 file system does not support EAS (extended attributes), which are necessary to the WPS.

Anyway, it is not completely useless though : with this feature you can for instance install an OS/2 maintenance partition on a Linux ext2fs drive, and thus save a partition. You can also install a full OS/2 system, if you store the desktop and the swap file on a FAT or HPFS partition.

The following chapters will describe how to setup an OS/2 system on a Linux ext2fs partition. It's not an easy thing to do, because as you will see it's like if we gathered on a single partition the usual problems encountered when installing a Linux+OS/2 system !!

For the moment booting OS/2 from a Linux partition is still quite experimental and is still at beta level stabiliy ! To try this feature, you'll have to be very familiar with OS/2 installation, Linux installation, and LILO + OS/2 Boot Manager configuration. Please make a full backup of your system first !

I'm waiting for your feedback on this new feature, both failures and success stories !

1. Understanding the normal OS/2 HPFS boot sequence
2. Understanding the normal Linux ext2fs boot sequence
3. Understanding the ext2-os2 OS/2 ext2fs boot sequence
4. Installing and configuring OS/2 on a Linux ext2fs partition

## Understanding the normal OS/2 HPFS boot sequence

Assume you have an OS/2 system with Boot Manager installed. Here's a simplified HPFS boot sequence :

1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
3. This active partition is Boot Manager, it will present you a menu of bootable systems.
4. When you select the OS/2 system, boot manager reads and executes the code in the boot record of the selected partition.
5. This code is called a "black box". Its role is to load a micro IFS in memory. This micro IFS is a real mode IFS with just enough brain to read a few files.
6. When the micro IFS receives control, it loads the OS/2 loader (stored in OS2LDR). It also loads a mini IFS : a mini IFS is a protect mode IFS with limited read only capabilities, just a little bit more clever than a micro IFS ! (The HPFS mini IFS is stored in OS2BOOT) It then passes control to OS2LDR, along with the current state of memory.
7. OS2LDR then loads OS2KRNL from disk, applies required fixups, and gives control to the kernel.
8. The kernel then loads the mini IFS from its memory image. The mini IFS is used to load the base device drivers, then the normal device drivers and IFSes, then the VDD drivers.
9. When the normal HPFS IFS is loaded, it replaces the mini IFS.

As you can see, the OS/2 kernel doesn't know anything about HPFS. It even makes no assumption of booting off of disk.

## Understanding the normal Linux ext2fs boot sequence

Assume you have a Linux system with OS/2 Boot Manager installed as the main boot loader, and LILO installed in the superblock of the Linux boot partition.

1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
3. This active partition is Boot Manager, it will present you a menu of bootable systems.
4. When you select the Linux system, boot manager reads and executes the code in the boot record of the selected partition.
5. This code is actually the LILO first stage loader. its role is to load the LILO second stage loader.
6. The LILO second stage loader loads the disk map of the boot image, then using this map it loads the Linux kernel, as well as command line parameters. It then gives control to the setup code stored at the beginning of the Linux boot image.
7. The setup code then explores the hardware configuration, switches to protect mode and passes control to the Linux kernel.
8. When the Linux kernel receives control, it executes its initialization routines, and initializes the device drivers present in the boot image.
9. It then executes the init process.

The main difference here is that the Linux kernel does not load dynamically the device drivers, and especially the ext2fs driver. They are all present in the boot image. While it greatly simplifies the boot sequence (no mini IFS, no micro IFS ...) it requires a reconmpilation whenever you want to add or remove a driver.

When you run LILO to install a new kernel, it installs a map of the kernel boot image, and a boot loader in the boot record. LILO's main advantage is to be independant of the file system it uses, and even more : it knows absolutely nothing about ext2fs, FAT and so on. It uses the disk map to load the boot image. This is the reason why you must re-run LILO whenever you touch your kernel file. LILO makes no assumption of booting a Linux kernel image : it can load other systems as well : it loads the specified file in a well known place in memory regardless of its type, and gives it control.

## Understanding the ext2-os2 OS/2 ext2fs boot sequence

ext2-os2 uses a mix of these two different sequences to boot OS/2 from a Linux ext2fs partition. In this package there are two new files :

- MICROFSD.FSD : the Linux ext2fs micro IFS
- MINIFSD.FSD : the Linux ext2fs mini FSD

The main difference between the normal OS/2 boot sequence and the ext2-os2 boot sequence is that ext2-os2 uses LILO as the "black box" described above. LILO is actually configured to load MICROFSD.FSD instead of a standard Linux kernel boot image.

Note : LILO is required to boot OS/2 from a Linux partition. I tested it with LILO 0.15 but it should also work with later versions.

The boot sequence will be (assuming you have OS/2 boot manager installed as the main boot loader, and LILO in the superblock of the Linux partition) :

1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
3. This active partition is Boot Manager, it will present you a menu of bootable systems.
4. When you select the OS/2 system, boot manager reads and executes the code in the boot record of the selected partition.
5. This code is actually the LILO first stage loader. its role is to load the LILO second stage loader.
6. The LILO second stage loader loads the disk map of the boot image (which is actually a map of MICROFSD.FSD), then using this map it loads the micro FSD as well as as command line parameters. It then gives control to the micro FSD.
7. When the micro IFS receives control, it loads the OS/2 loader (stored in OS2LDR). It also loads the ext2fs mini IFS (MINIFSD.FSD). It then passes control to OS2LDR, along with the current state of memory.
8. OS2LDR then loads OS2KRNL from disk, applies required fixups, and gives control to the kernel.
9. The kernel then loads the mini IFS from its memory image. The mini IFS is used to load the base device drivers, then the normal device drivers and IFSes, then the VDD drivers.
10. When the normal ext2-os2 IFS is loaded, it replaces the mini IFS.

## Installing and configuring OS/2 on a Linux ext2fs partition

1. Sample initial situation
2. Copying OS/2 a Linux ext2fs partition
3. Copying the required ext2-os2 files on the ext2fs partition
4. Updating CONFIG.SYS
5. Configuring and running LILO to boot OS/2 from your ext2fs partition
6. Now time to reboot ...

### Sample initial situation

hard disk 1 (100 Mb IDE drive) :

     OS/2 drive      OS/2 BM name    Linux device    Linux mount     Description
     letter                          name            point

                                     /dev/hda2                       OS/2 boot
                                                                     manager
                                                                     partition

     C               test            /dev/hda3       /disk_c         Linux ext2fs
                                                                     test (type 0x07
                                                                     ) partition (
                                                                     ext2flt not
                                                                     used to mount
                                                                     it)

     F               linux           /dev/hda1       /               Linux ext2fs
                                                                     root (type 0x83
                                                                     ) partition (
                                                                     ext2flt used to
                                                                     mount it)

((See also linux and OS/2 fdisk output for drive 1)

hard disk 2 (1.2 Gb SCSI drive) :

     OS/2 drive      OS/2 BM name    Linux device    Linux mount     Description
     letter                          name            point

     D               WARP            /dev/sda1                       primary OS/2
                                                                     HPFS with OS/2
                                                                     WARP installed
                                                                     (normal use)

     D               EXT2-OS2        /dev/sda2                       primary OS/2
                                                                     HPFS with OS/2
                                                                     and kernel
                                                                     debugger (to
                                                                     test ext2-os2)

     E                               /dev/sda5                       extended OS/2
                                                                     HPFS data
                                                                     partition.

((See also linux and OS/2 fdisk output for drive 2)

LILO is installed in the superblock of /dev/hda1, and is configured to load /vmlinuz from this partition. (lilo.conf used to configure LILO)

### Copying OS/2 a Linux ext2fs partition

To install OS/2, the easiest way will be to use the IBM EWS bootos2.zip package (available on usual OS/2 ftp sites). This package can create a bootable system from an existing installed system. It can install a system on either floppies or hard disks. Moreover it can create a minimal system (single text mode session), a PM enabled system, a WPS enabled system ...

Here's how I installed a PM enabled system on drive F:. To do this, I booted my normal OS/2 system, went to the bootos2 directory and typed :

    BOOTOS2 TARGET=F: TYPE=PM

- Some important remarks:
- you must have the two OS/2 installation disks handy, bootos2 will ask them.
- when BOOTOS2 asks if you want to format the target partition, you must answer to skip format !!
- UEXT2.DLL must be somewhere in you LIBPATH, otherwise bootos2 will abort.
- Sometimes for some reason, bootos2 forgets to copy the hidden OS2DUMP file in the root directory. Please ensure that it has been copied.

Note on how to install a WPS enabled system

### Copying the required ext2-os2 files on the ext2fs partition

Make a directory on the ext2fs partition to store ext2-os2 files (for instance F:\os2\fs\ext2) and copy the following files in it :

- ext2-os2.exe
- ext2-os2.ifs
- ext2-os2.sym
- ext2_lw.exe
- sync.exe
- vfsapi.dll
- uext2.dll

Copy the following files in F:\OS2 : or in F:\OS2\BOOT

- ext2flt.flt
- ext2flt.sym
- mwdd32.sys
- mwdd32.sym

Copy the following files in F:\ :

- microfsd.fsd
- minifsd.fsd

### Updating CONFIG.SYS

Then add the following statements at the beginning of F:\CONFIG.SYS :

    REM
    REM this should be the beginning of CONFIG.SYS
    REM
    IFS=F:\OS2\FS\EXT2\EXT2-OS2.IFS -cache:256 -rw -case_retensive <add other options if necessary>
    RUN=F:\OS2\FS\EXT2\EXT2_LW.EXE
    BASEDEV=MWDD32.SYS
    BASEDEV=EXT2FLT.FLT /W add other options if necessary

- the IFS managing the boot drive - in this case ext2-os2.ifs - must always be the first statement in CONFIG.SYS, or OS/2 will crash during boot.
- write access must be enabled or OS/2 will not work properly.
- the -case_retensive option is necessary or OS/2 won't boot

### Configuring and running LILO to boot OS/2 from your ext2fs partition

Now reboot under Linux. In this step we'll need to know several things :

- the boot drive geometry (number of tracks, number of sectors per track). You can know them in your drive's manual, or in your BIOS setup.
- the boot partition geometry (starting sector, number of sectors). You can know it using fdisk -l (list partitions)
- the boot drive BIOS device code (first drive is 0x80, second is 0x81 ...)

Then edit the /etc/lilo.conf to add /microfsd.fsd as a new boot image :

    #
    # Start LILO global section
    #
    boot = /dev/hda1                # installs LILO in the superblock of /dev/hda1
    vga = normal                    # force sane state
    ramdisk = 0                     # paranoia setting
    prompt
    #
    # End LILO global section
    #
    # Linux bootable partition config begins
    #
    image = /vmlinuz                # normal Linux kernel image
      root = /dev/hda1
      label = linux                 # name to enter at LILO prompt
      read-only                     # Non-UMSDOS filesystems should be mounted read-only for checking
    #
    # Linux bootable partition config ends
    #
    # OS/2 bootable partition config begins
    #
    image = /microfsd.fsd           # ext2-os2 micro-fsd file (OS2LDR loader).
      label = test_os2              # name to enter at LILO prompt
      append = "os2_bios_device=0x80 os2_bootdrive=5 os2_hidden_sectors=0x19884 os2_sect=35 os2_head=6 os2_total_sectors=100800 os2_bytes_per_sector=512"
    #
    # OS/2 bootable partition config ends
    #

In the "append=" we've passed mandatory informations to the ext2-os2 micro FSD so that it can boot OS/2 properly. Below is a description of these parameters.

Note : All these parameters are required. A wrong value in one of them will prevent OS/2 from booting normally.

     os2_bootdrive        this is the OS/2 drive letter of the boot
                          drive. It MUST REFLECT the drive letter as
                          seen in a normal situation (in our case F).
                          You CANNOT REORDER drive letters with this
                          option ; use ext2flt's /M option instead and
                          update this value accordingly.

     os2_bios_device      this is the physical drive BIOS device code.
                          Floppy drives are 0 (A) and 1 (). Hard drives
                          are numbered starting at 0x80, so physical
                          hard drive 1 is 0x80, drive 2 is 0x81.

     os2_hidden_sectors   this is sector number (512 bytes) of the
                          first sector of the boot partition. Use fdisk
                          -uS -l under Linux to know it.

     os2_total_sectors    this is the size of the boot partition in 512
                          bytes sectors. Use fdisk -uS -l to know it.

     os2_sect             this is the number of sectors per track

     os2_bytes_per_sector this is the hardware sector size in bytes (
                          normally 512 bytes).

     os2_head             this is the number of heads

Then run the map installer to update LILO configuration as follows :

    lilo -v

### Now time to reboot ...

Now we can shutdown the system and reboot. Once in OS/2 boot manager menu, select "linux". This will start LILO. Once LILO is up - it should prompt "lilo:" at the top left corner of the screen - type "test_os2", then <ENTER> then let's prey ! Here are some checkpoints :

     ext2-os2 MICROFSD    microfsd.fsd has been successfuly loaded by
     banner appears on    LILO, and has been successfuly started.
     top of the screen

     a little white box   it means that microfsd.fsd has successfuly
     followed by the word loaded OS2LDR and minifsd.fsd, and that
     "OS2" appears at the OS2LDR has been successfuly started.
     top left corner of
     the screen.

     the OS/2 logo bitmap it means that OS2LDR has successfuly loaded
     appears              OS2KRNL, successfuly started the kernel, that
                          microfsd.fsd's job is over, and that minifsd.
                          fsd's job is starting. From this point CONFIG
                          .SYS base device drivers begin to be loaded.

     the normal ext2-os2  ext2-os2.ifs has just been loaded.
     banner appears.

     PM appears (if a PM  OS/2 boot process is successful !
     system), or the OS/2
     command prompt
     appears.

    The boot process will be probably slightly longer than a normal boot. This is absolutely normal.
    You can press ALT+F2 when the little white box appears : it will make OS/2 tell what driver it is currently loading.
    You can hook an ASCII terminal on the COM2 port (for instance a PC with a terminal emulator, and a null-modem cable), ext2-os2 will write debug information on COM2 port during the boot process.

# Linux ext2 file system utilities

- These utilities require the EMX runtime library (it can be found at ftp://ftp-os2 .nmsu.edu/os2/unix/emx09c/emxrt.zip).
- These utilities require the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- e2fsck - check a Linux second extended file system
- mke2fs - create a Linux second extended file system
- badblocks - search a device for bad blocks
- debugfs - ext2 file system debugger
- chattr - change file attributes on a Linux second extended file system
- lsattr - list file attributes on a Linux second extended file system
- tune2fs - adjust tunable filesystem parameters on second extended filesystems

## e2fsck - check a Linux second extended file system

This program is also available through the standard CHKDSK command, with the same syntax described below.

- This chapter is a (almost) direct adaptation to IPF of the original Linux e2fsck(8) man page.
- If after running this program, you cannot access your drive and get a message from OS/2 like "Cannot access the specified drive" or "The specified drive is not formatted", DON'T PANIC ! It does *NOT* mean your drive is lost; it only means that for some reason something went wrong while trying to remount the drive after the e2fsck operation. Rebooting OS/2 generally solves the problem.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- exit code
- reporting bugs
- author
- see also

### synopsis

           e2fsck  [  -pacnyrdfvstFSV ] [ -b superblock ] [ -B block-
           size ] [ -l|-L bad_blocks_file ] device

### description

           e2fsck is used to check a Linux second extended file  sys-
           tem.
           device is  the  special  file  corresponding to the device
                  (e.g /dev/hdXX on Linux, X: on OS/2).

### options

           -a     This option does the same thing as the  -p  option.
                  It is provided for backwards compatibility only; it
                  is suggested that people use -p option whever  pos-
                  sible.
           -b superblock
                  Instead  of  using  the  normal superblock, use the
                  alternative superblock specified by superblock.
           -B blocksize
                  Normally, e2fsck will search for the superblock  at
                  various different block sizes in an attempt to find
                  the appropriate block size.   This  search  can  be
                  fooled in some cases.  This option forces e2fsck to
                  only try locating the superblock  at  a  particular
                  blocksize.   If the superblock is not found, e2fsck
                  will terminate with a fatal error.
           -c     This option causes e2fsck to run  the  badblocks(8)
                  program  to  find  any  blocks which are bad on the
                  filesystem, and then marks them as  bad  by  adding
                  them to the bad block inode.
           -d     Print  debugging  output  (useless  unless  you are
                  debugging e2fsck ).
           -f     Force checking even if the file system seems clean.
           -F     Flush  the filesystem device's buffer caches before
                  beginning.  Only really  useful  for  doing  e2fsck
                  time trials.
           -l filename
                  Add  the  blocks  listed  in  the file specified by
                  filename to the list of bad blocks.
           -L filename
                  Set the bad blocks list to be the  list  of  blocks
                  specified by filename.  (This option is the same as
                  the -l  option,  except  the  bad  blocks  list  is
                  cleared  before  the  blocks listed in the file are
                  added to the bad blocks list.)
           -n     Open the filesystem read-only, and assume an answer
                  of  ``no''  to  all questions.  Allows e2fsck to be
                  used non-interactively.  (Note: if the -c,  -l,  or
                  -L  options  are  specified  in  addition to the -n
                  option, then the filesystem will  be  opened  read-
                  write, to permit the bad-blocks list to be updated.
                  However, no other  changes  will  be  made  to  the
                  filesystem.)
           -p     Automatically  repair  ("preen")  the  file  system
                  without any questions.
           -r     This option does nothing at  all;  it  is  provided
                  only for backwards compatibility.
                  -s  This  option  will  byte-swap the filesystem so
                  that it is using  the  normalized,  standard  byte-
                  order  (which  is  i386  or little endian).  If the
                  filesystem is already in the  standard  byte-order,
                  e2fsck will take no action.
           -S     This  option will byte-swap the filesystem, regard-
                  less of its current byte-order.
           -t     Print timing statistics for e2fsck.  If this option
                  is  used  twice,  additional  timing statistics are
                  printed on a pass by pass basis.
           -v     Verbose mode.
           -V     Print version information and exit.
           -y     Assume an  answer  of  ``yes''  to  all  questions;
                  allows e2fsck to be used non-interactively.

### exit code

           The exit code returned by e2fsck is the sum of the follow-
           ing conditions:
                0    - No errors
                1    - File system errors corrected
                2    - File system errors corrected, system should
                       be rebooted if file system was mounted
                4    - File system errors left uncorrected
                8    - Operational error
                16   - Usage or syntax error
                128  - Shared library error

### reporting bugs

           Almost any piece of software will have bugs.  If you  man-
           age  to find a filesystem which causes e2fsck to crash, or
           which e2fsck is unable to repair, please report it to  the
           author.
           Please include as much information as possible in your bug
           report.  Ideally, include a  complete  transcript  of  the
           e2fsck  run,  so I can see exactly what error messages are
           displayed.  If you have a writeable filesystem  where  the
           transcript can be stored, the script(1) program is a handy
           way to save the output of to a file.
           It is also useful to send the output of dumpe2fs(8).  If a
           specific  inode  or inodes seems to be giving e2fsck trou-
           ble, try running the debugfs(8) command and send the  out-
           put  of the stat command run on the relevant inode(s).  If
           the inode is a directory, the debugfs  dump  command  will
           allow  you to extract the contents of the directory inode,
           which can sent to me after being first run  through  uuen-
           code(1).
           Always  include  the full version string which e2fsck dis-
           plays when it is run, so I know which version you are run-
           ning.

### author

           This  version  of  e2fsck  is  written  by  Theodore  Ts'o
           <tytso@mit.edu>.
           It has been ported to OS/2 by Matthieu Willm.

### see also

           mke2fs(8), tune2fs(8), dumpe2fs(8), debugfs(8)

## mke2fs - create a Linux second extended file system

This program is also available through the standard FORMAT command, with the same syntax described below.

- This chapter is a (almost) direct adaptation to IPF of the original Linux mke2fs(8) man page.
- If after running this program, you cannot access your drive and get a message from OS/2 like "Cannot access the specified drive" or "The specified drive is not formatted", DON'T PANIC ! It does *NOT* mean your drive is lost; it only means that for some reason something went wrong while trying to remount the drive after the mke2fs operation. Rebooting OS/2 generally solves the problem.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- author
- bugs
- availability
- see also

### synopsis

           mke2fs  [  -c | -l filename ] [ -b block-size ] [ -f frag-
           ment-size ] [ -i bytes-per-inode ] [  -m  reserved-blocks-
           percentage  ]  [ -o creator-os ] [ -q ] [ -v ] [ -F ] [ -L
           volume-label ] [ -M last-mounted-directory ] [ -S ] device
           [ blocks-count ]

### description

mke2fs is used to create a Linux second extended file system on a device (usually a disk partition).

device is the special file corresponding to the device (e.g /dev/hdXX).

blocks-count is the number of blocks on the device. If omitted, mke2fs automatically figures the file system size.

Note : On OS/2, device is actually the drive letter of the partition to be formatted (e.g X:)

### options

           -b block-size
                  Specify the size of blocks in bytes.
           -c     Check the device for bad blocks before creating the
                  file system, using a fast read-only test.
           -f fragment-size
                  Specify the size of fragments in bytes.
           -i bytes-per-inode
                  Specify the bytes/inode ratio.  mke2fs  creates  an
                  inode  for  every bytes-per-inode bytes of space on
                  the disk.   This  value  defaults  to  4096  bytes.
                  bytes-per-inode must be at least 1024.
           -l filename
                  Read the bad blocks list from filename
           -m reserved-blocks-percentage
                  Specify  the  percentage of reserved blocks for the
                  super-user.  This value defaults to 5%.
           -o     Manually override the default value of the "creator
                  os"  field of the filesystem.  Normally the creator
                  field is set by default to the  native  OS  of  the
                  mke2fs executable.
           -q     Quiet  execution.   Useful  if  mke2fs  is run in a
                  script.
           -v     Verbose execution.
           -F     Force mke2fs to run, even if the  specified  device
                  is not a block special device.
           -L     Set the volume label for the filesystem.
           -M     Set  the last mounted directory for the filesystem.
                  This might be useful for the sake of utilities that
                  key  off of the last mounted directory to determine
                  where the filesytem should be mounted.
           -S     Write superblock and group descriptors only.   This
                  is  useful  if  all  of  the  superblock and backup
                  superblocks are corrupted, and a last-ditch  recov-
                  ery  method is desired.  It causes mke2fs to reini-
                  tialize the superblock and group descriptors, while
                  not  touching  the  inode  table  and the block and
                  inode bitmaps.  The e2fsck program  should  be  run
                  immediately after this option is used, and there is
                  no guarantee that any data will be salvageable.

### author

           This version of mke2fs has been written by  Theodore  Ts'o
           <tytso@mit.edu>.
           It has been ported to OS/2 by Matthieu Willm.

### bugs

           mke2fs  accepts  the  -f  option  but currently ignores it
           because the second extended file system does  not  support
           fragments yet.
           There  may be some other ones.  Please, report them to the
           author.

### availability

           mke2fs is available for anonymous ftp from ftp.ibp.fr  and
           tsx-11.mit.edu in /pub/linux/packages/ext2fs.

### see also

           dumpe2fs(8), e2fsck(8), tune2fs(8)

## badblocks - search a device for bad blocks

- This chapter is an (almost) direct adaptation to IPF of the original Linux badblocks(8) man page.
- To conform to the FAT 8:3 naming convention, this program has been renamed badblks.exe.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- warning
- author
- bugs
- availability
- see also

### synopsis

           badblocks [ -b block-size ] [ -o output_file ] [ -v ] [ -w
           ] device blocks-count

### description

           badblocks is used to search for bad  blocks  on  a  device
           (usually a disk partition).
           device  is  the  special  file corresponding to the device
           (e.g /dev/hdXX).
           blocks-count is the number of blocks on the device.

### options

           -b block-size
                  Specify the size of blocks in bytes.
           -o output_file
                  Write the list of bad blocks to the specified file.
                  Without this option, badblocks displays the list on
                  its standard output.
           -v     Verbose mode.
           -w     Use write-mode test. With  this  option,  badblocks
                  scans  for  bad  blocks  by  writing  some patterns
                  (0xaa, 0x55, 0xff, 0x00)  on  every  block  of  the
                  device,  reading every block and comparing the con-
                  tents.
     Note : The -w option is not yet implemented on OS/2.

### warning

           Never use the `-w'  option  on  an  device  containing  an
           existing file system.  This option erases data!

### author

           badblocks     has    been    written    by    Remy    Card
           <card@masi.ibp.fr>, the developer and  maintainer  of  the
           ext2 fs.
           It has been rewritten to OS/2 by Matthieu Willm.

### bugs

           I  had no chance to make reals tests of this program since
           I use IDE drives which remap bad blocks. I only made  some
           tests on floppies.

### availability

           badblocks  is  available for anonymous ftp from ftp.ibp.fr
           and tsx-11.mit.edu in /pub/linux/packages/ext2fs.

### see also

           e2fsck(8), mke2fs(8)

## debugfs - ext2 file system debugger

- This chapter is a (almost) direct adaptation to IPF of the original Linux debugfs(8) man page.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- commands
- specifying files
- author
- see also

### synopsis

           debugfs [ -w ] [ -f cmd_file ] [ -R request ] [ device ]

### description

           The  debugfs  program is a file system debugger. It can be
           used to examine and change the state of an ext2 file  sys-
           tem.
           device  is  the  special  file corresponding to the device
           containing the ext2 file system (e.g /dev/hdXX).

### options

           -w     Specify that the file  system  should  be  open  in
                  read-write mode. Without this option, the file sys-
                  tem is open in read-only mode.
           -f cmd_file
                  Causes debugfs to read in commands  from  cmd_file,
                  and execute them.  When debugfs is finsihed execut-
                  ing those commands, it will exit.
           -R request
                  Causes  debugfs  to  execute  the  single   command
                  request, and then exit.

### commands

           debugfs  is an interactive debugger. It understands a num-
           ber of commands.
           cat filespec
                  Dump the contents of the inode filespec to  stdout.
           cd filespec
                  Change the current working directory to filespec.
           chroot filespec
                  Change the root directory to be the directory file-
                  spec.
           close  Close the currently open file system.
           clri file
                  Clear the contents of the inode file.
           dump [-p] filspec out_file
                  Dump the contents of the inode filespec to the out-
                  put  file  out_file.  If the -p option is given set
                  the owner, group  and  permissions  information  on
                  out_file to match filespec.
           expand_dir filespec
                  Expand the directory filespec.

           find_free_block [goal]
                  Find  the  first free block, starting from goal and
                  allocates it.
           find_free_inode [dir [mode]]
                  Find a free inode and allocates  it.   If  present,
                  dir  specifies  the  inode  number of the directory
                  which the inode  is  to  be  located.   The  second
                  optional argument mode specifies the permissions of
                  the new inode.  (If the directory bit is set on the
                  mode,  the allocation routine will function differ-
                  ently.)
           freeb block
                  Mark the block number block as not allocated.
           freei filespec
                  Free the inode specified by filespec
           help   Print a list of commands understood by  debugfs(8).
           icheck block ...
                  Print  a listing of the inodes which use the one or
                  more block specified on the command line.
           initialize device blocksize
                  Create an ext2 file system on  device  with  device
                  size blocksize.  Note that this does not fully ini-
                  tialize all of the data structures; to do this, use
                  the  mke2fs(8) program.  This is just a call to the
                  low-level library, which sets up the superblock and
                  block descriptors.
           kill_file filespec
                  Dellocate  the inode filespec and its blocks.  Note
                  that this does not remove any directory entries (if
                  any) to this inode.  See the rm command if you wish
                  to unlink a file.
           ln filespec dest_file
                  Create a link named dest_file which is  a  link  to
                  filespec.  Note this does not adjust the inode ref-
                  erence counts.
           ls [-l] filespec
                  Print a listing of the files in the directory file-
                  spec.
           modify_inode filespec
                  Modify  the  contents of the inode structure in the
                  inode filespec.
           mkdir filespec
                  Make a directory.

           mknod filespec [p|[[c|b] major minor]]
                  Create a special device file (a named pipe, charac-
                  ter  or  block  device).   If  a character or block
                  device is to be made, the major  and  minor  device
                  numbers must be specified.
           ncheck inode_num ...
                  Take the requested list of inode numbers, and print
                  a listing of pathnams to those inodes.
           open [-w] device
                  Open a file system for editing.
           pwd    Print the current working directory.
           quit   Quit debugfs
           rm pathname
                  Unlink pathname.  If this cuases the inode  pointed
                  to by pathname to have no other references, deallo-
                  cate the  file.   This  command  functions  as  the
                  unlink() system call.
           rmdir filespec
                  Remove  the  directory  filespec.  This function is
                  currently not implemented.
           setb block
                  Mark the block number block as allocated.
           seti filespec
                  Mark inode filespec as in use in the inode  bitmap.
           show_super_stats
                  List the contents of the super block.
           stat filespec
                  Display  the contents of the inode structure of the
                  inode filespec.
           testb block
                  Test if the block number block is marked  as  allo-
                  cated in the block bitmap.
           testi filespec
                  Test  if  the inode filespec is marked as allocated
                  in the inode bitmap.
           unlink pathname
                  Remove the link specified by pathname to an  inode.
                  Note  this  does  not  adjust  the  inode reference
                  counts.
           write source_file out_file
                  Create a file in the filesystem named out_file, and
                  copy  the contents of source_file into the destina-
                  tion file.

### specifying files

           Many debugfs commands take a filespec as  an  argument  to
           specify  an  inode  (as  opposed  to  a  pathname)  in the
           filesystem which is currently opened by debugfs. The file-
           spec  argument  may  be specified in two forms.  The first
           form is an inode  number  surrounded  by  angle  brackets,
           e.g., <2>.  The second form is a pathname; if the pathname
           is prefixed by a forward slash ('/'), then  it  is  inter-
           preted  relative  to  the  root of the filesystem which is
           currently opened by debugfs.   If  not,  the  pathname  is
           interpreted  relative  to the current working directory as
           maintained by debugfs.  This may be modified by using  the
           debugfs command cd.

### author

           debugfs was written by Theodore Ts'o <tytso@mit.edu>.

### see also

           dumpe2fs(8), e2fsck(8), mke2fs(8)

## chattr - change file attributes on a Linux second extended file system

- This chapter is a (almost) direct adaptation to IPF of the original Linux chattr(1) man page.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- attributes
- author
- bugs and limitations
- availability
- see also

### synopsis

           chattr [ -RV ] [ -v version ] [ mode ] files...

### description

           chattr changes the files attributes on an second  extended
           file system.
           The format of a symbolic mode is +-=[ASacdisu].
           The  operator  `+'  causes  the  selected attributes to be
           added to the existing attributes of the files; `-'  causes
           them  to  be  removed;  and `=' causes them to be the only
           attributes that the files have.
           The letters `ASacdisu' select the new attributes  for  the
           files:  don't  update  atime (A), synchronous updates (S),
           append only (a), compressed (c), immutable  (i),  no  dump
           (d), secure deletion (s), and undeletable (u).

### options

           -R     Recursively  change  attributes  of directories and
                  their contents.
           -V     Verbosely describe changed attributes.
           -v version
                  Set the files version.

### attributes

           When a file with the 'A' attribute set  is  modified,  its
           atime record is not modified.  This avoid a certain amount
           of disk I/O for laptop systems.
           A file with the `a' attribute set  can  only  be  open  in
           append mode for writing.
           A  file  with  the `c' attribute set is automatically com-
           pressed on the disk by the kernel. A read from  this  file
           returns uncompressed data. A write to this file compresses
           data before storing them on the disk.
           A file with the `d' attribute set  is  not  candidate  for
           backup when the dump(8) program is run.
           A  file with the `i' attribute cannot be modified: it can-
           not be deleted or renamed, no link can be created to  this
           file  and  no  data  can  be written to the file. Only the
           superuser can set or clear this attribute.
           When a file with the `s' attribute  set  is  deleted,  its
           blocks are zeroed and written back to the disk.
           When  a  file  with the `S' attribute set is modified, the
           changes are written synchronously on  the  disk;  this  is
           equivalent  to the `sync' mount option applied to a subset
           of the files.
           When a file with the `u' attribute  set  is  deleted,  its
           contents  is  saved.   This allows the user to ask for its
           undeletion.

### author

           chattr has been written by Remy  Card  <card@masi.ibp.fr>,
           the developer and maintainer of the ext2 fs.
           It has been ported to OS/2 by Matthieu Willm willm@ibm.net.

### bugs and limitations

           As of ext2 fs 0.5a, the `c' and `u' attribute are not hon-
           oured by the kernel code.  As of the Linux 2.0 kernel, the
           'A'  attribute  is  not  yet supported by the kernel code.
           (The noatime code is still in testing.)
           These attributes will be implemented in a future  ext2  fs
           version.

### availability

           chattr  is available for anonymous ftp from ftp.ibp.fr and
           tsx-11.mit.edu in /pub/linux/packages/ext2fs.

### see also

           lsattr(1)

## lsattr - list file attributes on a Linux second extended file system

- This chapter is a (almost) direct adaptation to IPF of the original Linux lsattr(1) man page.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- author
- bugs
- availability
- see also

### synopsis

           lsattr [ -Radv ] [ files...  ]

### description

           lsattr lists the file attributes on a second extended file
           system.

### options

           -R     Recursively  list  attributes  of  directories  and
                  their contents.
           -a     List all files in directories, including files that
                  start with `.'.
           -d     List  directories  like  other  files,  rather than
                  listing their contents.
           -v     List the files version.

### author

           lsattr has been written by Remy  Card  <card@masi.ibp.fr>,
           the developer and maintainer of the ext2 fs.
           It has been ported to OS/2 by Matthieu Willm willm@ibm.net

### bugs

           There are none :-).

### availability

           lsattr  is available for anonymous ftp from ftp.ibp.fr and
           tsx-11.mit.edu in /pub/linux/packages/ext2fs.

### see also

           chattr(1)

## tune2fs - adjust tunable filesystem parameters on second extended filesystems

- This chapter is a (almost) direct adaptation to IPF of the original Linux tune2fs(8) man page.
- This program requires the "-errors=continue" switch to be set on the ext2-os2.ifs command line in CONFIG.SYS.

- synopsis
- description
- options
- bugs
- warning
- author
- availability
- see also

### synopsis

           tune2fs [ -l ] [ -c max-mount-counts ] [ -e  errors-behav-
           ior ] [ -i interval-between-checks ] [ -m reserved-blocks-
           percentage ] [ -r reserved-blocks-count  ]  [  -s  sparse-
           super-flag ] [ -u user ] [ -g group ] [ -C mount-count ] [
           -L volume-name ] [ -M last-mounted-directory ] [ -U UUID ]
           device

### description

           tune2fs  adjusts  tunable filesystem parameters on a Linux
           second extended filesystem.
           Never use tune2fs on a read/write  mounted  filesystem  to
           change parameters!

### options

           -c max-mount-counts
                  adjust   the   maximal  mounts  count  between  two
                  filesystem checks.
           -e errors-behavior
                  change the behavior of the kernel code when  errors
                  are  detected.   errors-behavior  can be one of the
                  followings:
                       continue       Continue normal execution.
                       remount-ro     Remount  the  filesystem  read-
                  only.
                       panic          Causes a kernel panic.
           -g group
                  set  the  user  group  which  can  benefit from the
                  reserved blocks.
                  group can be a numerical gid or a group name.
           -i interval-between-checks[d|m|w]
                  adjust the  maximal  time  between  two  filesystem
                  checks.   No  postfix or `d' result in days, `m' in
                  months, and `w' in weeks.  A  value  of  zero  will
                  disable the timedependent checking.
           -l     list the contents of the filesystem superblock.
           -m reserved-blocks-percentage
                  adjust  the reserved blocks percentage on the given
                  device.
           -r reserved-blocks-count
                  adjust the  reserved  blocks  count  on  the  given
                  device.
           -s sparse_super_flag
                  sets  and  resets  the sparse_superblock flag.  The
                  sparse_superblock feature saves space on really big
                  filesystems.   Warning:  The  Linux 2.0 kernel does
                  not properly support this feature.  Neither do  all
                  Linux 2.1 kernels; please don't use this unless you
                  know what you're doing!
           -u user
                  set the user who  can  benefit  from  the  reserved
                  blocks.   user  can  be  a  numerical uid or a user
                  name.
                  -C mount-count set the number of times the filesys-
                  tem has been mounted.
           -L volume-label
                  set the volume label of the filesystem.
           -M last-mounted-directory
                  set the last-mounted direcctory for the filesystem.
           -U UUID
                  set the UUID of  the  filesystem.   A  sample  UUID
                  looks                   like                  this:
                  "c1b9d5a2-f162-11cf-9ece-0020afc76f16".   The  uuid
                  may  also  be "null", which will set the filesystem
                  UUID to the null UUID.  The uuid may also be  "ran-
                  dom", which will generate a new random UUID for the
                  filesystem.

### bugs

           We didn't find any bugs yet. Perhaps there  are  bugs  but
           it's unlikely.

### warning

           Use  this  utility  on  your  own  risk.  You're modifying
           filesystems.

### author

           tune2fs has been written by Remy Card  <card@masi.ibp.fr>,
           the developer and maintainer of the ext2 fs.
           tune2fs  uses  the ext2fs library written by Theodore Ts'o
           tytso@mit.edu.
           This manual page was written by Christian Kuhtz chk@data-
           hh.Hanse.DE.
           Timedependent    checking    was   added   by   Uwe   Ohse
           uwe@tirka.gun.de.
           tune2fs has been ported to OS/2 by Matthieu Willm willm@ibm.net

### availability

           tune2fs is available for anonymous ftp from ftp.ibp.fr and
           tsx-11.mit.edu in /pub/linux/packages/ext2fs.

### see also

           dumpe2fs(8), e2fsck(8), mke2fs(8)

# Other useful utilities

Note : These utilities require the EMX runtime library (it can be found at ftp://ftp-os2.nmsu.edu/os2/unix/emx09c/emxrt.zip).

- sync - commits data to disk
- umount - detaches the current file system from a disk
- remount - attaches a file system to a disk
- hardlink - creates a hard link to an existing file

## sync - commits data to disk

sync.exe does exactly what its Unix counterpart (sync) does : it commits all buffered data to disks.

Invocation :

    sync

Note : This utility will only commit data located on Linux ext2fs partitions. It does NOT work on other file systems.

## umount - detaches the current file system from a disk

unmount.exe will cleanly unmount a drive by committing all data and detaching the file system currently attached to it. After this operation, the OS/2 drive letter is still present, but the drive cannot be accessed. This utility issues a true unmount of the file system from the drive (eg it's a real unmount, not a hack, by calling the IFS's FS_MOUNT entry point).

Invocation :

    umount X:

X: is the drive to be unmounted. If successful, the drive X: can no longer be accessed. Fo instance typing "dir X:" should give the following message : "SYS0026: The specified disk or diskette cannot be accessed.". If the media is removable, it can be safely removed or ejected.

- umount.exe requires that NO files are open on the drive.
- umount.exe only works on LOCAL file systems (FAT, HPFS, ext2, CDFS ...). It does NOT work on remote file systems (network drives) which should come with their own unmount utility.

Warning : *** NEVER *** run any programs that directly access drives on a drive previously unmounted with unmount.exe. Most of these programs blindly assume the drive is formatted as FAT and thus can cause massive loss of data. These programs include :

- CHKDSK
- PMCHKDSK
- FORMAT (... unless you want to format the drive !)
- Disk optimizers, defrag utilities
- File system checkers (Norton disk doctor and such)
- File recoverers, undelete utilities
- Disk editors (unless you know what you're doing)
- ...

Remember the main purpose of unmount.exe is to remove the media right after !

## remount - attaches a file system to a disk

remount.exe will force OS/2 to reattach a file system to the specified drive. If a file system was already attached, it will be detached first. remount.exe can be called to be able to gain access to a drive previously unmounted with unmount.exe.

Invocation :

    remount X:

X: is the drive to be remounted. If successful, the drive X: can then be accessed normally.

- the OS/2 kernel will automatically determine the proper file system to be attached to the drive.
- remount.exe requires that NO files are open on the drive.
- remount.exe only works on LOCAL file systems (FAT, HPFS, ext2, CDFS ...). It does NOT work on remote file systems (network drives) which should come with their own mount utility.

## hardlink - creates a hard link to an existing file

hardlink is a small replacement of the UNIX "ln" command. Its purpose is to create a hard link to an existing file.

Invocation :

    hardlink <oldname> newname

This will creates newname linked to the file oldname.

# Frequently Asked Questions (FAQ)

- I cannot write to my Linux ext2 partitions, even if I enable write access in CONFIG.SYS

  Write access must be enabled for BOTH ext2flt.flt (/W switch) AND ext2-os2.ifs (-rw switch) in CONFIG.SYS.

- When the system boots, OS/2 tells me that EXT2-OS2.IFS contains an invalid device driver or file system driver.

  ext2-os2 requires the MWDD32.SYS driver to be loaded. Ensure that you CONFIG.SYS contains a line like :

      basedev=mwdd32.sys

- When OS/2 boots, I get SYS2068 messages.

  You can try to turn on quiet mode on the following drivers :

      ext2-os2.ifs (-q switch)
      mwdd32.sys (-q switch)
      ext2flt.flt (/Q switch)

- I cannot run OS/2 programs from a Linux partitions

  The Linux ext2 file system is a case sensitive file system, and this breaks many OS/2 or DOS programs which uppercase or lowercase file names (because FAT and HPFS are NOT case sensitive). The OS/2 program loader itself uppercase file names. To run OS/2 programs from a Linux partition, you must use the -case_retensive switch on the ext2-os2.ifs command line (see Case sensitivity considerations).

- My system hangs during boot, and it seems to occur before ext2-os2.ifs is loaded.

  There seems to be a problem between EXT2FLT.FLT, and drivers that makes removable devices appear as fixed, like Syquest's SYQLOCK.FLT, IBM's LOCKDRV.FLT and so on. If you have removable media like MO drives, ZIP drives, Syquest drives and so on, try to put EXT2FLT.FLT as the FIRST .FLT driver in config.sys, AHEAD of your vendor's filter driver.

- Can I backup my Linux system from OS/2 using ext2-os2 and XYZ backup software ?

  Unfortunately you won't be able to backup a full Linux system from OS/2. This is not a ext2-os2 limitation : your OS/2 XYZ backup software knows NOTHING about UNIX permissions or UNIX special files (symbolic links, fifos, sockets, drivers in /dev), it will not save them and naturally not restore them (your restored system will probably not work).

  However, if you intend to backup only data files (for instance a development source tree), and the tree you plan to backup doesn't contain special files, then you can backup them from OS/2. But when you restore, you will have to manually reset UNIX ownership and file permissions using the UNIX commands chown and chmod.

# History of changes

This chapter describes the changes between each release of ext2-os2

1. From 0.1 to 0.2
2. From 0.2 to 0.3
3. From 0.3 to 0.4
4. From 0.4 to 0.5
5. From 0.5 to 0.6
6. From 0.6 to 0.7
7. From 0.7 to 0.8
8. From 0.8 to 0.9
9. From 0.9 to 2.0
10. From 2.0 to 2.1
11. From 2.1 to 2.2
12. From 2.2 to 2.3
13. From 2.3 to 2.4

## From 0.1 to 0.2

- DOS sessions can now access ext2fs partitions. WinOS2 sessions can also, but they crash randomly and I couldn't figure out why yet !
- The per volume disk cache size is now user configurable from 64 Kb to 60 * 64 Kb. However it is not evident that a huge disk cache will improve performance significantly : the cache lookup algorithm is still primitive (single LRU list).
- Sources are now included
- FS_FINDFIRST, FS_FINDNEXT and FS_FINDFROMNAME now use the same lookup routine
- The directory entry cache is now implemented (identical to the Linux one)
- readdir() now uses the original ext2_readdir() routine instead of a quick (and somewhat dirty) rewrite
- FS_FSINFO now returns a 'true' volume serial number instead of garbage. This volume serial number is a CRC checksum of sector 0.
- FS_MOUNT now checks for a previous instance of the volume to be mounted, instead of remounting blindly a previously mounted volume.
- FS_MOUNT with MOUNT_RELEASE flag now closes the volume and frees memory
- brelse() no longer produces a system halt (trap D) when receiving a NULL buffer : it now ignores it like its Linux counterpart
- Direct access opens (OPEN_FLAGS_DASD) are now supported in both read only and readwrite modes
- Write capabilities added :
  - FS_MKDIR and FS_RMDIR implemented
  - FS_SHUTDOWN implemented
  - FS_OPENCREATE in writeonly and readwrite mode implemented
  - FS_WRITE implemented
  - FS_DELETE implemented
- FS_CLOSE now calls ext2_release_file() when the last instance of a file is closed
- "-cache:<disk cache size>" Command line parameters added to set the per volume disk cache size
- "-q" command line parameter added (quiet initialisation)
- "-rw" command line parameter added (write access allowed)
- The memory I-node management routines (iput() iget() ...) are now a port of their Linux counterparts instead of a rewrite.
- Linux scheduling and semaphore management routines (sleep_on(), wake_up() down() up() ...) have been rewritten using ProcBlock/ProcRun device helpers instead of FSH_SEMxxx : now their behaviour should be identical to their Linux counterparts.
- The mount process is now almost identical as in ext2fs.
- When OS/2 mounts a ext2fs partition, it sets the mount count to the maximum to force Linux to autocheck ext2fs partitions "touched" by OS/2.
- Buffer head structures now *NEVER* reach segment boundaries : this avoids TREMENDOUS problems with some ext2fs routines (ext2_add_entry() ...) which do some pointer arithmetics which simply don't work in a 16:16 memory model.

## From 0.2 to 0.3

- There is now a translation from Linux error codes (those in linux/errno.h) to OS/2 error codes (bseerr.h). Now for instance, cmd.exe says "Directory not empty" instead of "Cannot find message 65503". This translation currently occurs in FS_READ, FS_WRITE, FS_RMDIR , FS_DELETE, FS_MOVE and FS_MKDIR.
- FS_COPY() is now supported (in fact emulated by the OS/2 kernel). It was just a matter of returning ERROR_CANNOT_COPY from FS_COPY() - this makes the kernel emulate the copy operation - instead of ERROR_NOT_SUPPORTED. This applies only to copy operations inside or between ext2fs partitions.
- Some cleanup in the code, by removing much direct ext2fs call and replacing them by Linux VFS style calls (inode->i_op-read() for instance instead of ext2_file_read()). This would ease te work of people trying to port other Linux file systems to OS/2.
- FS_MOVE is now implemented.
- Corrected a bug in FS_DevHelp_ProcBlock : register di was not preserved across the call, causing some random trap D.
- Corrected a bug in read_inode when in DASD mode (OPEN_FLAGS_DASD) : some I-node fields are now properly initialized ; This was preventing FS_READ to work on a direct access handle (inode-i_mode was 0 and FS_READ reported "not a regular file").
- Suppressed strict locking of buffers : now buffers can be used more than once, conforming to Linux buffers (no more mutex in getblk and brelse), some ext2fs routines do rely on it (ext2_rename) ... ext2-os2 on OS/2 for SMP is not for tomorrow !!
- Added -no_auto_fsck command line switch to disable the forced e2fsck when Linux mounts a partition "touched" by OS/2.
- Added code to close remaining open files at shutdown. Normally they shouldn't be any, but the WPS lets some pending search handles (DosFindxxx) ; this could result in file system corruption (a search handle on a directory later deleted for instance : the deletion is not committed until all references to the directory are closed).
- Synchronous files (OPEN_FLAGS_WRITE_THROUGH and OPEN_FLAGS_NO_CACHE) should be now handled correctly.

## From 0.3 to 0.4

- Corrected a bug in FS_MOUNT that caused a system halt (trap D) when loading the WinOS2 file manager and ext2-os2 not being the last IFS statement in CONFIG.SYS
- Corrected a bug in FS_CLOSE that caused some random file system corruption : ext2_release_file() was not correctly called.
- Now FS_OPENCREATE opens only regular files, as it seems to be the default OS/2 behaviour. (FS_OPENCREATE no longer opens directories).
- Added the -trace option to ext2-os2.exe : ext2d.exe is no longer necessary.
- Now ext2-os2.exe correctly ends conversation with the IFS when being closed.
- ext2flt has been upgraded from V1.2 to V1.2b
- During shutdown the flush mechanism could be disturbed if other activity (lw daemon ...) was taking place (resulting in potential file and/or file system corruption). This has been corrected.
- The famous random trap D at CS:EIP=<any cs>:142e occuring at boot time should now be corrected ... It was in fact a trap occuring inside the Microsoft Visual C++ runtime library, only under retail OS/2 kernel (no trap at all under kernel debugger !). After having taken 5 or 6 system dumps I realized it was because somewhere an INT 21h call was issued inside the vsprintf() routine. I changed vsprintf() for the Linux kernel one.

## From 0.4 to 0.5

- Added support for strategy 2 I/O for non removable medias (for block devices that support it !). This results in huge perfomance improvements : throughput can be 5 times better than with standard I/O in some circumstances (large file read/write).
- Improved and corrected many bugs concerning time stamping of regular files (last access date/time and last write date/time should now reflect the reality !) - Time stamping of directories is yet to be improved.
- Corrected a bug in ll_rw_block() that could cause some file/file system corruption in rare circumstances.
- Some cleanup in the source code : removed some inline assembly, improved init routines ....
- Added support for the standard DosFsCtl function 1 call (get extended error info).
- Added a first version of the VFSAPI library : it currently implements the stat(), fstat() and sync() calls.
- DosResetBuffer is now supported (FS_COMMIT entry point).
- Disk cache management has been completely rewritten : the disk cache code is now a port of the Linux buffer management code (dynamic disk cache size)
- ext2-os2.exe is now a PM application, and can now monitor some data from ext2-os2.ifs.
- Changed many FSH_PROBEBUF into VMLock/VMUnlock pairs so that user buffers passed to the IFS can't be freed by other threads.
- Added -case_retensive command line option to make ext2-os2.ifs behave like HPFS (case is not significant but kept within the file system, for instance File and FILE are considered to be the same file). This fixes MANY apps which uppercase file names, but there's a risk of loosing data if 2 files with the same case exists in the same directory (see usage information for details).
- Added command line switches to trace some IFS entry points (for instance -FS_MKDIR will trace FS_MKDIR calls). This makes the debug version of ext2-os2.ifs (ext2d.ifs) no longer necessary.
- Deon van der Westhuysen's ext2flt.flt has been updated to version 1.2c in this package. I recompiled ext2flt.flt with MS Visual C++ simply because I don't have borland C++, and I needed to temporarily include some debugging code to solve problems with strategy 2 I/Os (in fact the problems were in OS2DASD.DMD !). Normally this "MS Visual C++" version should behave absolutely like the original Borland compiled version. But in case you prefer using the original version, you can find it on ftp-os2.nmsu.edu (/os2/diskutil/e2flt12c.zip) or on quark.cs.sun.ac.za (/pub/ext2flt/e2flt12c.zip). See the file ext2flt/makefile.msc for details.
- File systems greater than 2 Gb should now be mounted correctly.
- Many other changes !

## From 0.5 to 0.6

- Corrected a bug in FS_NEWSIZE : the I-node wasn't marked dirty after the size change. This resulted in random truncation failures.
- Corrected a bug in FS_OPENCREATE : When creating a new file or replacing an existing one (OPEN_ACTION_REPLACE_IF_EXISTS or OPEN_ACTION_CREATE_IF_NEW) the new file size passed to the IFS was ignored, this resulted in truncation failures.
- DosSetFileInfo is now supported for level 1 : it will change the file dates. Level 2 (used to store or change EAS) is ignored because ext2fs doesn't support EAS.
- DosSetPathInfo is now supported for level 1 : it will change the file dates. Level 2 (used to store or change EAS) is ignored because ext2fs doesn't support EAS.
- Corrected a *STUPID* bug that caused a system halt at boot time with message "EXT2-os2 : buffer_init() - Couldn't allocate disk block hash table" when the max. cache size was not set on the IFS command line. If not set, the cache size remained uninitialized (0) instead of getting its default value...hence the system halt when trying to allocate a 0 length buffer.
- Corrected a bug in date_dos2unix ; it made FS_CLOSE write incorrect file times to disk (file dates were OK).
- The time zone is now taken into account by ext2-os2.ifs. This makes ext2-os2.ifs reflects file time stamps in local time instead of UTC (ext2-os2.ifs and linux times should now match). The time zone is set in CONFIG.SYS through the EXT2_TZ environment variable (minutes from UTC).
- Trace for the following entry points has been added :
  - FS_PATHINFO
  - FS_FILEATTRIBUTE
  - FS_FILEINFO
  - FS_PROCESSNAME
- Optimized a little bit the use of iget/iput in FS_DELETE and FS_OPENCREATE.
- Corrected some bugs related to time stamping. ext2-os2.ifs no longer let the kernel do the time stamping, but does it itself. For instance when copying a file on an ext2fs file system, the file creation date should now be the one from the original file.
- ext2-os2.exe now traces the use of iput and iget routines.
- changed the panic code.
- addded the -errors=[panic|cont] command line parameter
- Setting or clearing the DOS READONLY attribute is now supported (FS_FILEATTRIBUTE, FS_FILEINFO and FS_PATHINFO).

## From 0.6 to 0.7

- changed the EXT2_TZ valid range from [-720;720] to [-1440;1440] so that every countries can be supported (New Zeland has a 13 hour shift from UTC ...)
- corrected a major bug in sys_bdflush that made the system hang when ext2_lw.exe was loaded before any Linux partitions are mounted.
- corrected a time stamp problem in FS_COMMIT.

## From 0.7 to 0.8

- corrected a bug that prevented negative values to be specified for the EXT2_TZ environment variable.
- corrected a bug in FS_OPENCREATE that caused a truncation failure when OPEN_ACTION_REPLACE_IF_EXISTS was set and a non zero file size was passed.
- corrected a problem in bdflush() that made IOSTONE giving ridiculously small results. After that IOSTONE results on my antic IDE disk jumped from 80 (no it's not a typo!) to 2500.
- changed a compiler option : now only externally called routines load DS on entry. This allows better optimization.
- now DGROUP is compeletely fixed in memory (instead of only EXT2_FIXED_DATA), because I discovered that the compiler sometimes makes references to some internal data in CONST segment (it seems to create selector aliases for optimization I think). This could cause a trap E in routines called in interrupt context if CONST was swapped out. I simplified DevHelp bindings in devhelp2.asm accordingly.
- added debug output to COM ports (COM1 or COM2).
- added boot capability to ext2-os2 (wrote a micro FSD and a mini FSD).

## From 0.8 to 0.9

- corrected a bug in the file table management code. I incorrectly assumed that FSH_SEGALLOC returned zeroed memory and this could cause a system halt in put_last_in_list saying the used list was corrupted.
- corrected a race condition problem in the file table management code.

## From 0.9 to 2.0

- Corrected yet another bug in FS_NEWSIZE
- Corrected (I hope) a bug that could make ext2-os2 crash when HPOFS.IFS/MO.SYS are present.
- Implemented swapper entry points : now SWAPPER.DAT can be put on a Linux ext2fs partition.
- Rewrote the mount/unmount/shutdown mechanism (including superblock allocation).
- Ported the whole ext2-os2.ifs to 32 bits. (this introduced many small changes).

## From 2.0 to 2.1

- Added support for e2fsck and mke2fs
- Improved lookup routines a lot (rewrote open_by_name to use dir_namei instead of readdir).
- Replaced some DevHlp32_VirtToLin calls with faster VDHQueryLin calls.
- Replaced references to TKSSBase in mwdd32.sys with _TKSSBase in MVMD.DLL (this one has one indirection level less).
- Corrected a bug in iput when freeing a "DASD" mode inode (i_dirt was not cleared).
- Overall performance greatly improved (on my machine, IOSTONE benchmark jumped from 4000 to almost 30000, with 4096 Kb cache)
- Corrected a bug in do_ext2_rename (it caused a trap D when renaming a directory).
- The lazy writer thread in ext2_lw.exe now has a time critical priority; This corrects low I/O throughput problem while other processes hog the CPU.
- Now this 32 bits version of ext2-os2 has the same boot capabilities as the 16 bits version.
- Ext2flt.flt no longer write protects sector 0 of virtual linux partitions. This change was necessary to make mke2fs and e2fsck work.
- Corrected a bug in the ext2-os2 log facility (ext2-os2.exe was hogging 100 % of the CPU).
- Added the -force_strat2 option to force use of strategy 2 I/O (if available) on removable media. The purpose of this option is to allow fast access to PCMCIA hard drives and such, which are generally seen by OS/2 as large floppies (and thus can only be formatted as FAT).

## From 2.1 to 2.2

- Corrected a stupid packaging error : microfsd.fsd and minifsd.fsd were not included in the distribution.
- Corrected a thunking problem in vfs_stat
- Corrected a thunking problem in vfs_fstat
- Added support to create hard links from OS/2 (new VFSAPI entry point : vfs_link, new utility : hardlink.exe)

## From 2.2 to 2.3

- Corrected a bug in fsh32_qsysinfo that made ext2-os2 use case insensitive comparisions, even if the -case_retensive option was not set.
- Corrected several problems in microfsd.fsd and minifsd.fsd.
- Added the umount.exe and remount.exe utilities for better removable media support.
- Corrected a problem in the mount process that made FSH_DOVOLIO fail with a weird error when formatting a drive. Now ext2fs_check_magic operates with the NO_CACHE flag set.
- mke2fs now properly tells the user to run badblocks separately, instead of crashing.
- mke2fs now writes a DOS compatible boot sector in sector 0 and the media type in sector 1, to avoid problems with an old time OS/2 bug : OS/2 incorrectly prevents FLOPPIES with non DOS boot records to be accessed by an IFS.
- Installation default is now to use ERRORS=CONTINUE instead of ERRORS=PANIC option, in order to make mke2fs and e2fsck work without halting the system in case of an unexpected error.

## From 2.3 to 2.4

- Corrected a memory overflow problem in microfsd.fsd that prevented OS/2 to boot from huge (Gigabyte range) ext2 partitions.
- Increased the maximum number of Linux partitions in EXT2FLT.FLT from 16 to 26.
- Removed the 2 Gb limit in e2fsck, mke2fs and badblocks.
- Rewrote badblocks in a more OS/2 like style (makes use of the DSK_VERIFYTRACK IOCTL instead of a standard read() call). It can now be safely invoked through mke2fs's -c switch.
- Now uext2.dll correctly removes FORMAT.COM specific options before calling mke2fs.exe (eg. FORMAT X:: /FS:ext2 no longer fails).
- Updated e2fsck and mke2fs from version 1.06 (e2fsprogs-1.06) to 1.10 (e2fsprogs-1.10).
- Added a port of debugfs, chattr, lsattr and tune2fs.
- Added path optimization : when relevant, directory lookup is now starting from current directory and not from root directory.
- Corrected some time stamping related problems that made the "make" utility fail in some cases.
- Corrected a race condition in the buffer cache code that could cause a tight lockup in heavy I/O situations.
- Volume labels are now supported and can be modified from OS/2, they are limited by the kernel to 11 characters (Linux ext2 volume names can be 16 characters long, ext2-os2 truncates them to 11 characters). They can be queried or set either through the OS/2 label or vol commands, or throught tune2fs.
- The volume serial number is now a 32 bits CRC of the Linux ext2 UUID (the uuid is a 128 bits unique identifier present in the superblock. This is now a standard feature of the Linux ext2 file system).

# FootNote 1

    		    GNU GENERAL PUBLIC LICENSE
    		       Version 2, June 1991
     Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                              675 Mass Ave, Cambridge, MA 02139, USA
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
    			    Preamble
      The licenses for most software are designed to take away your
    freedom to share and change it.  By contrast, the GNU General Public
    License is intended to guarantee your freedom to share and change free
    software--to make sure the software is free for all its users.  This
    General Public License applies to most of the Free Software
    Foundation's software and to any other program whose authors commit to
    using it.  (Some other Free Software Foundation software is covered by
    the GNU Library General Public License instead.)  You can apply it to
    your programs, too.
      When we speak of free software, we are referring to freedom, not
    price.  Our General Public Licenses are designed to make sure that you
    have the freedom to distribute copies of free software (and charge for
    this service if you wish), that you receive source code or can get it
    if you want it, that you can change the software or use pieces of it
    in new free programs; and that you know you can do these things.
      To protect your rights, we need to make restrictions that forbid
    anyone to deny you these rights or to ask you to surrender the rights.
    These restrictions translate to certain responsibilities for you if you
    distribute copies of the software, or if you modify it.
      For example, if you distribute copies of such a program, whether
    gratis or for a fee, you must give the recipients all the rights that
    you have.  You must make sure that they, too, receive or can get the
    source code.  And you must show them these terms so they know their
    rights.
      We protect your rights with two steps: (1) copyright the software, and
    (2) offer you this license which gives you legal permission to copy,
    distribute and/or modify the software.
      Also, for each author's protection and ours, we want to make certain
    that everyone understands that there is no warranty for this free
    software.  If the software is modified by someone else and passed on, we
    want its recipients to know that what they have is not the original, so
    that any problems introduced by others will not reflect on the original
    authors' reputations.
      Finally, any free program is threatened constantly by software
    patents.  We wish to avoid the danger that redistributors of a free
    program will individually obtain patent licenses, in effect making the
    program proprietary.  To prevent this, we have made it clear that any
    patent must be licensed for everyone's free use or not licensed at all.
      The precise terms and conditions for copying, distribution and
    modification follow.

    		    GNU GENERAL PUBLIC LICENSE
       TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
      0. This License applies to any program or other work which contains
    a notice placed by the copyright holder saying it may be distributed
    under the terms of this General Public License.  The "Program", below,
    refers to any such program or work, and a "work based on the Program"
    means either the Program or any derivative work under copyright law:
    that is to say, a work containing the Program or a portion of it,
    either verbatim or with modifications and/or translated into another
    language.  (Hereinafter, translation is included without limitation in
    the term "modification".)  Each licensee is addressed as "you".
    Activities other than copying, distribution and modification are not
    covered by this License; they are outside its scope.  The act of
    running the Program is not restricted, and the output from the Program
    is covered only if its contents constitute a work based on the
    Program (independent of having been made by running the Program).
    Whether that is true depends on what the Program does.
      1. You may copy and distribute verbatim copies of the Program's
    source code as you receive it, in any medium, provided that you
    conspicuously and appropriately publish on each copy an appropriate
    copyright notice and disclaimer of warranty; keep intact all the
    notices that refer to this License and to the absence of any warranty;
    and give any other recipients of the Program a copy of this License
    along with the Program.
    You may charge a fee for the physical act of transferring a copy, and
    you may at your option offer warranty protection in exchange for a fee.
      2. You may modify your copy or copies of the Program or any portion
    of it, thus forming a work based on the Program, and copy and
    distribute such modifications or work under the terms of Section 1
    above, provided that you also meet all of these conditions:

        a) You must cause the modified files to carry prominent notices
        stating that you changed the files and the date of any change.
        b) You must cause any work that you distribute or publish, that in
        whole or in part contains or is derived from the Program or any
        part thereof, to be licensed as a whole at no charge to all third
        parties under the terms of this License.
        c) If the modified program normally reads commands interactively
        when run, you must cause it, when started running for such
        interactive use in the most ordinary way, to print or display an
        announcement including an appropriate copyright notice and a
        notice that there is no warranty (or else, saying that you provide
        a warranty) and that users may redistribute the program under
        these conditions, and telling the user how to view a copy of this
        License.  (Exception: if the Program itself is interactive but
        does not normally print such an announcement, your work based on
        the Program is not required to print an announcement.)

    These requirements apply to the modified work as a whole.  If
    identifiable sections of that work are not derived from the Program,
    and can be reasonably considered independent and separate works in
    themselves, then this License, and its terms, do not apply to those
    sections when you distribute them as separate works.  But when you
    distribute the same sections as part of a whole which is a work based
    on the Program, the distribution of the whole must be on the terms of
    this License, whose permissions for other licensees extend to the
    entire whole, and thus to each and every part regardless of who wrote it.
    Thus, it is not the intent of this section to claim rights or contest
    your rights to work written entirely by you; rather, the intent is to
    exercise the right to control the distribution of derivative or
    collective works based on the Program.
    In addition, mere aggregation of another work not based on the Program
    with the Program (or with a work based on the Program) on a volume of
    a storage or distribution medium does not bring the other work under
    the scope of this License.
      3. You may copy and distribute the Program (or a work based on it,
    under Section 2) in object code or executable form under the terms of
    Sections 1 and 2 above provided that you also do one of the following:

        a) Accompany it with the complete corresponding machine-readable
        source code, which must be distributed under the terms of Sections
        1 and 2 above on a medium customarily used for software interchange; or,
        b) Accompany it with a written offer, valid for at least three
        years, to give any third party, for a charge no more than your
        cost of physically performing source distribution, a complete
        machine-readable copy of the corresponding source code, to be
        distributed under the terms of Sections 1 and 2 above on a medium
        customarily used for software interchange; or,
        c) Accompany it with the information you received as to the offer
        to distribute corresponding source code.  (This alternative is
        allowed only for noncommercial distribution and only if you
        received the program in object code or executable form with such
        an offer, in accord with Subsection b above.)
    The source code for a work means the preferred form of the work for
    making modifications to it.  For an executable work, complete source
    code means all the source code for all modules it contains, plus any
    associated interface definition files, plus the scripts used to
    control compilation and installation of the executable.  However, as a
    special exception, the source code distributed need not include
    anything that is normally distributed (in either source or binary
    form) with the major components (compiler, kernel, and so on) of the
    operating system on which the executable runs, unless that component
    itself accompanies the executable.
    If distribution of executable or object code is made by offering
    access to copy from a designated place, then offering equivalent
    access to copy the source code from the same place counts as
    distribution of the source code, even though third parties are not
    compelled to copy the source along with the object code.

      4. You may not copy, modify, sublicense, or distribute the Program
    except as expressly provided under this License.  Any attempt
    otherwise to copy, modify, sublicense or distribute the Program is
    void, and will automatically terminate your rights under this License.
    However, parties who have received copies, or rights, from you under
    this License will not have their licenses terminated so long as such
    parties remain in full compliance.
      5. You are not required to accept this License, since you have not
    signed it.  However, nothing else grants you permission to modify or
    distribute the Program or its derivative works.  These actions are
    prohibited by law if you do not accept this License.  Therefore, by
    modifying or distributing the Program (or any work based on the
    Program), you indicate your acceptance of this License to do so, and
    all its terms and conditions for copying, distributing or modifying
    the Program or works based on it.
      6. Each time you redistribute the Program (or any work based on the
    Program), the recipient automatically receives a license from the
    original licensor to copy, distribute or modify the Program subject to
    these terms and conditions.  You may not impose any further
    restrictions on the recipients' exercise of the rights granted herein.
    You are not responsible for enforcing compliance by third parties to
    this License.
      7. If, as a consequence of a court judgment or allegation of patent
    infringement or for any other reason (not limited to patent issues),
    conditions are imposed on you (whether by court order, agreement or
    otherwise) that contradict the conditions of this License, they do not
    excuse you from the conditions of this License.  If you cannot
    distribute so as to satisfy simultaneously your obligations under this
    License and any other pertinent obligations, then as a consequence you
    may not distribute the Program at all.  For example, if a patent
    license would not permit royalty-free redistribution of the Program by
    all those who receive copies directly or indirectly through you, then
    the only way you could satisfy both it and this License would be to
    refrain entirely from distribution of the Program.
    If any portion of this section is held invalid or unenforceable under
    any particular circumstance, the balance of the section is intended to
    apply and the section as a whole is intended to apply in other
    circumstances.
    It is not the purpose of this section to induce you to infringe any
    patents or other property right claims or to contest validity of any
    such claims; this section has the sole purpose of protecting the
    integrity of the free software distribution system, which is
    implemented by public license practices.  Many people have made
    generous contributions to the wide range of software distributed
    through that system in reliance on consistent application of that
    system; it is up to the author/donor to decide if he or she is willing
    to distribute software through any other system and a licensee cannot
    impose that choice.
    This section is intended to make thoroughly clear what is believed to
    be a consequence of the rest of this License.

      8. If the distribution and/or use of the Program is restricted in
    certain countries either by patents or by copyrighted interfaces, the
    original copyright holder who places the Program under this License
    may add an explicit geographical distribution limitation excluding
    those countries, so that distribution is permitted only in or among
    countries not thus excluded.  In such case, this License incorporates
    the limitation as if written in the body of this License.
      9. The Free Software Foundation may publish revised and/or new versions
    of the General Public License from time to time.  Such new versions will
    be similar in spirit to the present version, but may differ in detail to
    address new problems or concerns.
    Each version is given a distinguishing version number.  If the Program
    specifies a version number of this License which applies to it and "any
    later version", you have the option of following the terms and conditions
    either of that version or of any later version published by the Free
    Software Foundation.  If the Program does not specify a version number of
    this License, you may choose any version ever published by the Free Software
    Foundation.
      10. If you wish to incorporate parts of the Program into other free
    programs whose distribution conditions are different, write to the author
    to ask for permission.  For software which is copyrighted by the Free
    Software Foundation, write to the Free Software Foundation; we sometimes
    make exceptions for this.  Our decision will be guided by the two goals
    of preserving the free status of all derivatives of our free software and
    of promoting the sharing and reuse of software generally.
    			    NO WARRANTY
      11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    REPAIR OR CORRECTION.
      12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
    INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGES.
    		     END OF TERMS AND CONDITIONS

    	Appendix: How to Apply These Terms to Your New Programs
      If you develop a new program, and you want it to be of the greatest
    possible use to the public, the best way to achieve this is to make it
    free software which everyone can redistribute and change under these terms.
      To do so, attach the following notices to the program.  It is safest
    to attach them to the start of each source file to most effectively
    convey the exclusion of warranty; and each file should have at least
    the "copyright" line and a pointer to where the full notice is found.
        <one line to give the program's name and a brief idea of what it does.>
        Copyright (C) 19yy  name of author
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    Also add information on how to contact you by electronic and paper mail.
    If the program is interactive, make it output a short notice like this
    when it starts in an interactive mode:

        Gnomovision version 69, Copyright (C) 19yy name of author
        Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
        This is free software, and you are welcome to redistribute it
        under certain conditions; type `show c' for details.
    The hypothetical commands `show w' and `show c' should show the appropriate
    parts of the General Public License.  Of course, the commands you use may
    be called something other than `show w' and `show c'; they could even be
    mouse-clicks or menu items--whatever suits your program.
    You should also get your employer (if you work as a programmer) or your
    school, if any, to sign a "copyright disclaimer" for the program, if
    necessary.  Here is a sample; alter the names:

      Yoyodyne, Inc., hereby disclaims all copyright interest in the program
      `Gnomovision' (which makes passes at compilers) written by James Hacker.
      signature of Ty Coon, 1 April 1989
      Ty Coon, President of Vice
    This General Public License does not permit incorporating your program into
    proprietary programs.  If your program is a subroutine library, you may
    consider it more useful to permit linking proprietary applications with the
    library.  If this is what you want to do, use the GNU Library General
    Public License instead of this License.

# FootNote 2

This is an example where drive letters won't be changed when you toggle the ext2fs partition ID from 0x83 to 0x7. ext2flt gives the same result without having to alter the partition table.

Before

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       OS/2              07      C:    Extended         Bootable
      1       Linux ext2fs      83      -     Extended         Bootable   <=== We toggle it from 0x83 ...

If we toggle the ext2fs partition type

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       OS/2              07      C:    Extended         Bootable
      1       Linux ext2fs      07      D:    Extended         Bootable   === ... to 0x07

If we use ext2flt.flt

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       OS/2              07      C:    Extended         Bootable
      2       Linux ext2fs      07      D:    Extended

The pink partition is the one as shown by ext2flt.flt to OS/2.

# FootNote 3

In this case, the OS/2 drive letter is changed from C: to D: when you change the Linux partition ID. If you want to use the ext2 IFS driver you'll have to use ext2flt.flt so that the ext2fs partition appears after the OS/2 partition.

Before

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       Linux ext2        83      -     Primary          Bootable   <=== We toggle it from 0x83 ...
      1       OS/2 System       07      C:    Extended         Bootable

If we toggle the partiton ID, the drive letters change :

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       Linux ext2        07      C:    Primary          Bootable   === ... to 0x07
      1       OS/2 System       07      D:    Extended         Bootable

The solution is to use ext2flt.flt :

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       OS/2 System       07      C:    Extended         Bootable
      2       Linux ext2        07      D:    Extended

The pink partition is the one as shown by ext2flt.flt to OS/2.

# FootNote 4

In this case, you cannot use the ext2 IFS driver alone and you are a good candidate for using ext2flt.flt. This is because only ONE primary partition can be active. ext2flt.flt will make your ext2fs partition appear as an extended volume located after your OS/2 partition.

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       Linux ext2        83      -     Primary          Bootable
      1       OS/2 System       07      C:    Primary (active) Bootable

If we use ext2flt.flt :

    Physical  Description  Partition  Drive   Type             Status
      drive                     ID    letter
      1       Boot mgr          0a      -     -                Startable
      1       OS/2 System       07      C:    Primary (active) Bootable
      2       Linux ext2        07      D:    extended

# FootNote 5

[-q] : quiet initialization of ext2-os2.ifs (no banner during boot). Default is verbose initialization.

# FootNote 6

[-cache:<max. disk cache size>] Specifies the MAXIMUM disk cache size. This value is the maximum amount of physical memory ext2-os2.ifs can dynamically allocate for disk cache buffers. The default value is 240 Kb. The minimum value is 240Kb. The maximum value depends on system resources (free physical memory).

Note : Please read the chapter "Dynamic disk cache considerations"

# FootNote 7

[rw] : enable write access. Default is write disabled.

Note : If you use ext2flt, don't forget to enable write access on the ext2flt.flt command line. (/W switch)

WARNING - BEFORE ENABLING WRITE ACCESS, REMEMBER THAT DOING REGULAR BACKUPS IS NEVER A BAD PRACTICE !!!

# FootNote 8

[-no_auto_fsck] : prevents ext2-os2 from forcing Linux to run e2fsck on partitions "touched" by OS/2 Default is to force Linux to run e2fsck.

Note : Please read the chapter "Automatic check disk"

# FootNote 9

[-case_retensive] : makes ext2-os2.ifs behave like HPFS. If this option is set, case will not be significant but will be retained within the file system. For instance File and FILE are considered to be the same file. Default is case sensitive.

WARNING - PLEASE READ "Case sensitivity considerations" BEFORE USING THIS OPTION !!!

# FootNote 10

[-<IFS entry point to trace>] : traces a specific IFS entry point. Using this option makes ext2-os2.ifs produce an output in ext2-os2.exe whenever the specified IFS entry point is entered. You can specify several IFS entry points to trace for instance "IFS=ext2-os2.ifs -FS_MKDIR -FS_RMDIR".

Note : Please notice that tracing will have a performance hit (can be important).

Currently supported IFS entry points for tracing are :

- FS_ALLOCATEPAGESPACE
- FS_CHDIR
- FS_CHGFILEPTR
- FS_CLOSE
- FS_COMMIT
- FS_COPY
- FS_DELETE
- FS_DOPAGEIO
- FS_EXIT
- FS_FILEATTRIBUTE
- FS_FILEINFO
- FS_FINDCLOSE
- FS_FINDFIRST
- FS_FINDFROMNAME
- FS_FINDNEXT
- FS_FLUSHBUF
- FS_FSINFO
- FS_IOCTL
- FS_MKDIR
- FS_MOUNT
- FS_MOVE
- FS_NEWSIZE
- FS_OPENCREATE
- FS_OPENPAGEFILE
- FS_PATHINFO
- FS_PROCESSNAME
- FS_READ
- FS_RMDIR
- FS_SHUTDOWN
- FS_WRITE

# FootNote 11

[-no_strat2] : disable use of extended I/O operations (strategy 2 calls). Default is to use them on fixed disks when they are supported by the block device driver. Normally it works well with OS2DASD.DMD, but if you encounter problems with extended I/O with other drivers, you can disable them.

Note : Using extended I/O results in HUGE performance improvements ; disabling them with have a tremendous performance hit.

# FootNote 12

[-errors=[panic|continue]] : specifies the behaviour to adopt when the ext2fs file system code detects an error within the file system. "panic" halts the system, "continue" makes ext2-os2 only output a message in ext2-os2.exe and continue. Default is "continue" (like Linux).

Note : If a system halt occurs with a message beginning with "ext2-os2 detected a file system error on drive %c", it means that the ext2fs file system code found a file system corruption. You MUST run e2fsck from Linux to repair your file system. This type of error is generally not specific to ext2-os2, but the error would also have occured on Linux. "-errors=continue" will avoid a system halt and just mark the file system as bad (forcing e2fsck on next Linux boot) ; but if you continue to work intensively after a file system error, you are likely to spread the error and make things even worse.

# FootNote 13

[-output=[com1|com2]] : Makes ext2-os2 write its messages on COM1 or COM2 port in addition to the ext2-os2 monitor.

Note : Output to COM ports has a performance hit, but can be necessary for tracing or debugging in some cases.

# FootNote 14

[-tz:<time zone in minutes from UTC>] : Sets the time zone to be taken into account for file dates and times. Please read Time zone considerations.

# FootNote 15

[-force_strat2:<removable drive number to be forced to use strat 2 I/O>]

Force a removable media to use strategy 2 I/O (if available). Normally ext2-os2 uses strategy 2 I/O only for fixed disks. For certain large removable media like MO drives or PCMCIA hard drives which are seen by OS/2 as large floppies (and thus cannot be formatted as HPFS, nor use lazy writes), using strategy 2 I/O can DRAMATICALLY improve performance. But you MUST leave the drive in its media and NEVER remove it while running. If you want to remove the drive anyway, you MUST unmount it first using the unmount.exe utility. This option can make sense for a PCMCIA drive (for instance I have a Thinkpad with a 260 Mb PCMCIA hard disk. I use this option to speed up access to this drive).

Note : The drive number on the command line is 0 based : 0 means 'A', 1 means 'B' and so on.

# FootNote 16

/Q : Quiet install. Prevents the filter from displaying messages.

# FootNote 17

/V : Verbose install. Displays some diagnostic messages.

# FootNote 18

/W : Allows the virtual partitions to be written to.

# FootNote 19

/A : Virtualize all partitions found. The only good reason to use this is along with the /M option when you want to control the mounting order of all the partitions. You must use the /W option if you use the /A option; otherwise OS/2 may crash when it tries to write to the partition.

Note : Using the /A option may change your drive letters causing the your system to be unbootable. Use the /M option together with /A. (This may change in the future.

# FootNote 20

/M <mount list> : Mounts the partitions in the order specified in the mount list, which should be a list of numbers separated by commas. The partitions are numbered 0 on a first come basis. (Not the OS/2 uses.)

# FootNote 21

IBM Visualage C++ version 3.0 for OS/2.

Note : The CSD CTC305 is highly recommended.

# FootNote 22

IBM Assembly Language Processor (ALP) version 4.00.

Note : Earlier versions of ALP will NOT work.

# FootNote 23

Microsoft Visual C++ 1.51.

Note : This is actually MSC version 8.0c and is available as the 16 bits compiler in the MS Visual C++ 2.0 package.

# FootNote 24

Borland C++ version 4

# FootNote 25

Microsoft Assembler (MASM) 5.10A.15

Note : This is the version of MASM included in the DevCon DDK.

# FootNote 26

Borland Turbo Assembler (available with Borland C++ 4)

# FootNote 27

IBM Linker for OS/2 (ILink) version 1.

Note : This is the version of ILINK included in the IBM Visualage C++ package, with CSD CTC305 installed (ILINK version 01.04.r1a_CTC305A).

# FootNote 28

Microsoft Linker (LINK) version 5.6.

Note : This is the version of LINK included in the Microsoft Visual C++ version 2.0 package.

# FootNote 29

linux fdisk 3.04 output for disk 1 (this is actually an OS/2 port of fdisk : 1:1 means /dev/hda1 and so on) :

    fdisk -uS -l 1:
    Disk 1:: 6 heads, 35 sectors, 978 cylinders
    Units = sectors of 512 bytes, counting from 0
       Device Boot    Start       End  #sectors  Id  System
          1:1          2100    104579    102480  83  Linux native
          1:2   *        35      2099      2065   a  OS/2 Boot Manager or Coherent swap
          1:3        104580    205379    100800   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX
          1:4             0         -         0   0  Empty

OS/2 fdisk output for disk 1 :

    FDISK /QUERY /DISK:1
    Drive Name  Partition Vtype FStype Status   Start     Size
        1              :    1    0a      2          0        1
        1 Linux        :    1    83      1          1       50
        1 test        C:    1    07      5         51       49
                                                 **BIOS:1024MB

# FootNote 30

linux fdisk 3.04 output for disk 2 (this is actually an OS/2 port of fdisk : 1:1 means /dev/sda1 and so on) :

    fdisk -uS -l 2:
    Disk 2:: 64 heads, 32 sectors, 1169 cylinders
    Units = sectors of 512 bytes, counting from 0
       Device Boot    Start       End  #sectors  Id  System
          2:1        163840   2095103   1931264   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX
          2:2   *        32    163839    163808  17  OS/2 BM: hidden IFS
          2:3       2095104   2394111    299008   5  DOS Extended
          2:4             0         -         0   0  Empty
          2:5   *   2095136   2394111    298976   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX

OS/2 fdisk output for disk 2 :

    FDISK /QUERY /DISK:2
    Drive Name  Partition Vtype FStype Status   Start     Size
        2 ext2-os2     :    1    17      3          0       80
        2 Warp        D:    1    07      1         80      943
        2 001ff820    E:    2    07      0       1023      146
                                                 **BIOS:1024MB

# FootNote 31

    #
    # Start LILO global section
    #
    boot = /dev/hda1       # install LILO in the superblock of /dev/hda1.
    vga = normal           # force sane state
    ramdisk = 0            # paranoia setting
    prompt
    #
    # End LILO global section
    #
    # Linux bootable partition config begins
    image = /vmlinuz
      root = /dev/hda1
      label = linux
      read-only            # Non-UMSDOS filesystems should be mounted read-only for checking
    # Linux bootable partition config ends

# FootNote 32

Here's a brief description of what to do to install a WPS enabled system with BOOTOS2 on a LInux ext2fs partition, and put the WPS desktop tree on a HPFS or FAT partition (assume we want to store the WPS tree in D:\tmp\desktop) :

1. Go to the OS2 directory of your boot drive and make a copy of the file named INI.RC (for instance TEST.RC)
2. Edit TEST.RC as follows :

   Locate a line of the form

         "PM_InstallObject" "Desktop;WPDesktop;?:\" "OBJECTID=<WP_DESKTOP>"

3. and replace it with

         "PM_InstallObject" "Desktop;WPDesktop;D:\tmp\desktop" "OBJECTID=WP_DESKTOP"

   Locate a line of the form

         "PM_InstallObject" "Nowhere;WPFolder;?:\"  "OBJECTID=WP_NOWHERE"

4. and replace it with

         "PM_InstallObject" "Nowhere;WPFolder;D:\tmp\nowhere"  "OBJECTID=WP_NOWHERE"

5. Reboot OS/2 FROM FLOPPIES
6. Press F3 to go to a command prompt. At the command prompt, go to the OS2 directory of your hard drive and type :

       MAKEINI BOS2U300.INI TEST.RC

7. Reboot OS/2 normally
8. Go to your BOOTOS2 directory and replace BOS2U300.INI with the one we've created.
9. To install a WPS enabled system type the following command :

       BOOTOS2 TARGET=F TYPE=WPS