Operating System - HP-UX
1833875 Members
1773 Online
110063 Solutions
New Discussion

Assign file to a specific inode on root file system on HPUX.

 
SOLVED
Go to solution
Dee_3
Regular Advisor

Assign file to a specific inode on root file system on HPUX.

I would like to assign a certain file to a specific inode on the root file system. The inode I want to use is not assigned to anything on the root file system at this time. I usually have a file assigned to the inode I want, even if it is a junk file, but in this case I don't. I've checked to see if mv has an option to assign to a specific inode, but I don't see that it does. I used ncheck to look to see what is assigned to this inode on the system, and only /var and /opt have it assigned. Any suggestions? Thanks.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Assign file to a specific inode on root file system on HPUX.

Hi Terri:

I'm not sure why you would want to control the assignment of the inode.

Inodes are unique within a filesystem. In fact, when a directory is mounted the inode number of the directory will only, and always be two (2).

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Assign file to a specific inode on root file system on HPUX.

Hi Terri:

I assume your root filesystem is vxfs. fsdb will do this but be very careful. Man fsdb_vxfs; it has some fairly good examples.

I'm very reluctant to give you any instructions because you can absolutely clobber your system. My plan B would be to write a script writing small junk data files and until your desired inode number appeared.
Remove that file and then that will be the next inode number reassigned. Create/copy your desired file at this point. Finally remove your junk files and you are done.

I assume that you will put in safety checks to makesure that you are not using up all the space in / somewhere in your script.

Clay
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Assign file to a specific inode on root file system on HPUX.

Hi Jim:

I have seen that requirement for licensing files. The inode number becomes an integral part of the license key. For example, Baan has you run a utility that creates a file; the utility outputs some data that you send back to Baan. That data includes that inode number in an obscure way. When you are supplied with the actual keys, the file is updated with valid license information using the same inode.
They can generally provide those keys on a rush basis in two or three days and sometimes the keys even work.

Terri's request may not be as crazy as it sounds.

Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Assign file to a specific inode on root file system on HPUX.

Hi Clay:

Well I'll be darned! [...and probably already am ;-) ]. Thanks!

...JRF...