CM wiki web
Base ClearCase FAQ: 1.5.8 What is in lost+found? How to clean it?
In lost+found ClearCase puts all elements which are not referenced anymore. Imagine you remove a directory with rmver or rmelem,or the single or last access to file objects with rmname or unco, ClearCase won't recursively remove the elements
in this directory but they cannot be accessed neither.
Instead, they will be moved to lost+found.
How to clean it?
You may want to remove files from lost+found, unless you want to restore them from there. The latter shall be done with ct mv, to a directory previously checked out (and which you'll check in afterwards), and (probably)using the name found as prefix of the lost+found object (dropping the oid suffix). The former now. Do not attempt to remove the contents of lost+found recursively! The fact that a directory is not accessible from anywhere anymore
doesn't mean that its contents is not: you might remove something valuable and still referenced from elsewhere in you vob. Also, you may only remove what you master locally. Some commands for the vob owner: First uncheckout the checked out versions. You have to do it using the view in which the objects are checked out,
assuming this view is dynamic, still healthy, and reachable (both host and storage).
However, it is possible that the view cannot access the version anymore, or the lost+found directory itself.
Therefore, use the oid, and the vob tag (replace /vob/tag in the command below):
ct lsvtree * | perl -ne 'if(m%(^.*)\@\@/.*/CHECKEDOUT view \"(.*)\"$%){$o=qx(cleartool des -fmt "%On" $1);print "setview -exec \"cleartool unco -rm oid:$o\@/vob/tag\" $2\n"}' | cleartool Then, use (non recursive!): ct rmelem -f *You may repeat either step as many times as necessary (as there is something to remove). Leave the error output? Or remove it (in the meanwhile, I got into files with funny names, e.g. containing '$' signs, which I handled with
quotemeta):
ct lsvtree * 2>/dev/null | perl -ne 'if(m%(^.*)\@\@/.*/CHECKEDOUT view \"(.*)\"$%){$f=quotemeta($1);$o=qx(cleartool des -fmt "%On" $f 2>/dev/null);print "setview -exec \"cleartool unco -rm oid:$o\@/vob/tag\" $2\n"}' | cleartool 2>/dev/null
There is also the case of filenames starting with a dot. You can add a dot for the lsvtree command, but do not do that with rmelem.
And the process above assume dynamic views...
For snapshot ones, unreserve the checkout would not help, so that one has no other choice then to rmview!?
An other assumption made earlier is that the views holding the checkouts are in the same region... -- MarcGirod - 16 Feb 2009
