Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

OpenVMS file deletion

Occasional Visitor

OpenVMS file deletion

When a file is deleted, is it completely gone. Not like in a Windows environment - only the first letter is removed but not the file itself.

Scenario: delete a file, then a "backup/image" to tape, restore image from tape. Is deleted file still resident on newly restored image to disk?
Richard Whalen
Honored Contributor

Re: OpenVMS file deletion

Not with a backup/image, which will backup files based upon indexf.sys. A backup/physical might preserve the file if nothing else has written over it, but you would still have to work to find it.

As you said at the beginning, with VMS when you delete a file it is deleted. Other operating systems hide deleted files until you tell them to really delete them or the need the space.
Occasional Visitor

Re: OpenVMS file deletion

Thanks for the clarification.
Jan van den Ende
Honored Contributor

Re: OpenVMS file deletion


to begin with:
WELCOME to the VMS forum!

As for your question: IT DEPENDS.

For a VMS disk drive, several settings are determined at INIT time. Those mostly have defaults, but can be chosen non-default.

The important one for this question are HIGHWATERMARKING and erase-on-delete.
They are mainly a security settings, of which highwatermarking by default is ON. But because of the performance impact, if security demands are not VERY strict, it is usually advised to turn it OFF.

With highwatermarking ON, ANY disk area is erased on allocate.
This setting simply prevents getting to any data of a deleted file. Period.
Erase-on-delete does exactly that, and costs even more performance.

Now the situation with Highwatermarking OFF.
The disk areas are mapped in BITMAP.SYS, with an idication that it is allocated or not.
A file is described in the INDEXFILE.SYS, with pointers to the relevant bitmap areas.
Upon deletion, the areas in the bitmap are marked free, and the pointers are given to the FREE LIST.
And now for the mean part: that list is LastInFirstOut, in other words, if there is any allocation=deallocation going on, the biggest chance is that (parts of) the most recently released areas are the first to be re-used; effectively destroying the content.

But, IF one were to scavenge such drive, the unallocated areas DO contain data that once was valid.
But because of the structures of various types of RMS files, it certainly is NOT a trivial job to reconstruct coherence from those pieces!!



Have one on me.


Don't rust yours pelled jacker to fine doll missed aches.
Jon Pinkley
Honored Contributor

Re: OpenVMS file deletion

RE:"Scenario: delete a file, then a "backup/image" to tape, restore image from tape. Is deleted file still resident on newly restored image to disk?"

Are you restoring to the same disk as the original was deleted from? In that case, if the file was not erased when it was deleted, then the blocks used by the file will still have the contents they originally had after the file is deleted. If you restore to the same disk, and don't init/erase then it is possible the blocks will still have the original contents.

To erase the blocks used by the file when you delete the file use $ delete/erase. You can also set a file to be erased when it is deleted (set file/erase_on_delete) or you can specify that a whole disk (volume) is treated specially so all files are erased when they are deleted (set volume/erase_on_delete).

I disagree with Richard's conjecture that VMS deletes a file and doesn't just hide it.

The file header is "mostly" untouched by the delete, the header is marked as available in the index file bitmap, and the header is marked as not valid, but the file name is still there. And as long as there isn't activity on the device, the file can be undeleted using something like DFU UNDELETE /FILE=xxxxx.

So, if you want to be sure the file is gone (and even here, there are no absolute guarantees), delete the file, backup/image,
init/erase the original volume, restore from image backup.

it depends
Trusted Contributor

Re: OpenVMS file deletion

"Is deleted file still resident on newly restored image to disk?"

MAYBE! If a file has been deleted while it is still open and you do a BACKUP/IMAGE at that point (especially with /IGNORE=INTERLOCK) the file will be saved as a lost file and and can be restored from the save set. It certainly will be restored with an image restore.