Solved

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

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use question mark (?) in filename with html 25 132
HOw To Install Docker on VMware Workstation 19 595
how to send mail in unix 2 46
swp file in unix 16 34
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

738 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