Sponsored Content
Operating Systems Linux Inode number changes for a file in Redhat Linux Post 302920401 by achenle on Thursday 9th of October 2014 09:23:44 AM
Old 10-09-2014
Modifying an existing file does not change the inode number. The code you're using rewrites the file to a new one, then rename()'s the new file with the old name.

How do you stop that? You don't do it.

If your log file inodes are changing, I'd say the problem is, "Who is editing the log files?" There's auditing to figure that out.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Directory Inode Number Not Unique

Hi, I know that inode for each file is unique, but is it the for the directory? So far I found different directories has the same inode nubmer when you do ls -i, could some one explain why? Thanks a lot. (9 Replies)
Discussion started by: nj302
9 Replies

2. 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

3. UNIX for Advanced & Expert Users

how to find out pathname from inode number

Hi all when I execute pmap command on one of my daemon process, I am able to see the following output. Address Kbytes RSS Anon Locked Mode Mapped File 00010000 40 40 - - r-x-- irs026bmd 00028000 56 56 16 - rwx-- irs026bmd 00036000... (3 Replies)
Discussion started by: axes
3 Replies

4. 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

5. Filesystems, Disks and Memory

Recreating a deleted hardlink to a file if I know the inode number

At risk of twisting the rules to nearly the point of breaking (if you think this goes too far mods, I apologise and accept that this should be deleted), I'm hoping someone might be able to cast a little light on the following problem regarding hard links to files. ... (6 Replies)
Discussion started by: Smiling Dragon
6 Replies

6. Solaris

How to increase or decrease inode number of the particular UFS filesystem

Hi Gurus I want to know the command & tips regarding, how to increase or decrease inode number of the particular ufs filesystem. Is it possible to do it in a live/production environment. Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

7. 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

8. 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

9. 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

10. 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
xfs_check(8)						      System Manager's Manual						      xfs_check(8)

NAME
xfs_check - check XFS filesystem consistency SYNOPSIS
xfs_check [ -i ino ] ... [ -b bno ] ... [ -f ] [ -s ] [ -v ] [ -l logdev ] device DESCRIPTION
xfs_check checks whether an XFS filesystem is consistent. It is normally run only when there is reason to believe that the filesystem has a consistency problem. The filesystem to be checked is specified by the device argument, which should be the disk or volume device for the filesystem. Filesystems stored in files can also be checked, using the -f flag. The filesystem should normally be unmounted or read-only during the execution of xfs_check. Otherwise, spurious problems are reported. OPTIONS
-f Specifies that the filesystem image to be processed is stored in a regular file at device (see the mkfs.xfs(8) -d file option). This might happen if an image copy of a filesystem has been made into an ordinary file. -l logdev Specifies the device where the filesystem's external log resides. Only for those filesystems which use an external log. See the mkfs.xfs(8) -l option, and refer to xfs(5) for a detailed description of the XFS log. -s Specifies that only serious errors should be reported. Serious errors are those that make it impossible to find major data struc- tures in the filesystem. This option can be used to cut down the amount of output when there is a serious problem, when the output might make it difficult to see what the real problem is. -v Specifies verbose output; it is impossibly long for a reasonably-sized filesystem. This option is intended for internal use only. -i ino Specifies verbose behavior for the specified inode ino. For instance, it can be used to locate all the blocks associated with a given inode. -b bno Specifies verbose behavior for the specific filesystem block at bno. For instance, it can be used to determine what a specific block is used for. The block number is a "file system block number". Conversion between disk addresses (i.e. addresses reported by xfs_bmap(8)) and file system blocks may be accomplished using xfs_db(8)'s convert command. Any output that is produced when xfs_check is not run in verbose mode indicates that the filesystem has an inconsistency. The filesystem can be repaired using either xfs_repair(8) to fix the filesystem in place, or by using xfsdump(8) and mkfs.xfs(8) to dump the filesystem, make a new filesystem, then use xfsrestore(8) to restore the data onto the new filesystem. Note that xfsdump may fail on a corrupt filesystem. However, if the filesystem is mountable, xfsdump can be used to try and save important data before repairing the filesystem with xfs_repair. If the filesystem is not mountable though, xfs_repair is the only viable option. DIAGNOSTICS
If the filesystem is completely corrupt, a core dump might be produced instead of the message device is not a valid filesystem If the filesystem is very large (has many files) then xfs_check might run out of memory. In this case the message out of memory is printed. The following is a description of the most likely problems and the associated messages. Most of the diagnostics produced are only meaning- ful with an understanding of the structure of the filesystem. agf_freeblks n, counted m in ag a The freeblocks count in the allocation group header for allocation group a doesn't match the number of blocks counted free. agf_longest n, counted m in ag a The longest free extent in the allocation group header for allocation group a doesn't match the longest free extent found in the allocation group. agi_count n, counted m in ag a The allocated inode count in the allocation group header for allocation group a doesn't match the number of inodes counted in the allocation group. agi_freecount n, counted m in ag a The free inode count in the allocation group header for allocation group a doesn't match the number of inodes counted free in the allocation group. block a/b expected inum 0 got i The block number is specified as a pair (allocation group number, block in the allocation group). The block is used multiple times (shared), between multiple inodes. This message usually follows a message of the next type. block a/b expected type unknown got y The block is used multiple times (shared). block a/b type unknown not expected The block is unaccounted for (not in the freelist and not in use). link count mismatch for inode nnn (name xxx), nlink m, counted n The inode has a bad link count (number of references in directories). rtblock b expected inum 0 got i The block is used multiple times (shared), between multiple inodes. This message usually follows a message of the next type. rtblock b expected type unknown got y The real-time block is used multiple times (shared). rtblock b type unknown not expected The real-time block is unaccounted for (not in the freelist and not in use). sb_fdblocks n, counted m The number of free data blocks recorded in the superblock doesn't match the number counted free in the filesystem. sb_frextents n, counted m The number of free real-time extents recorded in the superblock doesn't match the number counted free in the filesystem. sb_icount n, counted m The number of allocated inodes recorded in the superblock doesn't match the number allocated in the filesystem. sb_ifree n, counted m The number of free inodes recorded in the superblock doesn't match the number free in the filesystem. SEE ALSO
mkfs.xfs(8), xfsdump(8), xfsrestore(8), xfs_ncheck(8), xfs_repair(8), xfs(5). xfs_check(8)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy