September 23 2010

The Top Ten Concepts for Beginning Linux Users – Number 4, Permissions and Groups

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , ,

The easiest way for you to learn Linux permissions is to study an example. The ls -l command generates a list of contents, such as files along with their permissions. Let’s take a look at the default values for a file called Filename. We are adding spaces to make the output more legible.

- rw- r– r– other information about the file Filename

The initial – signifies that this is a file (not a directory). The next three characters refer to the file permissions for the file owner, in many cases the person who created the file. The values rw- signify that the owner has read and write (modify) permission but not execute permission. Had these values been r-x the owner would be allowed to read and execute the file (program) but could not modify it. The second set of values r– signify that the members of the group associated with this file have read but not write or execute permission. The third set of values once again r– signify that other users have read but not write or execute permission.

Permissions are often handled numerically. The r has a value of 4, the w has a value of 2, and the x has a value of 1. In all cases the lack of permission has the value 0. So rw- has the value 6 and r– has the value 4. In the above example the permissions may be expressed as 644. The full set of permissions for everyone is expressed as 777 (not usually a good idea).

Note that the root user’s permissions aren’t listed. This shouldn’t be surprising because root has essentially complete permissions. But even root doesn’t have execute permissions for a file it creates. This permission must be added in a separate step. Why? This two-step procedure has important security implications. Let’s say that an individual, perhaps root, has received an email that contains a virus-infested executable program. The program cannot be executed without the explicit permission of root or the recipient. If the user doesn’t know what to do the virus won’t be launched.

Linux defines permissions for directories that are similar to but not exactly the same as the file permissions. A read permission on a directory means that its contents may be listed. For directories write permission means that the user can modify its contents by adding, deleting, or renaming files. An execute permission on a directory means that it may be accessed, in other words made the current working directory.

Permissions may be changed via the chmod command. For example chmod 770 Junque which gives read, write, and execute permissions to the file owner and members of the ownership group but no permissions to anyone else. Many people prefer not to use these numbers. The symbolic mode uses letters and the plus and minus signs to change permissions.

The following command removes the write permission from the user (owner) of the Perm file chmod u-w Perm. To add the execute permission for others, those people who do not belong to the group that owns the file, apply the command chmod o+x Perm. This command only makes sense if the Perm file is executable. Furthermore, often the file owner and his or her group are granted more permissions that the others. Linux doesn’t check to see that your command really makes sense. Do you think that Windows is more intelligent in this respect?

The chown command is used to change the ownership of a file or a directory. The chgrp command is used to change the group ownership of files and directories. These commands might be used when a project passes from the development to the testing stage. Needless to say only the system administrator can execute these commands.

Of course there are additional aspects of Linux permissions and groups but we have covered the basics. The next article in this series discusses inodes, a topic that is sorely missing from the Windows bag of tricks.

Over the years Levi Reiss has authored or co-authored ten books on computers and the Internet. As you can tell from his wine websites including www.theitalianwineconnection.com he is quite a fan of fine wine, but always in moderation. He teaches various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college. Visit his new website http://www.linux4windows.com teaching you how to download and run Damn Small Linux even on that outdated Windows computer which has been gathering dust in the basement.

July 29 2010

Bad Block At Beginning Of Inode Table May Cause Data Loss In Linux

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Are you unable to mount your Linux hard drive volume? Are you facing superblock, inode, or file system corruption like error messages while booting your Linux system? Such situations are caused by corruption of Linux hard drive metadata structures. This behavior of Linux operating system renders all your significant data inaccessible and leads to significant data loss. In order to get your mission-critical data recovered, you should opt for Linux Data Recovery solutions through reliable tools.

In a practical scenario, you may encounter the below error messages after copying your data through ddrescue command-line tool and running e2fsck utility:

“Superblock has a bad ext3 journal (inode 8).
Clear? Yes”

Or

“/dev/sdf was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Missing ‘..’ in directory inode 1785876.
Fix? Yes

Pass 3: Checking directory connectivity
Root inode is not a directory; aborting.
e2fsck: aborted
fsck.ext2 /dev/sdf failed (status 0×8). Run manually.”

After the above error message, you can not access your precious data from the hard drive. In order to get your lost data back, and to sort out these errors, you should perform Data Recovery Linux.

Resolution

The problem is caused by bad block at the starting of inode table. You can fix the problem by reconstructing root inode. It is quite easy to reconstruct the root inode, however the problem is that root inode needs to be placed at fixed location and currently a bad block is located there.

Forcing the hard drive to use spare block from its pool is possible, however a bad block is often an indicator of the beginning of hard drive crash. Thus, replacing the affected hard drive with new one is the safest way to recover from this situation. Use ‘dd’ command to copy data from old hard drive to new one. Then run e2fsck to create a new root directory on the new hard drive, and shift all the inodes, respectively.

If the above method does not solve your problem, Linux Recovery applications perform absolute recovery. They use high-end scanning techniques to methodically scan the entire hard drive and get all your precious data recovered. The Linux Data Recovery software come equipped with simple and rich graphical user interface to enable easy recovery.

Stellar Phoenix Linux Data Recovery is the most effective solution for all logical data loss scenarios. The software recovers Ext4, Ext3, Ext2, FAT12, FAT16, and FAT32 file system volumes. It is compatible with all major distributions of Linux operating system such as Red Hat, Debian, Fedora, SUSE, and Ubuntu.

Maria Peter a student of Mass Communication doing research on Data recovery Linux , Linux Data Recovery software And Ext2 Recovery. she is also a freelancer for http://ext3-file-recovery.data-recovery-linux.com/

Incoming search terms for the article: