What can you do with the Linux ods5 file system?

Mount your VMS disks, explore them with ls, find and other Linux tools. Copy the files with cp (in a binary mode) or copr (in record mode). A VMS disk can be any ODS2 or ODS5 formatted media: diskette, hard disk, CD-ROM, DVD. Also, you can mount any container file, as a loop device. Such files werecreated and used by the VDDRIVER or LDDRIVER and formatted as an ODS2/5 disk. (You may even create a cloop device out of the container file and use that.) Also any physical backup of an ODS2/5 media available as a file can be mounted as a loop device.

You can use an ods5 file system with a stackable unification file system such as aufs. That is, it looks like you can delete or add/modify files on your read-only ODS5 disk. However, aufs (and other stackable unification file systems) do not forward the ioctl and getxattr calls, which are used to retrieve the record attributes, so the rats and copr utility will not work. Anyway, here is an example:

# mkdir /tmp/vms
# mkdir /vms
# mkdir /VMS
# mount -o loop,nomfd,ro /mnt/sda3/vms/arc1002.iso /vms
# mount -t aufs -o br:/tmp/vms=rw:/vms=rr none /VMS/
# ls /VMS
ARCHIVE.DIR;1  BADBLK.SYS;1  BITMAP.SYS;1  CORIMG.SYS;1  SECURITY.SYS;1
BACKUP.SYS;1   BADLOG.SYS;1  CONTIN.SYS;1  INDEXF.SYS;1  VOLSET.SYS;1
# rm /VMS/B*
# ls /VMS
ARCHIVE.DIR;1  CORIMG.SYS;1  SECURITY.SYS;1
CONTIN.SYS;1   INDEXF.SYS;1  VOLSET.SYS;1
# echo huhu >/VMS/CORIMG.SYS\;1
# ls -l /VMS
total 7404
drwxr-x--x 1 sync   daemon     512 Feb 22  2010 ARCHIVE.DIR;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 CONTIN.SYS;1
-rwxr-x--- 1 daemon daemon       5 Jul 12 21:12 CORIMG.SYS;1
-rwxr-x--- 1 daemon daemon 7571456 Feb 22  2010 INDEXF.SYS;1
-rwxr-x--- 1 daemon daemon     512 Feb 22  2010 SECURITY.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 VOLSET.SYS;1
#
# ls -al /tmp/vms
total 4
drwxr-xr-x 4 root   root   200 Jul 12 21:12 .
drwxrwxrwt 9 root   root   280 Jul 12 21:10 ..
-r--r--r-- 5 root   root     0 Jul 12 21:11 .wh..wh.aufs
drwx------ 2 root   root    40 Jul 12 21:11 .wh..wh.orph
drwx------ 2 root   root    40 Jul 12 21:11 .wh..wh.plnk
-r--r--r-- 5 root   root     0 Jul 12 21:11 .wh.BACKUP.SYS;1
-r--r--r-- 5 root   root     0 Jul 12 21:11 .wh.BADBLK.SYS;1
-r--r--r-- 5 root   root     0 Jul 12 21:11 .wh.BADLOG.SYS;1
-r--r--r-- 5 root   root     0 Jul 12 21:11 .wh.BITMAP.SYS;1
-rwxr-x--- 1 daemon daemon   5 Jul 12 21:12 CORIMG.SYS;1
# ls -l /vms
total 7512
drwxr-x--x 1 sync   daemon     512 Feb 22  2010 ARCHIVE.DIR;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 BACKUP.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 BADBLK.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 BADLOG.SYS;1
-rwxr-x--- 1 daemon daemon  113152 Feb 22  2010 BITMAP.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 CONTIN.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 CORIMG.SYS;1
-rwxr-x--- 1 daemon daemon 7571456 Feb 22  2010 INDEXF.SYS;1
-rwxr-x--- 1 daemon daemon     512 Feb 22  2010 SECURITY.SYS;1
-rwxr-x--- 1 daemon daemon       0 Feb 22  2010 VOLSET.SYS;1
#
# touch /VMS/new.file\;1
# touch /VMS/another_file
# ls /VMS
ARCHIVE.DIR;1  CORIMG.SYS;1  SECURITY.SYS;1  another_file
CONTIN.SYS;1   INDEXF.SYS;1  VOLSET.SYS;1    new.file;1
#

You can not easily use a file as input for a program which was ported from VMS. It depends on the file specification used in the open statement and the RMS attributes of the file.

VMS programmers usually specify a file like "mydb.dat" which translates to an ODS2 file "MYDB.DAT;17" (with 17 being the highest version), or to an ODS5 file "MyDB.dat;17" So an open in the ported program will not immediately work. But you can create a symbolic link named "mydb.dat" pointing to "MyDB.dat;17". When using a stackable unification file system, you can create the symbolic link as if it were on the VMS disk. That may solve many of the open problems. But then, if the file contains variable size records, there is no RMS layer on Linux to pass the records to the program.

The file specification may contain more VMS-style name parts which make it more difficult to open the file, for example
file.type;0 - open the last, newest version
file.type;-1 - similar, open the previous version
file.type;-0 - similar, the first, oldest version
[any_directory]file.type;3 - an absolute directory path specification on the current disk
[.any_directory]file.type;3 - a relative directory path specification on the current disk
any_disk:[any_directory]file.type;3 - an absolute directory path specification on a specified disk
any_disk:[.any_directory]file.type;3 - a relative directory path specification on a specified disk
logical:file.type;3 - an abbreviated specification with a logical for a device and/or directory path

It is not sufficient to set up a symlink for the device, directory or logical part of the file specification. Consider
	ln -s '/mnt/HB.DIR;1' 'sys$sysdevice:[hb]'
which can only be used as
	'sys$sysdevice:[hb]'/ to get to the directory.
so
	'sys$sysdevice:[hb]/SETUP.COM;8'
works but the VMS style file specification
	'sys$sysdevice:[hb]SETUP.COM;8'
does not work.

If the program uses a Posix-style file specification the ods5 file system needs to be mounted with "noversion". Although there is no such mount option the symbolic link option ("syml") has the wanted side-effect.

The symbolic link option very likely helps with HTML files on a VMS disk and hyperlinks pointing to other HTML files on a VMS disk: the links are usually in Posix-style file specifications.