Wednesday, May 21, 2014

Index Node for dummies

Inode on UNIX based systems is a data structure used to represent a file system object. The inode contains the information required by the process for accessing the files. Inodes exist in a static form on disk. Whenever any modification is required the kernel reads disk inode into an in-core inode.

The disk inode contains the following fields:

·         File owner identifier: Ownership is divided between an individual and a group owner.
·         File type: Files may be of various types as mentioned below:
o   Regular File
o   Directory
o   Character Device
o   Block Device
o   FIFO (named pipe)
o   Symbolic Link
o   Socket
·         File access permissions: The system protects files according to three classes namely the owner, the group owner & other users. Each class access rights (Read, write & Execute) can be set individually.
·         File access times: This field specifies the time the file was last modified, accessed and when the inode was last modified.
·         Links: Number of hard links.
·         Table of contents for the disk addresses of data in a file. Users treat the data in a file as a logical stream of bytes but the kernel saves the data in discontiguous disk blocks. The inode identifies the disk blocks that contain the file’s data.
·         File size

The in-core copy of the inode contains the following fields in addition to the fields of the disk inode:

·         Status: The status of the in-core inode, indicating whether:
  •    the inode is locked
  •    a process is waiting for the inode
  •    the file is a mount point
  •    the in-core representation of the inode differs from the disk copy as a result of a change to the data in the inode
  •    the in-core representation of the file differs from the disk copy as a result of a change to the file data

·         The logical device number of the file system that contains the file.
·         The inode number. Inodes are stored in a linear array, the kernel identifies the number of a disk inode by its position in the array. The disk inode does not need this field.
·         Pointers to other in-core inodes.
·         A reference count indicating the number of instances of the file that are active.

The VFS inode structure contains lot more fields. Most interesting structures are inode_operations (i_op) & file_operations (i_fop).

How to get inode number for a file under Linux?
We can get the inode numbers using either of the following commands:
·         ls -i
·         stat

Does Windows have an inode number for uniquely identifying the file?
Windows has a structure named as _FILE_INTERNAL_INFORMATION which contains the 8-byte file reference number for the file. This number is assigned by the file system and is file-system-specific.  File reference numbers, also called file IDs, are guaranteed to be unique only within a static file system.


Saturday, February 1, 2014



The Open Compute Project (OCP) initiative was announced in April 2011 by Facebook to openly share designs of data center products. The project started by three engineers resulted in building own custom-designed servers, power supplies, server racks and battery backup systems.

The team designed its first data center in Prineville, Oregon. The result of the effort is that Prineville data center now uses 38 percent less energy to do the same work as Facebook’s existing facilities, while costing 24 percent less.

The Open Compute Project Foundation is a community of engineers around the world, whose mission is to design and enable the delivery of the most efficient server, storage, networking and data center hardware designs for scalable computing. Foundation believe that openly sharing ideas, specifications and other intellectual property is the key to maximizing innovation, accelerating market change and reducing operational complexity in the scale compute space.


With more than 150 official members, including new partners like Bloomberg, IBM, IO, LSI, Microsoft, Yandex and others the future belongs to Open Compute.