Archive for the ‘Linux’ Category
Linux functionality is often found, albeit in a different form in Windows. Inodes, the subject of this article, are an exception to this rule. Because of their practicality, Windows now includes an imitation of this functionality. But if you want to take full advantage of this somewhat complicated concept, you’ll have to go to Linux or Unix.
So what are inodes and why would anyone want to use them? Inodes are the internal description of a file. As we will see below, the specific inode contents for a given file are different in memory and on disk. But the key to the inode is that a single file may have different names. Why would anybody want to do that? One very important reason is that a user may access a shared file by an intuitive name. Accounting department users could give a certain file an accounting-style name, while users from the marketing department could access this same file by a name that makes sense to them. This functionality alone makes inodes worth while.
Furthermore, let’s say that by accident the “accounting” file was deleted. Accounting users could still access that file if they knew the “marketing” name. Remember, we are talking about one single file that has different names. People don’t have to know about these complications to be able to access the file. The extra processing is carried out behind the scenes.
Now let’s examine inodes more closely. The inode on disk contains the following information: file owner identifier, file type, file access permissions, file access information, number of links, list of data addresses, and file size. The file owner identifier specifies the file owner and the group owner as discussed in our article on permissions and groups. The file type indicates whether we are talking about a regular file, a directory, or something else. The file access permissions denote the permissions, also discussed in a previous article. A given file may have different permissions for different users, for example accounting users may have permission to read and modify the file while marketing users only have permission to read it.
File access information specifies when the file was last accessed, last modified, and when the associated inode was last modified. The number of links indicates the number of names that the file has. In our example, the file has two links. If either accounting or marketing delete the file (assuming that they have such permission) the number of links is reduced to 1. But the file is still there and the number of links could be increased.
The inode on disk provides a list of data addresses; the single file may be scattered across the disk. The final value is the size of the file in bytes.
The inode in memory contains all of the above information plus additional information, for example, whether the file is available for processing (someone else may be using it) and whether someone is waiting to process the file. Remember, several people may be using Unix or Linux simultaneously. If there were no file usage control two different people in accounting could pay a bill at the same time. Windows doesn’t have this problem; it’s not a multi-user system.
The ln command is used to create a link to a given file. For example, ln acct1 mark1 links the mark1 file to the acct1 file; it makes the name mark1 available for the acct1 file. It’s the same file, but with a new name. The ls ‘i command provides information about the file including the number of links (the number of names for the file.)
The next article in this series discusses the Linux kernel and processes.
So what are inodes and why would anyone want to use them? Inodes are the internal description of a file. As we will see below, the specific inode contents for a given file are different in memory and on disk. But the key to the inode is that a single file may have different names. Why would anybody want to do that? One very important reason is that a user may access a shared file by an intuitive name. Accounting department users could give a certain file an accounting-style name, while users from the marketing department could access this same file by a name that makes sense to them. This functionality alone makes inodes worth while.
Furthermore, let’s say that by accident the “accounting” file was deleted. Accounting users could still access that file if they knew the “marketing” name. Remember, we are talking about one single file that has different names. People don’t have to know about these complications to be able to access the file. The extra processing is carried out behind the scenes.
Now let’s examine inodes more closely. The inode on disk contains the following information: file owner identifier, file type, file access permissions, file access information, number of links, list of data addresses, and file size. The file owner identifier specifies the file owner and the group owner as discussed in our article on permissions and groups. The file type indicates whether we are talking about a regular file, a directory, or something else. The file access permissions denote the permissions, also discussed in a previous article. A given file may have different permissions for different users, for example accounting users may have permission to read and modify the file while marketing users only have permission to read it.
File access information specifies when the file was last accessed, last modified, and when the associated inode was last modified. The number of links indicates the number of names that the file has. In our example, the file has two links. If either accounting or marketing delete the file (assuming that they have such permission) the number of links is reduced to 1. But the file is still there and the number of links could be increased.
The inode on disk provides a list of data addresses; the single file may be scattered across the disk. The final value is the size of the file in bytes.
The inode in memory contains all of the above information plus additional information, for example, whether the file is available for processing (someone else may be using it) and whether someone is waiting to process the file. Remember, several people may be using Unix or Linux simultaneously. If there were no file usage control two different people in accounting could pay a bill at the same time. Windows doesn’t have this problem; it’s not a multi-user system.
The ln command is used to create a link to a given file. For example, ln acct1 mark1 links the mark1 file to the acct1 file; it makes the name mark1 available for the acct1 file. It’s the same file, but with a new name. The ls ‘i command provides information about the file including the number of links (the number of names for the file.)
The next article in this series discusses the Linux kernel and processes.
A shell is the command interpreter program that serves as an interface between some users and the operating system itself. We say some users because most users rely on the graphical user interface. The Windows shell is the DOS command line interface accessed by clicking on Run and then entering the cmd command. The Windows graphical user interface is Explorer. This article describes the Damn Small Linux shell interface and several utilities, useful programs that may be launched from the shell. A subsequent article will describe the corresponding graphical user interface.
Why would anyone want to bother with a shell when the prettier, easier-to-learn and easier-to-use graphical interface is available? The answer is: It depends who you are and what you want to do. For system administrators or their associates it’s often much less cumbersome to use the shell rather than the graphical user interface. While Damn Small Linux commands may be quite arcane, they can be very powerful. And efficient. The Linux tools for performing administrative and other technical tasks admittedly take time to learn and master. But it does the job and does it well. In all fairness, many Windows systems administrators often apply command-line utilities. But they don’t have a powerful shell to help them do their work.
Historically Unix used the Bourne shell, the C shell based on the C programming language, and the Korn shell. Linux’s most widely used shell is Bash, also spelled BASH, the (Bourne-Again Shell). Damn Small Linux offers many shells but most people go with Bash both to communicate interactively with the operating system and to write programs known as shell scripts. If you program in Linux no matter which programming language you use you should learn some Bash specifics.
Utilities enable you to handle some very sophisticated processing. You can think of them as commands or as prewritten programs. Unix-Linux people often send the output of one command or utility to another command or utility for further processing. For example, the ps command displays active processes. It tends to generate voluminous output, especially in a busy system. Let’s say that you are interested only in the processes associated with a given terminal. You send (the technical term is pipe, expressed by the | character) the output of the ps command to the grep utility which looks for patterns within the input. You code a single line, multipart command to obtain the list of processes associated with that particular terminal. Unix and Linux are well known for elegant solutions. In contrast the Windows solution to this information need is much more clumsy.
The grep utility has many other uses including validating e-mail addresses. Let’s say that your web site asks potential subscribers to furnish their e-mail accounts when signing up for a newsletter. A sophisticated but relatively short statement coded in grep could validate e-mail accounts.
Other Damn Small Linux text processing utilities include the related egrep and fgrep commands, mawk a pattern scanning and text processing language, sed an editor that handles large files, and diff a utility that compares files. DSL provides utilities that compress and archive files, and a wide range of other utilities. If you need them, these Linux utilities can be quite useful and time-saving.
Our next subject is Linux programming support.
In Linux and other Unix-like operating system, you can detect and repair hard drive errors using fsck command. This command runs in 5 phases. In the first phase, it checks data blocks and their size while in second phase file and directory pathnames are checked. In the remaining three phases, the connectivity, file reference counts and the cylinder groups are examined respectively.
If in the second phase, fsck disk checking process fails, you might come across critical disk corruption situations and possibly data loss. In such circumstances, to retrieve lost, missing and inaccessible data from affected hard drive, you need to opt for linux data recovery solutions. The problem may occur due to corrupted or missing iNode entries from Linux hard drive. At this point, you might encounter below error message: “Root iNode is not a directory. Clear?” This behavior of Linux operating system renders all of your critical data on hard drive inaccessible and results into serious data loss situations. In order to salvage data from affected drive, you need to carry out data recovery linux by sorting out the problem.
Root of the issue
This problem occurs due to corruption to the root iNode of your Linux computer. The iNode is a critical data structure of Linux file systems that stores all critical information of the files and directories that are currently stored on the hard drive. The iNode could be referred as a unique number that is assigned to every file and for every file there is a single iNode. In this specific situation, root iNode that is generally the iNode number two has got corrupted. The root iNode is first iNode of Linux file system and represents starting point or root of the file system.
If you select ‘Yes’ in above error message, it would delete parent entry of every iNode from root directory. In such critical situations, you need to recover your lost data through third-party linux recovery software. Such applications employ high-end scanning techniques to methodically scan the entire hard drive and extract all of the lost data from it. The linux data recovery software are quite easy to use as they self-descriptive and interactive user interface with rich graphical support. The tools never alter original data on the hard drive as they have read-only and non-destructive conduct.
Stellar Phoenix Linux Data Recovery is the most effective and comprehensive application for quick, easy and secure recovery. It works well with all major distributions of Linux operating system including Red Hat, Ubuntu, Fedora and Debian. The software recovers data from Ext4, Ext3, Ext2 and ReiserFS file system volumes.