Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory Recreating a deleted hardlink to a file if I know the inode number Post 302226655 by jim mcnamara on Tuesday 19th of August 2008 12:45:49 PM
Old 08-19-2008
As an aside, some kernels - BSD is one - have an fhopen call that will open a file based on inode number.

I don't see how that helps since you can read the file via /proc/<pid>/fd. If the filesystem still has the data out there somewhere, can you read the file onto media to rescue it?
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Inode number

as kernel keeps track of user activities on a file by its INODE number and I node table . what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space? is the Inode Number is fixed for a file till its deletion? thanks (1 Reply)
Discussion started by: compbug
1 Replies

2. Solaris

Creating a hardlink to a file

I'm trying to relink a file someone tried to delete while a process (that we don't want to shutdown) also had a filehandle open to it. Consequently, we've got an inode entry but no directory entry (aka 'file') for it. I've tracked the inode number down via lsof, as well as the particular... (0 Replies)
Discussion started by: Smiling Dragon
0 Replies

3. UNIX for Dummies Questions & Answers

Number of Inode on a disk

How we can know number of inode present in my Disk including free and occupied. Is there any tool or program to know how much free inode are there in inode free list . (2 Replies)
Discussion started by: mr_deb
2 Replies

4. Solaris

Recreating .xml file in /etc/zones

Folks, just wondering if there is a way to recreate this file if inadvertantly removed ?? (8 Replies)
Discussion started by: trevagreene
8 Replies

5. AIX

How to get the filename of which has been deleted if I know the inode number?

How to get the filename of which has been deleted if I know the inode number. i can use the command "istat" to get the inode number of the file. # istat /proc//fd/x If this file has been deleted,but the process of this file has not been closed and handle has not been released ,so this... (3 Replies)
Discussion started by: JoyOnLine
3 Replies

6. Shell Programming and Scripting

Modifying a file without changing inode number

Hi all, I am struggling to change the content of a file without changing the inode number. The exact issue is as below. I have a file name test.bak which has 100 lines of text. I am trying to to delete the first 90 lines of the text in the file. I know that using sed/awk/head/tail I can... (3 Replies)
Discussion started by: sathishkmrv
3 Replies

7. Red Hat

Inode number changes for a file in Redhat Linux

Hi, I have created a file abc.log in Redhat Linux. Inode number for a file get changes every time i update the file using vi editor. Is there any setting that can be made , such that inode number never gets changed? Or if we cannot restrict from inode number getting changed , is... (9 Replies)
Discussion started by: raghu.amilineni
9 Replies

8. Solaris

Retreive deleted file name if you having inode number

Some one please help me to find deleted file name, if I am having inode number in Solaris without using any 3rd party tool. Thanks :) (3 Replies)
Discussion started by: aksijain
3 Replies

9. Shell Programming and Scripting

Changing inode value of a hardlink

is it possible to change the inode value/ file path of a hard link? (2 Replies)
Discussion started by: fhill2
2 Replies

10. Linux

Inode number changes for a file in Redhat Linux

Hi, I have created a file a.txt in Redhat Linux. Inode number for a file changes every time i update the file using vi editor , gedit etc. Is there any setting that can be made , such that inode number never changes as that is supposed to be the expected behavior? Or if we cannot... (13 Replies)
Discussion started by: srirammanohar
13 Replies
FHOPEN(2)						      BSD System Calls Manual							 FHOPEN(2)

NAME
fhopen, fhstat, fhstatvfs -- access file via file handle LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/mount.h> int fhopen(const void *fhp, size_t fh_size, int flags); #include <sys/stat.h> int fhstat(const void *fhp, size_t fh_size, struct stat *sb); #include <sys/statvfs.h> int fhstatvfs(const void *fhp, size_t fh_size, struct statvfs *buf); int fhstatvfs1(const void *fhp, size_t fh_size, struct statvfs *buf, int flags); DESCRIPTION
These functions provide a means to access a file given the opaque file handle fhp and the size fh_size of the opaque object as returned by getfh(2). As this method bypasses directory access restrictions, these calls are restricted to the superuser. fhopen() opens the file referenced by fhp for reading and/or writing as specified by the argument flags and returns the file descriptor to the calling process. The flags are specified by or'ing together the flags used for the open(2) call. All said flags are valid except for O_CREAT. fhstat(), fhstatvfs(), and fhstatvfs1() provide the functionality of the fstat(2), fstatvfs(2), and fstatvfs1(2) calls except that they return information for the file referred to by fhp rather than an open file. RETURN VALUES
Upon successful completion, fhopen() returns the file descriptor for the opened file, while fhstat(), fhstatvfs(), and fhstatvfs1() return 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
In addition to the errors returned by open(2), fstat(2), fstatvfs(2), and fstatvfs1(2), respectively, fhopen(), fhstat(), fhstatvfs(), and fhstatvfs1() will return [EINVAL] Calling fhopen() with O_CREAT set or invalid fh_size. [ESTALE] The file handle fhp is no longer valid. SEE ALSO
fstat(2), fstatvfs(2), fstatvfs1(2), getfh(2), open(2) HISTORY
The fhopen(), and fhstat() functions first appeared in NetBSD 1.5. The fhstatvfs() function replaced fhstatfs() in NetBSD 3.0. BSD
August 5, 2009 BSD
All times are GMT -4. The time now is 09:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy