[an error occurred while processing this directive]

HP OpenVMS Systems

UNIX Portability Initiative
» 

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

UNIX Portability

» Roadmap
» CRTL
» GNV
» File System
» Future Plans

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
HP Integrity server animation
Content starts here
hard link example (INIT and SET VOLUME)

Hard Link Example (INIT and SET VOLUME)

You can enable hard links by using either the INITIALIZE command or the SET VOLUME command.

To initialize an ODS-5 disk with hard links enabled, enter the following command:

$ INIT/VOLUME_CHARACTERISTICS=HARDLINKS

To enable hard links on a mounted Files-11 volume, enter the following command:

$ SET VOLUME/VOLUME_CHARACTERISTICS=HARDLINKS

If you have a volume that has hard links enabled, and you want to disable hard links, end the SET VOLUME command:

$ SET VOLUME SYS$DISK/VOLUME_CHARACTERISTICS=NOHARDLINKS

Note, however, disabling hard links can result in some strange file behavior. For example, assume that you have disabled hard links, as shown in the preceding example, but you would like to create an alias for your file FOO.

First you create an alias for FOO.A called FOO.B, as follows:

$ CREATE FOO.A $ SET FILE FOO.A/ENTER=FOO.B

Now delete the original file: $ DELETE FOO.A;1 However, if you look for FOO.B on the volume by entering the DIRECTORY command, you receive a ‘‘file not found’’ error because the primary link to that file no longer exists.

To fix this problem, or to check the number of hard links to a file, enter the following command:

$ ANALYZE/DISK/REPAIR ANALYZE/DISK/REPAIR

This command counts the number of directory entries that reference each file and sets the link count if it is incorrect.

Before you create aliases for files on disks that have previously had hard links enabled, be sure to use the ANALYZE/DISK/REPAIR command to set the link count correctly. If you are unsure whether hard links are currently enabled or disabled, use the SHOW DEVICE/FULL command.

To report link counts, use DIRECTORY/FULL and DUMP/HEADER.

To check the number of links, enter the following command:

$ DIRECTORY/LINK