Solved

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

Posted on 2010-09-16
5
307 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 76

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 76

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now