Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inodes. Filesystems Each partition has a filesystem –This filesystem will usually support a directory hierarchy Every file on a disk partition is allocated.

Similar presentations


Presentation on theme: "Inodes. Filesystems Each partition has a filesystem –This filesystem will usually support a directory hierarchy Every file on a disk partition is allocated."— Presentation transcript:

1 inodes

2 Filesystems Each partition has a filesystem –This filesystem will usually support a directory hierarchy Every file on a disk partition is allocated an inode number. –Typically this is an index number into an array stored on that disk –Each element in that array is an inode inodes store administrative information about a file –Who created it –When it was created –Etc inode numbers are stored alongside the filename in the directory –This means directories are tables that associate filenames with inode numbers

3 dir1 dir2 file1 file2 file98 file97 1301 1306 1997 2675 An actual inode 1301 1306 1302 1307 1303 1304 1305 filesystem location on H/D, owner:pdunne, size:2M, etc location on H/D,owner:pdunne, size:200K inode numberfilename inode number Each filename – inode pair is called a link The same inode number can appear in more than one link The inode number is the index number in the inode array 1997

4 dir1 dir2 file1 file2 file99 file98 file97 1301 1306 1997 2675 The actual inode 1301 1306 1302 1307 1303 1304 1305 filesystem location on H/D, owner:pdunne, size:2M, etc location on H/D,owner:pdunne, size:200K inode numberfilename inode number The inode number is the index number in the inode array Here we have two links to the same inode Hard link: Associate two or more file names with the same inode. Hard links share the same data blocks on the hard disk, while they continue to behave as independent files….If you delete one link the other link still points to inode 1997 Create a hard link $ ln TARGET LINK_NAME $ ln /dir1/file1 /dir2/file99 Create a hard link $ ln TARGET LINK_NAME $ ln /dir1/file1 /dir2/file99

5 dir1 dir2 file1 file2 file99 file98 file97 1301 1306 1997 2675 The actual inode 1301 1306 1302 1307 1303 1304 1305 filesystem location on H/D, owner:pdunne, size:2M, etc location on H/D,owner:pdunne, size:200K inode numberfilename inode number The inode number is the index number in the inode array Here we have two links to the same inode Soft link or symbolic link (or for short: symlink): a small file that is a pointer (i.e. contains path) to another file. All commands that read/write follow a link follow and operate on the real file. Symbolic links can span partitions! 1997

6 dir1 dir2 file1 file2 file99 file98 file97 1301 1306 1997 2675 The actual inode 1301 1306 1302 1307 1303 1304 1305 filesystem location on H/D, owner:pdunne, size:2M, etc location on H/D,owner:pdunne, size:200K inode numberfilename inode number Each filename – inode pair is called a link The inode number is the index number in the inode array Here we have two links to the same inode $ rm /dir1/file1 The direcory link is removed, inode is released and file H/D data blocks released 1997 X

7 dir1 dir2 file1 file2 file99 file98 file97 1301 1306 1997 2675 The actual inode 1301 1306 1302 1307 1303 1304 1305 filesystem location on H/D, owner:pdunne, size:2M, etc location on H/D,owner:pdunne, size:200K inode numberfilename inode number The inode number is the index number in the inode array Here we have two links to the same inode $mv /dir1/file1 /dir1/fileABC The move command, mv, can be used to rename a file if the second parameter is in the same directory as the original file. It creates a new entry with the same inode and then deletes the old link. 1997 fileABC1301 X


Download ppt "Inodes. Filesystems Each partition has a filesystem –This filesystem will usually support a directory hierarchy Every file on a disk partition is allocated."

Similar presentations


Ads by Google