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 ODS-2 or ODS-5 formatted media: diskette, hard disk, CD-ROM, DVD. Also, you can mount any container file, as a loop device. Such files were created and used by the VDDRIVER or LDDRIVER and formatted as an ODS-2/5 disk. (You may even create a cloop device out of the container file and use that.) Also any physical backup of an ODS-2/5 media available as a file can be mounted as a loop device.

The ods5 filesystem is compatible with stackable unification filesystems like aufs and compressed filesystems like sqfs.


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 ODS-5 disk. However, aufs (and other stackable unification file systems) by default do not forward the ioctl and getxattr calls, which are used to retrieve the record attributes, so the rats and copr utility may 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
#


To use ods5 with squashfs you need the filesystem and the tool mksquashfs.

It is recommended to create a container file from the VMS disk (with the LDDRIVER on VMS or with dd on the Linux) and to create a squashfs filesystems from that container. To use it, mount the squashfs and then the ods5 filesystem.

For example, you have a SCSI device with a VMS disk connected to your Linux box and it shows as /dev/sdd.

  $ dd if=/dev/sdd of=vms.dsk bs=512
  $ mksquashfs vms.dsk vms.dsk.sqfs
  $ rm vms.dsk
  $ mount -o loop vms.dsk.sqfs /sqfs
  $ mount -t ods5 -o ro,loop /sqfs/vms.dsk /vms
It is not recommended to create a squashfs from the mounted VMS disk. This works as far as the ods5 filesystem is involved, but the files were copied in binary format to the resulting squashfs without the VMS file/record attributes. (You can compare this with an ftp transfer from a VMS system in binary mode for all files). However, if all the files on the VMS side are in a Linux compatible mode - StreamLF or binary - this may be an option, especially if you want to make a squashfs just of a subtree of a VMS directory.


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 ODS-2 file "MYDB.DAT;17" (with 17 being the highest version), or to an ODS-5 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.