Wednesday, January 5, 2011

Dialogue on UNIX: inode

Ls command in your daily work will always encounter such a situation, it is difficult to remove or manage some files because the files in the file name using the dash or other special characters, or the file name is not correct.

This is most likely someone on the file to the wrong name. Because most commands in UNIX, including switch or option included, is a hyphen (-) or a double hyphen (--) at the beginning, it is difficult to use such as rm, cp, mv, and frequently used commands to manipulate these files. Fortunately, some command provides several options to use to display the related file is associated with the index number of the inode. Ls command provides an option: # ls----pfileAfileBfileCileDfileEfileFfileGfileHfileIfileJfileKfileL use ls-i command, you can see the file index numbers next to the name, as shown in Listing 4. Now you already know the document's index number, you can easily manipulate the file. To view a file in Listing 4. index number # ls-i3898838991-p38984fileC38982fileF38977fileI38978fileL38989-38980fileA38986fileD38983fileG38987fileJ38990--38979fileB38976fileE38985fileH38981fileKfind command uses UNIXfind command, you can use the ls command to complete the work begun by. For the files you want to operate, you already know their index numbers, you can begin to manipulate! you want to delete the file appears to be unknown, you only need to use find-and-inum switch on index number and the file location. Then, locate the file, use the find and-exec switch to remove the file: # {} \ find.-inum38988-execrm; to the file is renamed, you can do the same operation again, but this time use the mv instead of rm: # fileM\ find.-inum38989-execmv {}; in order to verify the achieved the expected results, you only need to once again use ls-i command: # ls-i38990--38979fileB38976fileE38985fileH38981ileK38991-p38984fileC38982fileF38977fileI38978ileL38980fileA38986fileD38983fileG38987fileJ38989fileMfsck command unfortunately, hardware equipment is not possible to use it, you may be in use for many years after a failure. When this occurs, as well as due to power failure or some other issues and causes the operating system shuts down unexpectedly, you can restore the system backup is experienced in a crash during the open file, and now need to be addressed. At this point, you might encounter some needs to be fixed inode or error messages. If this situation occurs, the fsck command can be used to help in an emergency! you can use the fsck to repair the file system or the correction of the damaged inode, instead of restoring the system, or even to rebuild the operating system. The following command to try to fix the logical volume/dev/hd1: # fsck-p/dev/hd1 – y using fsck command, you can narrow your search within damaged inode. If you're looking for a specific inode, then you can use belt-ii-NodeNumber switch fsck command. Closing if no inode, UNIX file and directory is not used. Want to read this article, you can gain a better understanding of the inode and their importance for AIX systems, as well as how to manage them. You may view the df command is greatly improved.

No comments:

Post a Comment