Rocket U2 | UniVerse & UniData

 View Only

 Unidata 8.x - any tools in Linux to determine the bit depth of a file or if a file has indexes?

Kevin King's profile image
Kevin King posted 05-12-2024 16:57

I have a script that we use to verify file integrity across a number of accounts using guide.  A couple things I'd like to add are warnings about file size for 32-bit files (which we can get from udt.errlog but we have no control over when things show up there) and to run guide_ndx on a file to validate indexes.  Also, because guide_ndx has to be run on individual files (it still has to run on individual files, right?) I need some way in Linux to know which files in an account are Unidata files and which files have indexes.  

Are there any Linux utilities in Unidata 8 that could give me this kind of detail on a file without starting Unidata?

Jonathan Smith's profile image
ROCKETEER Jonathan Smith

@Kevin King

guide_ndx still only allows one file to be checked at a time.

If you want to find out if a file is a UniData file and how many indicies it has without UniData running, there is an undocumented enginnering command you can use (this is not something that is new to UniData 8).  You need an understanding of the information that the tool returns and would need to do some scripting around the command to ensure the file is a UniData file, as the tool in questions may still report the file is a UniData file when it's not, so you need to be careful on examing the results in that regard and checking.

The command in question is fileview and if used to view the primary group of a file, it will allow to see (and modify) various header elements of the file. The counter returned in the idxinf field denotes the number of indicies a file has.

ORDERS has two indices

fileview -p1 ORDERS

File Name --------> ORDERS (static, non-RFS, 64-bit)

    modulo --------------> 31
    hashtype ------------> 0x0, Hash Function: 0
    HashVersion ---------> 1.0
    version -------------> 2
    blksiz --------------> 0 (1024)
    idxinf --------------> 2
    bproof --------------> 0
    file operation ------> 0
    PropertyOffset ------> 0 (0x0)
    mul_of --------------> 0
    rm ------------------> 255
    prt_at --------------> 192
    nullv  --------------> 129
    file size -----------> 33792 (33 blocks)

VOC has none

fileview -p1 VOC

File Name --------> VOC (static, non-RFS, 32-bit)

    modulo --------------> 101
    hashtype ------------> 0x3, Hash Function: 3
    HashVersion ---------> 1.0
    version -------------> 2
    blksiz --------------> 0 (1024)
    idxinf --------------> 0
    bproof --------------> 0
    file operation ------> 0
    PropertyOffset ------> 0 (0x0)
    mul_of --------------> 0
    rm ------------------> 255
    prt_at --------------> 192
    nullv  --------------> 129
    file size -----------> 118784 (116 blocks)

Now in terms of working out if something is a UniData file , do not rely on the fileview output of 'File Name --------> ORDERS (static, non-RFS, 64-bit)' alone. You need to do more checking on the output provided and understand what the range of some of the header values are supposed to be. Sadly we do not have any formal documentation on fileview as it is intended as an engineering only interface.

This should at least give you some assistance into finding the information you are looking for.

Jonathan Smith's profile image
ROCKETEER Jonathan Smith

If I find some free cycles I will look to write a technote on what some these values should be, that you should check for.

Kevin King's profile image
Kevin King

Jonathon, thank you - excellent information.