Linux File System Guide (primer) from Novell

last updated in Categories FAQ, Linux, News

Linux File System Primer (LFSP) is a guide for newbie as well as seasoned Linux administrator.

Linux offers a number of file systems. LFSP discusses all popular file systems, why there are so many, and which ones are the best to use for which workloads and data. Not all data is the same. Not all workloads are the same. Not all filesystems are the same. Matching the file system to the data and workload allows customers to build efficient scalable and cost effective solutions.

It is important to understand these different workloads and their requirements, as these drive requirements into file systems. This will also serve as a guide in comparing and contrasting the various file systems available in the market today.

It covers file system as per your need i.e. you want to use Linux for what purpose:

  • Desktop system
  • Workgroup Server
  • High Performance Computational Clusters
  • Business IT workstation

Overall, an excellent guide for everyone who always wanted to find out why so many file system exists? Also, do not forget to checkout File System Comparison from wikipedia the free encyclopedia.

Moreover, here’s a short guide on Linux/UNIX file system basic concepts on our own site.

Mount a Linux filesystem on a SAN from multiple nodes at the same time

last updated in Categories CentOS, FAQ, File system, Gentoo Linux, Hardware, High performance computing, Linux, Linux Scalability, RedHat/Fedora Linux, Storage

If you try to mount an ext3 Linux filesystem on a SAN from multiple nodes at the same time you will be in serious deep trouble.

SAN based storage allows multiple nodes to connect to same devices at the same time. Ext3/2 are not cluster aware file system. They can lead to a disaster such as kernel panic, server hang, corruption etc.

You need to use something which supports:

  1. Useful in clusters for moderate scale out and shared SAN volumes
  2. Symmetrical Parallel Cluster File System, Journaled
  3. POSIX access controls

Both GFS (RedHat Global File System) and Lustre (a scalable, secure, robust, highly available cluster file system) can be used with SAN based storage allows multiple nodes to connect to same devices at the same time.

Many newbie get confused as Linux offers a number of file systems. This paper (Linux File System Primer) discusses these file systems, why there are so many, and which ones are the best to use for which workloads and data.

Determine the block size on hard disk filesystem for disk quota

last updated in Categories FAQ, Linux

When configuring user disk quotas I need to find out the block size on my SCSI hard disk drive. For example if I am using a block size of 1024 then setting block size to 102400 blocks limit my user to 100MB of disk space.

Therefore, it is necessary to determine the correct block size; otherwise, I will end up assigning wrong disk quota limit.

You can use dumpe2fs command, which prints the super block and blocks group information for the filesystem present on device. You need to type dumpe2fs command as the root user:

# dumpe2fs /dev/sdb3 | grep -i ‘Block size’

Output:

Block size:               4096

Now setting a user quota of 40960 would limit a user to 10MB of disk space.

Please note that dumpe2fs command used to determine the actual size of a block on the filesystem (and not BLOCK SIZE OF FILESYSTEM not harddisk).

HowTo: Tunneling VNC Connections Over SSH

last updated in Categories FAQ, Howto, Linux

Virtual Network Computing (VNC) is a desktop sharing system which uses the RFB (Remote FrameBuffer) protocol to remotely control another computer. It transmits the keyboard presses and mouse clicks from one computer to another relaying the screen updates back in the other direction, over a network.

Sendmail is only accepting connections from localhost (127.0.0.1 IP)

last updated in Categories FAQ, Troubleshooting

Q. My sendmail service is running under Linux and whenever I try to telnet it from other LAN IP, it gives connection refuse error. If I connect it from localhost it accept connection. I can only send mail from my server only. How do I force sendmail to accept mail from other hosts/LAN ips?

A. For security reason sendmail is by default configured to accept connection from local system (127.0.0.1). This should avoid open mail relay problem.

To allow connections from ALL hosts/LAN IPs open sendmail.mc file (login as the root):

# vi /etc/mail/sendmail.mc

Look for line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl

Comment or remove above line and insert new line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Name=MTA’)dnl

Above line will force to accept connection from any host. Save the file. Regenerate sendmail configuration file using m4:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Restart sendmail service :

# /etc/init.d/sendmail restart

Caution: You should configure firewall and other Sendmail Anti-Spam configuration control to avoid problems.

See also:

Building a source RPM using rpmbuild command

last updated in Categories CentOS, FAQ, Howto, Linux, RedHat/Fedora Linux

Q. I need to build a source RPM, how do I build it?

A. In order to build a source RPM you need to use rpmbuild command. rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages.

You need to use .spec file to build the RPM file. Next type rpmbuild command as follows:

# rpmbuild -ba pakagename.spec

For more information, please refer Maximum RPM book.

Linux > More on USER ID, Password, and Group management

last updated in Categories FAQ, Howto, Linux, UNIX

In order login into Linux system (over ssh or other services ) you need a username and password.
Username and password stored in /etc/passwd and /etc/shadow file respectively. When you supplies password, it encrypts and compare with password stored in /etc/shadow, which is also in, encrypted format (it was stored when you or system administrator registers/updates it). If both are equal, you are in. Once logged in, you become the number to Linux kernel. You can obtain your user id and other information using id command:

$ id
uid=1002(vivek) gid=1002(vivek) groups=1002(vivek), 0(wheel)

Where,
=> Username = vivek
=> User numeric id (uid) = 1002

Numbers are uses to represent users and groups in Linux kernel because:
1) Simplified user and group management
2) Security management easy
3) Your UID applied to all files you create

It is always good idea to use the UID more than 1000 for all users for security reason.

Zero UID

The UID number 0 is special and used by the root user. The zero (0) UID enjoys the unrestricted/unlimited access to Linux system. Note that 0 UID assigned to name root; if you wish you can change this (poorly written program may fail) and assign different name.

Similarly, you have group id (GID). It is use by Linux to refer group names. Single user can be member of multiple groups. This result into very good flexibility for access the system and the sharing files. Many UNIX system uses wheel group as power user group. Like the UID value, zero GID value zero enjoys the unrestricted/unlimited access to Linux system.

Some time Linux and other UNIX like (FreeBSD, Solaris etc) uses EUID, RUID, and SUID concept.

The Effective User ID (EUID)

It is use to determine what level of access the current process has. When EUID is zero then the process has unrestricted/unlimited access. Following commands can be used to print Effective User ID under Linux:
$ whoami
$ id -un

The Real User ID (RUID):

It is use to identify who you actually are. Once it is setup by system (usually login program) it cannot be change till your session terminates. You cannot change your RUID. Only root (or person having zero UID) can change the RUID. Use the command id as follows to obtain Real user ID:
$ id –ru

The Saved User ID (SUID):

When new process / executable file such as passwd, started the effective user id that is in force at the time is copied to the saved user id. Because of this feature, you are able to update your own password stored in /etc/shadow file. Off course, executable file must have set-user-id bit on in order to setuid (system call). Before process ending itself it switches back to SUID.

In short,

  • RUID : Identify the real user, normal user cannot change it.
  • EUID : Decides access level, normal user can change it.
  • SUID : Saves the EUID, normal user cannot change it.
  • Real Group ID : Identify the real group
  • Effective Group ID and Supplementary group ID : Decides access level

Note that access level means kernel can determine whether you have access to devices, files etc.