Solved

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

Posted on 2010-09-16
5
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 78

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 78

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

691 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