marry -- bind block device to a regular file


/etc/marry -a regfile ...

/etc/marry -d  regfile | marrydev ...

/etc/marry -l


Normally, operations such as swapping or mounting can only be performed on a block special device file. marry associates a block special device file with a regular file. The regular file may then be accessed as a block device using the special device file.

swap(ADM) uses marry to allow a regular file to act as a block device for swapping.

It is also possible to create a filesystem within a married regular file using mkfs(ADM) on the associated block device file. You can then check its integrity with fsck(ADM), and mount and unmount it using mount(ADM) and umount(ADM).

The following options are recognized:

Associate a device interface with the regular file(s) regfile, and create block special device file(s) /dev/marry/regfile through which they can be accessed. If a different block device pathname is required, a link should be created to the node in the /dev/marry directory hierarchy, or use mknod(C) to make a similar node. If a raw interface is required, use mknod to create a character special device file with the same major and minor number as /dev/marry/regfile.

If regfile is a relative pathname, marry creates a block device file with the path /dev/marry/pwd/regfile where pwd is the current working directory.

marry gives the block device file and any intermediate directories the same permissions, owner, and group as the regular file and its intermediate directories. When using mknod to create another node, you should set its permissions appropriately as it provides another route to access the file.

Delete the block special device file(s) /dev/marry/regfile, and dissociate the device interface from the regular file(s) regfile. The pathname given may also be that of the married device file.

A marriage may be deleted while the married device is in use; the marriage will remain in force until the device is closed.

List current marriages in the form:

/regfile to major,minor /dev/marry/regfile status

If a regular file cannot be found, marry displays the inode number instead of its pathname.

If the block special device file cannot be found, marry displays ?????? instead of its pathname.

The status field shows how the device is currently open, and whether it is to be unmarried on close.


Text file busy
An attempt was made to execute a married file, or to open it for writing.


The following example shows three married files; the first is being used as a swap area, the second is mounted as a filesystem, and the third is not currently in use as a swap area or a mounted filesystem:
   /swap to 76,1 /dev/marry/swap swap-opened unmarry-on-close
   /u/filesys to 76,2 /dev/marry/u/filesys block/mount-opened
   /usr/tmp/idlefile to 76,3 /dev/marry/usr/tmp/idlefile


marry requires the existence of the dev/rmarry node, and the marry(HW) driver to be configured into the kernel.

badtrk(ADM), divvy(ADM), and fdisk(ADM) cannot be applied to a married device.

A regular file may be extended by writing to the married device; the final block is padded with null characters.

Only a regular file may be married; a directory cannot be married.

A file on a married mounted filesystem cannot be married.

A file cannot be married while its permissions include execution, setuid, setgid, sticky, or mandatory locking bits (see chmod(C)).

A married device cannot be opened for writing while the underlying file is being executed or is open for writing. A married file cannot be executed or opened for writing while the device is open.

A filesystem containing a married file cannot be unmounted while the associated device is open. If the device is not open, unmounting a filesystem containing married files automatically dissolves their marriages.

marry is a setuid program so that anyone can marry files. Only the owner (or root) can marry a given file; marry(HW) describes how to restrict this.

A maximum of 24 concurrent marriages are allowed by default; refer to marry(HW) for details of how to raise this limit.


permanent character device file used to control the marriage driver

block device file temporarily associated with the regular file pathname regfile

See also

chmod(C), fsck(ADM), marry(HW), mkfs(ADM), mount(ADM), swap(ADM), umount(ADM)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003