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

set file command and directory ebk

 
SOLVED
Go to solution
Scotty HD
Frequent Advisor

set file command and directory ebk

hello all,
i read that the set file command can be used to change directory ebk.
does this not interfere with the filesystem directory management ?
why would someone use this command ?
who else is interested in directory ebk other than filesystem ?

Scotty
5 REPLIES 5
Highlighted
Robert Gezelter
Honored Contributor

Re: set file command and directory ebk

Scotty,

In a word, NO. EBK (the meaning of which would have been clearer if you had mentioned that the command was SET FILE/ATTRIBUTE) is the end of file within the file.

This can become incorrectly set when a program abnormally ends or the system crashes. It does not control the actual allocation of space, which is not accessible from SET FILE/ATTRIBUTE.

- Bob Gezelter, http://www.rlgsc.com
Hein van den Heuvel
Honored Contributor
Solution

Re: set file command and directory ebk

Do you really mean for a directory, not a normal file?

>> i read that the set file command can be used to change directory ebk.

YES you could.

>> does this not interfere with the filesystem directory management ?

Just a little. Change to a dierctory file for the directory caches to be reloaded.

>> why would someone use this command ?

Yeah. Why?

who else is interested in directory ebk other than filesystem ?

'smart' folks who want to 'help' the system. Scary!


So yeah, one could muck with that, but why?
One would get what you deserve right?!
Lost files in the least if you go smaller, unpredictably worse if you make it bigger (up to ALQ).

If you did want to play with this, please be sure to use a throw-away device like an MD (RAMdrive) or LD (Logical Disk in file).

Here is a silly test:
$ perl -e "open X, qq(> mda1:[hein]ABCDEFGHIJKLMNOPQRSTUVWXYZ_$_.tmp) for (1000..1100)
$
$ dir mda1:[hein]/gra
Grand total of 1 directory, 101 files.
$ dir/size=all mda1:[000000]hein.dir
HEIN.DIR;1 11/13
$ set file/attr=ebk=5 mda1:[000000]hein.dir
$ dir mda1:[hein]/gra
Grand total of 1 directory, 40 files.

$ anal/disk/repa mda1:
Analyze/Disk_Structure/Repair for _EISNER$MDA1: started on 3-MAR-2011 11:25:01.38

%ANALDISK-I-OPENQUOTA, error opening QUOTA.SYS
-SYSTEM-W-NOSUCHFILE, no such file
%ANALDISK-W-LOSTHEADER, file (52,1,0) ABCDEFGHIJKLMNOPQRSTUVWXYZ_1040.TMP;1
not found in a directory
%ANALDISK-W-LOSTHEADER, file (53,1,0) ABCDEFGHIJKLMNOPQRSTUVWXYZ_1041.TMP;1
not found in a directory
:


Now one may want to pre-allocate, re-pack or create fill space in directories.

The DFU tool (www.digiater.nl) can do all of that (as could the old comdir tool)

Standard VMS tools only allow CRE/DIR/ALLO

Regards,
Hein

http://h30499.www3.hp.com/t5/System-Management/Directory-corrupted/m-p/3044890#M187

Scotty HD
Frequent Advisor

Re: set file command and directory ebk

thanks for reply.

#the meaning of which would have been clearer if you
#had mentioned that the command was SET FILE/ATTRIBUTE
yes i meant this command.

#Do you really mean for a directory, not a normal file?
yes i meant directory.

#If you did want to play with this, please be sure to use
#a throw-away device like an MD (RAMdrive) or LD (Logical Disk in file).
good point. i will use this for all of my experiments.

#Here is a silly test:
here comes the word "silly" again.
this time its not so scary.

#The DFU tool
this must be same tool that does defrag work.
it also has a way to undelete files on system.
i did not find any existing command in dcl to do this work.
i guess by default there is no command to undelete files ?
strange that operating system does not have a undelete command.
lots of confidence ?

Scotty
Hoff
Honored Contributor

Re: set file command and directory ebk

There is no undelete mechanism available by default within VMS.

There's no analog to the Windows or Mac OS X trashcan on VMS, either.

Messing with the EBK in a directory won't do an undelete.

The only thing that a directory file provides is the file hierarchy within the file system; there's really very little data in a directory, as the metadata is over in the index file and the storage bitmap.

There are ways to rummage around in the ODS-2 or ODS-5 file structure to try to recover the blocks of an erroneously deleted file, but these won't be successful just as soon as the blocks are reused and are overwritten.

It's more common to recover from backup but that given you're asking here, you clearly don't have backups.

For additional details and discussions on previous requests, Google for:

/OpenVMS undelete/

Or visit resources such as the comp.os.vms archives:

https://groups.google.com/forum/?fromgroups#!forum/comp.os.vms

and search for undelete

The VMS File System Internals book has details on ODS-2, or you can get the ODS2.DOC details on Freeware V5.0 (and that ODS2.DOC file is a text file, not a Microsoft Word file) here:

http://digiater.com/openvms/freeware/v50/ods2/ods2.doc

And have a look at the general ODS-2 and ODS-5 links at:

http://labs.hoffmanlabs.com/node/209

Please consider forming your questions around a problem statement with some background and general details, and also include the OpenVMS version or whatever related product(s) might be involved. Please do not construct your entire question solely around what you think might be a solution for the problem. A targeted question may well get you a correct answer, but one that can easily miss a better available solution for your general goal.
John Gillings
Honored Contributor

Re: set file command and directory ebk

Scotty,

>strange that operating system does not have
>a undelete command.

To us older folk, it's the operating systems that DO have an UNDELETE command which are strange. Back when VMS was designed, the expectation was that when someone asked to delete something, they expected it to be deleted!

Instead of undelete, VMS uses file versions. You can create multiple revisions of a file without losing older versions. Once you say "delete" that's the end of it. Think of the DCL DELETE command as being like "Empty Recycle Bin" under windows.

There have been attempts to implement undelete on VMS, sometimes they work, sometimes not. The biggest hurdle is that the disk free block list is LIFO. This is good for technical reasons - performance & locality. But, it means your chances of being able to recover a deleted file are fairly low. Other file system features, like DELETE/ERASE, a volume set to /ERASE_ON_DELETE or /HIGHWATER_MARKING will also interfere with your ability to undelete a file.

SET FILE is a fairly dangerous command. As you've suggested, if misused, it can easily corrupt files and directories. However, there are times when it can be used to recover data, if you know what you're doing. A good rule of thumb is, if you don't understand exactly what a particular SET FILE command will do, or, at least how to reverse it, don't execute it!
A crucible of informative mistakes