Accessing Data On OS/2 JFS Partitions With GNU/Linux Debian.

Yes, OS/2 supports GNU/Linux -with difficulty.

Coming from OS/2 and learning my first GNU/Linux commands at the OS/2 command shell -in an ported public domain Korn shell (ksh) emulated environment- I can not help but peek, once in a while, into the pond from which I emerged. A couple of days ago, I visited the OS/2 World forum and scrolled the initial page for something new. Perhaps, I thought, Serenity Systems International -the last vendor of an fixpacked OS/2 known as eComStation- might have developed an booting procedure or hack that emulated the Linux booting procedure.

If true, I continued submerged in my revery, then I could build an OS/2 instance into an virtual machine to be hosted in an Infrastructure as a Service (IaaS) provider like Amazon. To my dismay, I only found what I regarded as an mundane issue that could be resolved in a jiffy (if an OS/2er were to be a little more open minded) -that of accessing OS/2 created JFS partition from an GNU/Linux distribution.

OS/2 and Lotus SmartSuite WordPro.

In preparation for a migration from an OS/2 installed base to an modern Linux alternative, the user was interested in knowing how to access OS/2 created JFS partitions from an Ubuntu Live distribution. Her/his concerned lied in the fact that whenever he tried to mount an certain OS/2 JFS partition from the Live Ubuntu distribution, the message in his Linux shell output would be along the form:

mount: wrong fs type, bad option, bad superblock on /dev/xyz,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Mounting an unclean OS/2 created JFS partition.

Well I just happened to have reinstalled an Linux Debian unstable distribution. No, the install is not from a “live” CD but it will help to illustrate an potential solution to the OS/2 administrator evaluating methods to migrate existing OS/2 deployments into GNU/Linux.

First of all, to exercise administrative duties in enterprise Linux, the user becomes root (or super user). Please note that from the perspective of Debian cfdisk utility, OS/2 created JFS partitions will be seen as of file system (FS) Type: Unknown (35). The reason may possibly be due to the fact that the LVM.EXE or LVMGUI.CMD disk management utilities of an appropriately upgraded OS/2 require a created physical partition to be of type LVM; otherwise formatting in the OS/2 implementation of Journaling File System (JFS) will not proceed. Hence, the GNU/Linux cfdisk utility does not appear to recognize the type of the OS/2 created partition and regard those as Unknown (35).

Observe the screenshot below:

cfdisk /dev/hda

Using Debian cfdisk utility as root user.

Additionally, note that if you hard drive is IDE, of course, you will see the Primary partitions as hda1, hda2, and hda3. Partition hda4 represents the whole extended partition; when this latter is sub-partitioned, the first extended (sub)partition is hda5, hda6, etc.. Also note from the snapshot that if Primary partitions hda2 and/or hda3 are non existent, their places are reserved; as can be observed, the very first logical (sub)partition skips over the reserved slots for Primary partitions and starts at hda5. Obviously, if your hard disk is SCSI the device seen with the cfdisk utility will be of the form sda1, sda2, etc..

Please note that Red Hat and Fedora, at the very least, may also refer to IDE drives as sda1, sda2, etc.. I just want to call your attention to the fact that under all conditions, you should verify that the Linux operating system and you are on the same page. Fedora 11, in my limited tests, was able to mount JFS partitions. Notwithstanding, for this blog I used Debian.

BACK UP YOUR JFS PARTITIONS DATA.

Avoid unnecessary woes by diligently backing up all your OS/2 JFS partitions data during the migration planning stage. Technology, being a human creation and subject to unanticipated variables, is not perfect.

Additionally, please verify that you have the Debian jfsutils package. As root user, from the command line in your Linux shell you can simply type:

apt-get update

apt-get install jfsutils

Or if you prefer to install those visually with the synaptic package manager, from the Debian desktop menu, select System, Administration, and subsequently press the Synaptic Package Manager item from the cascading options.

Selecting (from Debian menu) Synaptic Package Manager.

Alternatively, as the root user, you may just type:

synaptic

and the package manager will come into existence, as well. Either way you access Synaptic, press the Search button from the wide menu of the utility and when the search utility appears, proceed to enter the text string "jfs" into the field. After some seconds, the jfsutils will be listed among other packages that met the criteria. Selecting the item jfsutils from the list will provide additional information: Utilities for managing IBM's Journaled File System (JFS) under Linux. Hence, after installtion of the package, you will have in your Linux Debian distribution: fsck.jfs, logdump, logredo, mkfs.jfs, xchkdmp, xchklog, xpeek.

Synaptic description of Debian jfsutils.


MAKE SURE YOUR TARGET DEVICE IS NOT MOUNTED.

Reading the man page for jfs_fsck (or fsck.jfs) we note the warning: serious damage may occur if we check a mounted file system in other than READ ONLY access.

man jfs_fsck

Debian man page warns that JFS partition should be unmounted.

After verifying that our target JFS partition(s) is(are) not mounted, and scrolling further down in the man jfs_fsck information, we come across the command to form to check our OS/2 created JFS partiton(s): jfs_fsck -v -f /dev/hdxy.

Debian man jfs_fsck also shows us some hints on proper use.

As an specific example, I selected the 26GB /dev/hda10 seen in the initial cfdisk snapshot at the beginning of this blog. Accordingly, if the hypothetical Linux user xiuhtecuhtli became root (or super user) of his GNU/Linux Debian sytem, he would enter the following command to check and fix (-f) his previous OS/2 created and formatted JFS partition:

jfs_fsck -v -f /dev/hda10

Performing an file system check (and fix) on an dirty OS/2 created JFS partition.

After performing the adequate JFS modifications on the OS/2 partition, the jfs_fsck front end utility for fsck.jfs finishes; and xiuhtecuhtli would be able to mount his 26GB OS/2 created JFS partition in an relevant directory created under /mnt, be typing:

mount /dev/hda10 /mnt/hda10

Debian jfsutils finish (and fix) file system errors in an OS/2 created JFS partition.

Please note that the above procedure will not work on OS/2 Logical Volume Manager (LVM) volumes spanning multiple devices/partitions. If an user tries to access one of the spanned entities composing an OS/2 LVM volume, the mount process will fail; also, if an file system check is performed on a device/partition component of the spanned OS/2 LVM volume, it may corrupt the target. Accordingly, make sure that you know -from the OS/2 side- which units are part of an spanned OS/2 LVM volume. For instance, see this snapshot of an past OS/2 Java-based utility that can be invoked as lvmgui.cmd in your OS/2 command shell environment.

Perspective of OS/2 LVMGui.cmd Java-based disk management utility.

Java 2 SE 1.4.1 native port for OS/2 is by Golden Code Development (GCD).

One final note. If an GNU/Linux root (or super user) mounts an OS/2 created and formatted partition -even if JFS checks and fixes are performed from the Linux side- an regular non-root user will likely not be able to view the contents of that file system. The reason is because all or most of that data will not have appropriate permissions, as seen in this sample ls -l command operating on the directory /mnt/hda10/xxe-std-3_5_1:

ls -l /mnt/hda10/xxe-std-3_5_1

total 28
d--------- 7 root root 256 2007-02-02 18:00 addon/
d--------- 7 root root 4096 2007-02-02 12:17 bin/
d--------- 2 root root 4096 2007-02-24 14:52 binHTML/
d--------- 9 root root 4096 2007-02-01 17:06 demo/
d--------- 17 root root 4096 2007-02-01 17:06 doc/
d--------- 2 root root 256 2007-02-24 12:44 Xiuhtecuhtli/
d--------- 2 root root 4096 2007-02-02 20:13 webstart/
---------- 1 root root 6778 2007-02-24 12:33 XXE-STD-3_5_2.zip

What the OS/2 turned Linux admin needs to do is to apply pertinent permissions to the files so that regular users are able to use and/or access the data. For an specific instance, if the root user needs to modify all the files in a directory to be world readable and or writable (r or w) use the chmod command with -R option to specify recursively all of the files in that directory.

chmod -R a+r /mnt/hda10/xxe-std-3_5_1

ls -l /mnt/hda10/xxe-std-3_5_1

total 28
dr--r--r-- 7 root root 256 2007-02-02 18:00 addon/
dr--r--r-- 7 root root 4096 2007-02-02 12:17 bin/
dr--r--r-- 2 root root 4096 2007-02-24 14:52 binHTML/
dr--r--r-- 9 root root 4096 2007-02-01 17:06 demo/
dr--r--r-- 17 root root 4096 2007-02-01 17:06 doc/
dr--r--r-- 2 root root 256 2007-02-24 12:44 Xiuhtecuhtli/
dr--r--r-- 2 root root 4096 2007-02-02 20:13 webstart/
-r--r--r-- 1 root root 6778 2007-02-24 12:33 XXE-STD-3_5_2.zip

Additionally please note that for an user in Linux to be able to use data s/he may need additional permissions such as being the owner and/or group member allowed to manipulate the data. Accordingly, the OS/2 admin turned to Linux admin (root user) should make use of the chown command to achieve her/his purpose.

As the OS/2 remains anchored in the past and with no supporting organization providing continued development -much less a clear road map for its future- OS/2 admins will be forced to migrate. Metztli Information Technology will be glad to provide migration and/or support services provided the target platform is resilient, secure, open source - open standards: GNU/Linux.


DISCLAIMER:P Please do not hold me or Metztli Information Technology responsible if the information provided here does not achieve the desired result. The information is provided AS IS and with the hope that it may be useful to the Internet community --especially OS/2 users and/or administrators considering GNU/Linux as their organizations' migration platform.

Notwithstanding, There is no implicit or explicit guarantee that the information presented here is accurate --even though due diligence was exercised during the procedure. Accordingly, if an user(s) decide to implement the procedure or shell commands described here she, he, or them, do so at her, his, or their own risk. You have been forewarned.

Metztli IT reserves the right to modify the content of the post or even to delete it altogether.

Jose   ,   05:27:56 am
Categories: Legacy

3 comments

Webdesign Agentur Wolf

I really must say that a blog is super. I’m from Germany and although I need help with the language sometimes, but it’s fun to follow your publications to!

11/25/09 @ 16:30
Comment from: technology news [Visitor]
technology news

Hi, I am from India…I am new to linux..I’ve got your site in google. Your website font is really nice…

03/29/11 @ 11:28
Comment from: Hussain [Visitor]
Hussain

how we can access data on AIX 4.1.5 formatted JFS partitions, from linux ubuntu ?

06/16/12 @ 03:25


Form is loading...