Removing Symbolic and Hard Links in ClearCase

Technote (troubleshooting)


This technote explains how to remove links created by the IBM® Rational® ClearCase® cleartool ln and cleartool ln -s command.

Resolving the problem

ClearCase links, both hard (cleartool ln) and soft (cleartool ln -s), are treated as VOB elements, so the cleartool rmelem command is used to remove links:

Note: You can use cleartool rmname to preserve the symbolic link, but remove any references to it in latter directory versions, as mentioned in the below output.

Remove Symbolic Link

  1. From the target directory execute cleartool rmelem against a soft link:

    M:\admin_vu\vob1\Folder1\sub_dir2>cleartool ls
    Folder3 --> ../../Folder3

    M:\admin_vu\vob1\Folder1\sub_dir2>cleartool rmelem Folder3

  2. This dialogue will appear, and you must click Yes to proceed with the removal:

    i  CAUTION! This will destroy the symbolic link, and will remove the symbolic link from all directory versions that now contain it. Once you destroy the symbolic link, it will be hard to restore it to its current state. If you want to preserve the symbolic link, but remove references to it from future directory versions, use the "rmname" command. Symbolic link "Folder3" is enter in 1 directory versions.
    Destroy symbolic link?

     [Yes] [No] [Cancel]

Review IBM Rational ClearCase Reference Guide on the topic of rmelem or rmname ( cleartool man rmelem | rmname ) for more information.

Remove Hardlink

Locating and removing a VOB hardlink may require the use of a utility, find_hlinks_lstfnd, refer to technote 1200838.

UNIX® and Linux® ONLY

If a link is created using operating system commands, ClearCase will be able to follow and use the link; however, attempts to remove the link using cleartool commands will fail.

Example: You are in a view/VOB context and create a hardlink using the OS command instead of a cleartool command. The following output shows the results from a cleartool ls -long and also shows the results of an attempt to remove the link using the cleartool rmname command.

[j]/vobs/j>ln foo.c ln_foo.c
[j]/vobs/j>cleartool ls -l
version      c.c@@/main/1            Rule: element * /main/LATEST
version      d.c@@/main/1            Rule: element * /main/LATEST
version      foo.c@@/main/1          Rule: element * /main/LATEST
version      ln_foo.c@@/main/1 [view-->vob hard link]     Rule: element * /main/LATEST
directory version   lost+found@@/main/0   Rule: element * /main/LATEST

[j]/vobs/j>cleartool rmname ln_foo.c

cleartool: Error: Unable to remove "ln_foo.c".

[j]/vobs/j>cleartool ls -long
version      c.c@@/main/1            Rule: element * /main/LATEST
version      d.c@@/main/1            Rule: element * /main/LATEST
version      foo.c@@/main/1          Rule: element * /main/LATEST
version      ln_foo.c@@/main/1 [view-->vob hard link]     Rule: element * /main/LATEST
directory version  lost+found@@/main/0    Rule: element * /main/LATEST

You will need to use an operating system command to remove the link if it was created using an operating system command.

[j]/vobs/j>rm ln_foo.c
rm: remove regular file `ln_foo.c'? y

[j]/vobs/j>cleartool ls -long
version      c.c@@/main/1             Rule: element * /main/LATEST
version      d.c@@/main/1             Rule: element * /main/LATEST
version      foo.c@@/main/1           Rule: element * /main/LATEST
directory version  lost+found@@/main/0   Rule: element * /main/LATEST

Related information

About checking out Symbolic Link (symlink) Targets
About locating checkouts for VOB symbolic links
About creating Symbolic Links (symlinks) from the GUI
About creating Symbolic Links from command line
Managing symbolic links in ClearCase interop

Cross reference information
Segment Product Component Platform Version Edition
Software Development Rational ClearCase Cleartool

Rate this page:

(0 users)Average rating

Document information

More support for:

Rational ClearCase

Software version:

7.0, 2002.05.00, 2003.06.00

Operating system(s):

AIX, HP-UX, IRIX, Linux, Solaris, Windows

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation