Solved

Is there a way to create a file on a specific inode in RedHat 7.1?

Posted on 2010-09-16
5
325 Views
Last Modified: 2013-12-06
I had a disk go bad on a RedHat 7.1 system.  A software package on the disk requires a file to be on the exact inode of the previous drive for it to function.

The inode was 1717786.  If I define a dummy.file then do an ls -ial dummy.file the inode of the file is 676.

cd / ; find . -inum 1717786 -depth -print
does not return any file names.

Is there a way to create a file on a specific inode without creating dummy files until the inode is used?

Any suggestions would be appreciated.
Dan
0
Comment
Question by:scodhk
5 Comments
 
LVL 77

Accepted Solution

by:
arnold earned 167 total points
ID: 33698142
The only way to recover from this is with a restore or contacting the vendor and get the fix.

Are you sure the inode is not already in use?

The inode is allocated by the system, I think this is why the vendor chose this approach.
You could try creating dummy files until the file has the inode you need.
The vendor, whose software you use, is no longer available?
0
 
LVL 7

Assisted Solution

by:askb
askb earned 167 total points
ID: 33698227
Allowing creating a user to file based on the  inode number could be a potential security risk. AFAIK no FS's allow this.

But can you provide  the name of the s/w package which has such a dependency ? I would like to understand this more.

Have you tried mirroring / restoring the disks ?
0
 
LVL 10

Assisted Solution

by:Martin_J_Parker
Martin_J_Parker earned 166 total points
ID: 33699572
If you have an ext2 or ext3 filesystem then you might be able to accomplish what you want with the debugfs command - if you are feeling VERY brave, but it's not something I've tried using myself !
0
 

Author Comment

by:scodhk
ID: 33700924
Thanks to all who replied,

The inode is definitely not in use.  I did a test with the -inum option of find on an inode I knew was used in multiple filesystems and it worked.  The inode I'm looking for returned nothing.

I did what I thought would be an image restore using Tru Image but that although it recreated the filesystem structure it did not restore the files to the original inodes.  The original disk is no longer accessisble.

I will look into the debugfs command then decide if I should try it.

The vendor is no longer available and an old solution was to create the dummy files until the inode was used.  So that is what I will do.

Thanks again.
0
 
LVL 77

Expert Comment

by:arnold
ID: 39280001
If you have a system where the files are in the prefect inode, you can use cpio to copy that file as a data stream and then restore that stream on this system.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question