180 likes | 438 Views
Linux File System (Advanced). More file details. All files in Linux are stored with the following meta-data, user owner, group owner, permissions, and timing information. This information is stored in a structure called an inode .
E N D
More file details • All files in Linux are stored with the following meta-data, user owner, group owner, permissions, and timing information. This information is stored in a structure called an inode. • File names are stored in data-structures called dentries (directory entries). • Just like uids, the kernel only associates a file with it’s inode number. File names just human-readable about them. • We can examine a file’s inode information using:- • ‘ls -l’ • ‘ls -I’ • ‘stat’
Dentry inode Simplified view of the Linux File System
Hard and soft links In Linux, we use links to point to existing files. To create a link, we use the ‘ln’ command. A hard link is created when multiple dentries are made to refer to the same inode. A soft link is created when a dentry to made to refer to another dentry. It does not point to the file’s inode.
Hard Link Dentry Dentry
Soft Link Dentry Dentry
Disks All disks are located in the /dev directory. Disks can be formatted using ‘mkfs’. Latest Linux File System is ‘ext3’. All formatted disks have to be mounted on a known directory using the ‘mount’ command before we can access them. To unmount a disk, we have to perform a ‘umount’. The ‘df’ command shows disk usage across all mounted disk on the system.
File locating tools To quickly locate a file, we can use the ‘locate’ command. This causes a database to be accessed to give quick results. However, if your file is very new, this command will not work. You have to cause the database to be updated using ‘updatedb’ command. The ‘find’ command conducts a real-time search of the file system. It can take a while for the command to complete.
Data compression/archival tools We use either ‘gzip’,‘bzip2’ or ‘tar’. Of the above three, bzip2 compression algorithm is the most efficient.