How the Linux ods5 looks like, an overview
The ods5 file system comes as a kernel module and is usually loaded with
# insmod path-to/ods5.koThe kernel module is built with modversions, to make it loadable on more than the specific kernel it was built on.
# mount -t ods5 -o ro -o loop ods2.dsk /mnt # ls /mnt 000000.DIR;1 BADLOG.SYS;1 CORIMG.SYS;1 SECURITY.SYS;1 BACKUP.SYS;1 BITMAP.SYS;1 HARTMUT.DIR;1 VOLSET.SYS;1 BADBLK.SYS;1 CONTIN.SYS;1 INDEXF.SYS;1 #File names are shown just as they are found on the disk, here an ODS-2 disk. No suppression of the file version is done. File name completion works, which seems good enough so the file version delimiter shouldn't be a big problem. But there is a mount option 'dotversion', to use the '.' instead of ';' for that delimiter.
# mount -t ods5 -o ro -o nomfd -o loop ods2.dsk /mnt # ls /mnt BACKUP.SYS;1 BITMAP.SYS;1 HARTMUT.DIR;1 VOLSET.SYS;1 BADBLK.SYS;1 CONTIN.SYS;1 INDEXF.SYS;1 BADLOG.SYS;1 CORIMG.SYS;1 SECURITY.SYS;1 #To use an alternate home block, use '-o home=' with a block number
# mount -t ods5 -o ro -o home=1034 -o loop another-ods2.dsk /mnt # ls -l /mnt total 1092 drwxr-x--x 1 daemon daemon 512 Apr 14 01:34 000000.DIR;1 drwxr-x--x 1 daemon daemon 1024 Apr 14 01:39 A.DIR;1 drwxr-x--x 1 daemon daemon 512 Apr 14 01:48 B.DIR;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 BACKUP.SYS;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 BADBLK.SYS;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 BADLOG.SYS;1 -rwxr-x--- 1 daemon daemon 1536 Apr 14 01:34 BITMAP.SYS;1 drwxr-x--x 1 daemon daemon 1024 Apr 14 02:05 C.DIR;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 CONTIN.SYS;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 CORIMG.SYS;1 drwxr-x--x 1 daemon daemon 512 Apr 14 02:09 D.DIR;1 drwxr-x--x 1 daemon daemon 16896 Apr 14 02:20 E.DIR;1 -rwxr-x--x 1 daemon daemon 34816 Apr 14 01:34 GPT.SYS;1 -rwxr-x--- 1 daemon daemon 1051136 Apr 14 01:34 INDEXF.SYS;1 -rwxr-x--- 1 daemon daemon 512 Apr 14 01:34 SECURITY.SYS;1 -rwxr-x--- 1 daemon daemon 0 Apr 14 01:34 VOLSET.SYS;1 #Directories have the type ".DIR" and the version number 1.
# ls -lc /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/ total 5 -rwxr-x--- 1 bin bin 760 Mar 21 2000 X.CLASS;3 -rwxr-x--- 1 bin bin 201 Mar 21 2000 X.JAVA;4 -rwxr-x--- 1 bin bin 928 Mar 23 2000 XF.CLASS;2 -rwxr-x--- 1 bin bin 438 Mar 22 2000 XF.JAVA;5 -rwxr-x--- 1 bin bin 898 Feb 19 2000 XT.CLASS;7 -rwxr-x--- 1 bin bin 428 Feb 19 2000 XT.JAVA;11 #Dates and protections are "translated" as well as the ownership. To make the files accessible for other users, set an octal mask value with the mode option. This enables the according protection bits.
# mount -t ods5 -o ro -o mode=004 -o loop ods2.dsk /mnt # ls -lc /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/ total 5 -rwxr-xr-- 1 bin bin 760 Mar 21 2000 X.CLASS;3 -rwxr-xr-- 1 bin bin 201 Mar 21 2000 X.JAVA;4 -rwxr-xr-- 1 bin bin 928 Mar 23 2000 XF.CLASS;2 -rwxr-xr-- 1 bin bin 438 Mar 22 2000 XF.JAVA;5 -rwxr-xr-- 1 bin bin 898 Feb 19 2000 XT.CLASS;7 -rwxr-xr-- 1 bin bin 428 Feb 19 2000 XT.JAVA;11 #
# file /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/X.JAVA\;4 /mnt/HARTMUT.DIR;1/JAVA.DIR;1/X.JAVA;4: ASCII C++ program text # # cat /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/X.JAVA\;4 public class X { private String foo; X () { foo= new String("bar"); } void print() { System.out.println(foo); } public static void main(String[] args) { X myX= new X(); myX.print(); } } #Obviously, this is a so called VMS StreamLF file. Java sources usually are. file's guess was wrong, but that has nothing to do with the ods5 file system. Other VMS text files (variable length records) show up as 'data'. You can use the rats tool to display the RMS attributes. You can use the copr tool to read the data record by record. The file system does not do any record I/O nor conversion of data.
# file /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/X.CLASS\;3 /mnt/HARTMUT.DIR;1/JAVA.DIR;1/X.CLASS;3: compiled Java class data, version 45.3 #Here file is right, so let's run this small Java example:
# java X -cp /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/ Can't find class X #No surprise, here. Java expects the file name to be the class name plus '.class' suffix. Here the file name is 'X.CLASS;3'. A symbolic link can help:
# ln -s /mnt/HARTMUT.DIR\;1/JAVA.DIR\;1/X.CLASS\;3 X.class # java X bar #The next output shows two ODS volumes: a small disk image and a CD.
# mount /dev/sda3 on / type ext2 (rw) proc on /proc type proc (rw) devpts on /dev/pts type devpts (rw,mode=0620,gid=5) /dev/sda1 on /boot type ext2 (rw) shmfs on /dev/shm type shm (rw) /home/hartmut/ods5/ods2.dsk on /root/tmp type ods5 (ro,loop=/dev/loop0) /dev/scd1 on /mnt type ods5 (ro) #The ods5 file system available blocks, although it is the read-only file system.
# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda3 4167999 1827923 2124404 47% / /dev/sda1 7496 1868 5228 27% /boot /home/hartmut/ods5/ods2.dsk 1003 132 871 100% /root/tmp /dev/scd1 699904 677896 22008 100% /mnt #Mounting an OpenVMS ODS-5 disk. Look at the file names, hard- and softlinks. Note, the hardlinks for directory entries on the ods5 file system are always 1.
# mount -o loop,ro,syml -t ods5 ods5.dsk /mnt # ls -il /mnt total 395 4 drwxr-x--x 1 bin bin 1024 Oct 25 2006 . 2 drwxr-xr-x 23 root root 536 Nov 13 23:54 .. 4 drwxr-x--x 1 bin bin 1024 Oct 25 2006 000000.DIR;1 8 -rwxr-x--- 1 bin bin 0 Oct 25 2006 BACKUP.SYS;1 3 -rwxr-x--- 1 bin bin 0 Oct 25 2006 BADBLK.SYS;1 9 -rwxr-x--- 1 bin bin 0 Oct 25 2006 BADLOG.SYS;1 2 -rwxr-x--- 1 bin bin 1024 Oct 25 2006 BITMAP.SYS;1 7 -rwxr-x--- 1 bin bin 0 Oct 25 2006 CONTIN.SYS;1 5 -rwxr-x--- 1 bin bin 0 Oct 25 2006 CORIMG.SYS;1 1 -rwxr-x--- 1 bin bin 393216 Oct 25 2006 INDEXF.SYS;1 10 -rwxr-x--- 1 bin bin 512 Oct 8 12:23 SECURITY.SYS;1 6 -rwxr-x--- 1 bin bin 0 Oct 25 2006 VOLSET.SYS;1 47 drwxr-x--x 1 bin bin 512 Oct 8 12:45 Xy.DIR;1 46 drwxr-x--x 1 bin bin 512 Oct 8 12:26 Z.DIR;1 11 drwxr-x--x 1 bin bin 2560 Aug 27 13:25 a.DIR;1 45 drwxr-x--x 1 bin bin 512 Oct 8 12:25 b.DIR;1 # ls -il /mnt/Xy.DIR\;1/ total 10 47 drwxr-x--x 1 bin bin 512 Oct 8 12:45 . 4 drwxr-x--x 1 bin bin 1024 Oct 25 2006 .. 49 lrwxr-x--- 1 bin bin 10 Oct 8 12:30 SYML1.TXT;1 -> ./text.txt 50 lrwxr-x--- 1 bin bin 8 Oct 8 12:31 SYML2.TXT;1 -> text.txt 48 -rwxr-x--- 1 bin bin 52 Oct 8 12:37 does-not-work.txt;1 54 -rwxr-x--- 1 bin bin 0 Oct 8 12:37 does-not-work.txt;2 52 -rwxr-x--- 6 bin bin 76 Oct 8 12:33 hard2symb.txt;1 52 -rwxr-x--- 6 bin bin 76 Oct 8 12:33 hardl1.txt;1 52 -rwxr-x--- 6 bin bin 76 Oct 8 12:33 hardl2.txt;1 52 -rwxr-x--- 6 bin bin 76 Oct 8 12:33 hardl3.txt;1 56 -rwxr-x--- 1 bin bin 22 Oct 8 12:39 semi.txt;;1 57 lrwxr-x--- 1 bin bin 9 Oct 8 12:40 semitype.;1 -> semi.txt; 58 drwxr-x--x 1 bin bin 512 Oct 8 12:44 sub.DIR;1 61 lrwxr-x--- 1 bin bin 10 Oct 8 12:46 symb2hard.txt;1 -> hardl2.txt 59 lrwxr-x--- 1 bin bin 4 Oct 8 12:41 syml-subdir.;1 -> sub/ 55 lrwxr-x--- 1 bin bin 19 Oct 8 12:38 syml-version.txt;1 -> does-not-work.txt;1 51 lrwxr-x--- 1 bin bin 10 Oct 8 12:33 syml3.txt;1 -> ./text.txt 53 -rwxr-x--- 1 bin bin 10 Oct 8 12:34 text.txt;1 52 -rwxr-x--- 6 bin bin 76 Oct 8 12:33 text.txt;2 #Additional tools help with record oriented file contents. First there is 'rats', a tool to display the attributes:
# rats /mnt/RATS.DIR\;1/* FIX.TXT;1: org=seq rfm=fix rat=cr rat=blk lrl=31 VAR.TXT;1: org=seq rfm=var rat=cr lrl=28 VFC.TXT;1: org=seq rfm=vfc rat=prn lrl=28 fsz=2 #Then there is 'copr', a tool to copy RMS records to stdout. It can handle many of the the popular RMS file organizations and record formats. If there is one missing, let me know.
# copr /mnt/RATS.DIR\;1/VAR.TXT\;1 Some text in some lines and an empty line in bewteen that's all. #With these tools we look at the file size. The shown size is derived from what is in the file header: used blocks and first free byte offest. Depending on the record format and the file organization this may not be the usual file size as shown for other Linux file systems.
# ls -l /mnt/RATS.DIR\;1/VAR.TXT\;1 -rwxr-xr-- 1 sync daemon 74 Aug 5 2005 /mnt/RATS.DIR;1/VAR.TXT;1 # rats /mnt/RATS.DIR\;1/VAR.TXT\;1 VAR.TXT;1: org=seq rfm=var rat=cr lrl=28 # copr /mnt/RATS.DIR\;1/VAR.TXT\;1 |wc 5 13 66 #The content of this file is shown in the previous paragraph. Counting the characters including the line feeds gives 66, but the files size is 74, which is different.
# ls -l /mnt/RATS.DIR\;1/STMLF.TXT\;1 -rwxr-xr-- 1 sync daemon 66 Aug 5 2005 /mnt/RATS.DIR;1/STMLF.TXT;1 # /mnt-iso/k761/ods5/rats /mnt/RATS.DIR\;1/STMLF.TXT\;1 STMLF.TXT;1: org=seq rfm=stmlf rat=cr lrl=28 # /mnt-iso/k761/ods5/copr /mnt/RATS.DIR\;1/STMLF.TXT\;1 |wc 5 13 66 #For the record format StreamLF (stmlf) the shown file size is the expected one.