re-linking hard links

Daniel Davidson danield at igb.uiuc.edu
Wed Apr 26 18:33:16 UTC 2006


Hello, 


I have a situation where I have numerous files with numerous hard links 
to each of them on an ext3 RHEL4.2 system.  Some of these files are 
duplicates of the others.  I would like to re-link all of the 
duplicates to point to a single inode.  For instance if file1 has 
hardlinks link1 and link2, and file2 has hardlinks link3 and link4, I 
need to change it so that link1, link2 (these two are already correct), 
file2, link3, and link4 are all hardinks to file1.  The only 
information I have to start with are the inode numbers of file1 and 
file2 and the pathnames of file1 and file2. 


Any ideas beyond searching all of the filenames on the system and 
replacing them with the proper link?  That takes a long time. 


thanks, 


Dan 





More information about the Ext3-users mailing list