Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory Recreating a deleted hardlink to a file if I know the inode number Post 302276799 by ecifer on Wednesday 14th of January 2009 03:13:14 PM
Old 01-14-2009
Just in case someone else sees this...

I stumbled onto this thread while experiencing a similar problem. A file had been deleted while a process still had it opened.

Use lsof to determine the inode number of the file

install icat (Google icat-sleuthtools)... for ubuntu it's apt-get install sleuthtools

then use icat to copy the file to the new location:

icat -hf ext /dev/xxx <inode> > /path/to/copy.file

-h tells it to skip over any holes in the file (sparse data)
-f ext tells it to use ext2/3

/dev/xxx is the device (NOT THE MOUNTED DIRECTORY!!!)

<inode> is the node returned from lsof

Hope this helps!

-Ecifer
 

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
LDAP_MODIFY(3)						     Library Functions Manual						    LDAP_MODIFY(3)

NAME
ldap_modify, ldap_modify_s - Perform an LDAP modify operation SYNOPSIS
#include <ldap.h> int ldap_modify(ld, dn, mods) LDAP *ld; char *dn; LDAPMod *mods[]; int ldap_modify_s(ld, dn, mods) LDAP *ld; char *dn; LDAPMod *mods[]; void ldap_mods_free( mods, freemods ) LDAPMod **mods; int freemods; DESCRIPTION
The routine ldap_modify_s() is used to perform an LDAP modify operation. dn is the DN of the entry to modify, and mods is a null-termi- nated array of modifications to make to the entry. Each element of the mods array is a pointer to an LDAPMod structure, which is defined below. typedef struct ldapmod { int mod_op; char *mod_type; union { char **modv_strvals; struct berval **modv_bvals; } mod_vals; struct ldapmod *mod_next; } LDAPMod; #define mod_values mod_vals.modv_strvals #define mod_bvalues mod_vals.modv_bvals The mod_op field is used to specify the type of modification to perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or LDAP_MOD_REPLACE. The mod_type and mod_values fields specify the attribute type to modify and a null-terminated array of values to add, delete, or replace respectively. The mod_next field is used only by the LDAP server and may be ignored by the client. If you need to specify a non-string value (e.g., to add a photo or audio attribute value), you should set mod_op to the logical OR of the operation as above (e.g., LDAP_MOD_REPLACE) and the constant LDAP_MOD_BVALUES. In this case, mod_bvalues should be used instead of mod_values, and it should point to a null-terminated array of struct bervals, as defined in <lber.h>. For LDAP_MOD_ADD modifications, the given values are added to the entry, creating the attribute if necessary. For LDAP_MOD_DELETE modifi- cations, the given values are deleted from the entry, removing the attribute if no values remain. If the entire attribute is to be deleted, the mod_values field should be set to NULL. For LDAP_MOD_REPLACE modifications, the attribute will have the listed values after the modification, having been created if necessary. All modifications are performed in the order in which they are listed. ldap_modify_s() returns the LDAP error code resulting from the modify operation. This code can be interpreted by ldap_perror(3) and friends. The ldap_modify() operation works the same way as ldap_modify_s(), except that it is asynchronous, returning the message id of the request it initiates, or -1 on error. The result of the operation can be obtained by calling ldap_result(3). ldap_mods_free() can be used to free each element of a NULL-terminated array of mod structures. If freemods is non-zero, the mods pointer itself is freed as well. ERRORS
ldap_modify_s() returns an ldap error code, either LDAP_SUCCESS or an error if there was trouble. ldap_modify() returns -1 in case of trouble, setting the ld_errno field of ld. SEE ALSO
ldap(3), ldap_error(3), ldap_add(3) ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.0.27-Release 22 September 1998 LDAP_MODIFY(3)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy