But our experience and tests of JFS show this file system can be used without fear of losing data only if several simple but important rules are observed.
All the work with the file system is done by two files \OS2\JFS.IFS and \OS2\DLL\UJFS.DLL. There are also files JFS.MSG and JFSH.MSG where descriptions of possible errors while working with JFS are kept. But they are not interesting for us now.
JFS.IFS is actually a file system driver. It controls all the operations with JFS volumes at a low level.
UJFS.DLL is a library of standard auxiliary functions to work with a JFS volume. It contains, for instance, functions for formatting a volume or checking information on it. Actually, the programs format.com and chkdsk.com only call functions from UJFS.DLL (if the file system of the operating volume is JFS. If it is HPFS, UHPFS.DLL will be used instead.
Such separation makes possible using combinations of IFS and DLL files from different issues of JFS in order to operate with a minimum of problems.
We examine JFS from WSeB release, official fixpacks XR_E001, XR_E002 and all the versions that went through IBM's Testcase server.
Digression: Names of files in JFS are kept in Unicode (two-byte code.) The error was in the processing of the high byte of the first symbol of each file name.
If it was not zero (it is not in all code pages but American) then while checking the disk with chkdsk there was an error on such a file as IBM programmers used the function memcmp, not the highly recommended unistrcmp.
That meant that if a file started with Russian "A" (code 07 80h), not with "A" US Codepage (00 80h), you will surely have problems.
In fact the problem was that all the subdirectories (with files inside) were moved from the place where the file with national symbols was kept to the \lost+found directory, partly losing their initial names.
This error was corrected in FreeJFS 1.1, and after our bug reports, in IBM JFS from 22/06/2001 that was released only on IBM Testcase. As far as we know, JFS in eComStation is dated earlier and most probably the error is not corrected there.
We stopped spreading FreeJFS 1.1 because of problems and corrections in IFS.
Now the next version of FreeJFS is being developed where all the errors will be taken into consideration and some new functions added.
If you may have files with symbols different from codepage 850 in names, we recommend you to use UJFS.DLL from version 22/06/2001/Testcase.
Unfortunately, OS/2 installers do not check this important condition by themselves, so most often the UNICODE.SYS driver is loaded by Config.sys after loading JFS.IFS.
In spite of the fact that IBM added fuctions for working with Unicode directly into JFS.IFS driver starting from WSeB Fix1 (XR_E001), we can not absolutely guarantee that they corrected unicode.sys.
So, we come to the following rule of setting JFS: After installing OS/2 with JFS, check that Unicode.sys is loaded in config.sys before (higher in the file) JFS.IFS.
You will probably remember a long process of deleting lots of files. This was corrected rather quickly - cache was included in the first fixpack (XR_E001), though there is a small disadvantage - the write cache is still being fixed.
The advantages of lazywrite are obvious. The disadvantages of lazywrite's glitches are that after hanging/trapping of the system and processing chkdsk, all the files that were open by the system at the moment of fail have a zero file size.
Probably the same occurs with the files if the information about their recording did not come into the journal.
What can be recommended here? If you can not provide 100% guarantee of correct System Shutdown or Ctrl-Alt-Del you'd better use JFS.IFS from the WseB release (where lazywrite is just not included.)
It is not recommended to use a newer JFS.IFS with switched off Lazywrite in its configuration file as not all fragments of code referring to lazy write actually switch off.
In this case we recommend you have the ISJ utility from the FreeJFS.Tools package which will help you to manually remove the dirty flag from a JFS volume.
In general, we recommend you to remove switch "/AUTOCHECK:XXX" from the JFS.IFS driver in \os2\boot\config.x (the configuration for loading to command line with Alt-F2) so that when this variant of loading is used, chkdsk will not be started and you can remove the dirty flag without problems using ISJ.
Generally speaking, checking JFS disks is necessary only in difficult situations, for instance, when the system has trapped. That's why we don't recommend you start chkdsk often just to check if your file system is OK.
Moreover, CHKDSK is very harmful if started not from CONFIG.SYS at boot but after boot during real work with live data.
The problem is that chkdsk does not use the data from the JFS log on mounted volumes, and the full replication of the log occurs only at system boot.
This means that it is correct to start chkdsk only from CONFIG.SYS at system startup when the JFS volume is not mounted in the system.
So, if you want to check the structure of JFS volume you can do as follows:
We hope our advice will be helpful for all OS/2 users. If you have questions or comments don't hesitate to write us at freejfs@os2.ru (mailto:freejfs@os2.ru).
Usage:
isj.exe -dn [-c|-s|-r] [-2] [>file]
Where,
-d | drive number |
n == HDD | Number begining from 1 (default 1) |
-c | clear check (set reboot check to "never") |
-s | standard check (set reboot check to "standard check") |
-r | repair check (set reboot check to "repair check") |
-2 | use 2nd superblock |
Syntax of switches:
IFS=x:\OS2\JFS.IFS [/SWITCH:VALUE] [/SWITCH:VALUE]
where "x:" Specifies the drive letter of the partition from which the OS/2 program is started.
for example,
IFS=X:\OS2\JFS.IFS /AUTOCHECK:DRIVES /CACHE:SIZE /LAZY:[Off|synctime,maxage,bufferidle]
Allowed aliases for switches:
/AUTOCHECK | /A |
/CACHE | /C |
/LAZY | /L, /LW, /LAZYWRITE |
For example, "/AUTOCHECK:*" and "/A:*" are equivalent.
Specifies a list of drive letters to be automatically verified by the CHKDSK command at system startup if JFS detects that the drive may have been shutdown unexpectedly.
The drivelist value is a string of letters indicating the JFS drives in the workstation. The drive letters are not separated by commas or spaces. If any drive specified is not a valid JFS drive, the drive is not checked.
Example: /A:DEW - will check volumes D:, E: and W: /A:* - will check all found JFS-volumes
Specifies the amount of memory, in kilobytes, to use for the JFS cache.
Example:
/C:8192 - set JFS cache to 8 MBytes of RAM
/LAZY:OFF
disables write cache. It forces asynchonous writes to be immediately initiated (synctime=1, maxage=0, bufferidle=0)
/LAZY:synctime,maxage,bufferidle
enables write cache with the following parameters:
synctime | the interval at which the sync thread runs (in seconds) default value - 16 |
maxage | is the longest time in seconds that a frequently modified file is kept in cache. default = synctime * 4 |
bufferidle | is the time in seconds indicating a "recent" change. Changes newer than this value are not written unless the last write was older than maxage. default = MIN(1,synctime/8) |
IFS=C:\OS2\JFS.IFS /LW:5,20,4
synctime = 5, maxage = 20, bufferidle = 4
Konstantin Okounkov (mailto:freejfs@os2.ru)
is the coordinator of Russian Team OS/2 and
an editor of the OS2.Ru (http://os2.ru) site. He is also a member of some OS/2 projects
and OS/2 user/programmer since 1995.
He believes that the best computer game is OS/2 itself.
Thanks to Irina Okounkova for translating this article to english.
This article is courtesy of www.os2ezine.com. You can view it online at http://www.os2ezine.com/20011016/page_6.html.