An Overview of Linux

 <  Day Day Up  >  

Test Objective Covered:

1. Describe the characteristics of Linux.

As mentioned in Chapter 1, "Introduction to the CLE Practical Exam," Novell had a tough decision to make when designing the Certified Linux Engineer (CLE) certification. Should it be directed toward existing Novell Certified Novell Engineers (CNEs) who need to learn how to manage the products and services they are already familiar with on the Linux platform, or should it be directed at Linux professionals who need to learn how to use Novell products and services?

After a great deal of discussion and debate, Novell decided to aim for both audiences with this certification. To accommodate those who might not have a background in Linux, Novell included a series of objectives in the CLE that covers some basic Linux concepts.

This chapter and Chapter 3 of this study guide present a quick introduction to Linux and provide a review of some common Linux administrative tasks . Be aware that Novell assumes you have some degree of Linux experience prior to taking this course.

The content in this chapter and Chapter 3 are not intended to make you a Linux expert. Instead, they are intended to help you study the key tasks you will need to know in order to complete the exercises that appear later in the study guide. As mentioned in Chapter 1, you might want to obtain additional Linux study materials if you are new to Linux.

If you are already experienced with the Linux operating system, you may want to jump ahead to Chapter 4, "Introduction to Novell Nterprise Linux Services (NNLS)," using this chapter and Chapter 3 as a reference.

A Historical Review of Linux

Linux is somewhat of an anomaly in the computer software world. Most software products, whether they are applications or operating systems, are developed as a part of a planned and well-organized effort. Usually, a software company first identifies a customer need. It then assembles a design team that hashes out a product requirements document (PRD).

The tasks in the PRD are allocated to teams of software developers who write their assigned portions of the code. The developed code is checked and the product is tested through a series of alpha- and beta-stage testing cycles. If it measures up to expectations (or is at least reasonably close), the finished product is shipped to the customer.

After the customer has used the product for a period of time, the software company notes its deficiencies and a revision process starts the cycle all over again.

The advent of Linux didn't conform to this corporate product development cycle. Instead, one person ”Linus Torvalds ”initially developed it while he was a graduate student at the University of Helsinki in Finland.

During his studies in the early 1990s, Torvalds developed an interest in a freeware product called Minix, an educational version of the commercially developed Unix operating system. Andrew S. Tanenbaum, a university professor in the Netherlands, developed Minix, which looked and behaved like Unix, but was written completely from scratch. At the time, there were three main operating systems available:

  • MS-DOS (and other variants such as PC-DOS and DR-DOS)

  • Mac OS

  • Unix

The source code for each of these operating systems was carefully protected by patent and copyright. At an earlier point in time, the source code to Unix had been made available to universities for teaching purposes. This practice had been stopped , however, leaving Tanenbaum without an effective means for teaching his students about the inner workings of an operating system. To provide this, he developed a small educational version of the Unix kernel that he called Minix. Its purpose was to provide students with a real operating system with source code access. Heralding things yet to come, Tanenbaum included the source code to Minix in his textbook Operating Systems: Design and Implementation .

Inspired by Tanenbaum and his Minix operating system, Torvalds developed his own Unix clone in 1991, which he dubbed Linux. It's important to note that Torvalds didn't initially develop a full-blown operating system complete with a full suite of applications and utilities. Instead, Linux version 0.02, released on October 5, 1991, provided only the Linux kernel and three utilities: bash (a command-line interface), update (a utility for flushing file system buffers), and gcc (a C++ compiler).

Note

Interestingly, Tanenbaum and Torvalds didn't always get along. They reportedly had many heated email discussions .


In an unprecedented move, Torvalds made the Linux source code freely available over the Internet to anyone who wanted to download it. Torvalds even went so far as to invite other programmers to refine and enhance his code. At that point, Linux became a worldwide collaborative project. Version 1.0 of the Linux kernel was released in 1994. The results since have been nothing short of amazing.

About GNU

A discussion of the history of Linux would be incomplete without introducing GNU's Not Unix (GNU). The GNU movement exerted a significant influence on Torvald's development of Linux.

In the early 1980s, a programmer from the Massachusetts Institute of Technology named Richard Stallman objected to the proprietary nature of software development, so in 1983 he launched the GNU project. This project was dedicated to the advancement of freely distributable source code. Stallman felt that source code should be free from restrictions against copying, modification, and redistribution. He believed that allowing programmers to modify an application's source code would result in better software.

Powerful applications, such as the GNU C Compiler (gcc) were subsequently developed, and many of them were written to run on Linux. The availability of an array of powerful GNU applications on Linux was a key factor in taking the Linux kernel from a hobbyist's project to a robust tool capable of doing real work.

Linux itself is licensed under the GNU General Public License (GPL), which ensures that the operating system's source code will remain freely available to anyone who wants it. Anyone is free to download the Linux kernel's source code, modify it to meet their own requirements, and then recompile and run it.

This is a very significant aspect of Linux, as most software vendors do not make their products' source code available. To even further protect themselves , most have a section in their End User License Agreement (EULA) that forbids the user from reverse-compiling the software.

Note

Reverse-compiling is a process in which a special application is run against a binary file to reproduce the file as code in a text file. The resulting code isn't an exact duplicate of the original source code, but it can be very close .


Linux Distributions

You're probably aware that there are many different Linux distributions available. Among the choices, there's SUSE Linux, Red Hat Linux, Slackware Linux, and many others. This is yet another unique characteristic of Linux ”nearly every other operating system is developed and marketed by a single vendor. For example, the only vendor who develops and sells OS X is Apple, Inc. You can't go to Novell or Microsoft for their versions of the Mac OS.

With Linux, however, there are many different, independent companies that each sell their own distribution.

The GPL also allows developers to bundle their own utilities and applications with the kernel and create what is known as a distribution .

To draw a comparison, imagine that you want to purchase a copy of the latest version of Windows. If Windows were licensed under the GPL, you would notice at your local computer store that there are hundreds of different "flavors" of the operating system available from many different software vendors ”only one of which is Microsoft.

Each flavor is slightly different from the others; although they're still based on the same operating system kernel. One might be optimized to provide web-based services, and another might be optimized for video editing. Imagine being able to sort through the different flavors and find the one that is best geared toward what you want to do.

Sounds far- fetched ”but with Linux, that's exactly what is available to you. Many different software vendors have taken the basic Linux kernel, modified and recompiled it according to their specifications, bundled some value-add applications with it, and redistributed it as their own Linux distribution.

Today there are, quite literally, more than 100 different distributions available. This course will use SUSE Linux from Novell as the distribution for running NNLS. Most of the concepts and skills taught in Chapters 2 and 3, however, can be transferred to almost any other distribution. You can learn more about these Linux distributions by visiting http://www.linuxiso.org.

The Function of Linux in a Computer System

Let's turn now to a discussion of the part Linux plays in a computer system. Believe it or not, this is actually a point of confusion for many. Because most of the PC systems sold over the past two decades have had a version of either MS-DOS or Windows installed on them, many end users don't understand the modular role of an operating system.

Many tend to see the operating system as an integral, inseparable part of the PC. I've encountered many users who are under the impression that Linux is some kind of application that runs on top of DOS or Windows. I kindly explain to them that Linux is an operating system, not an application, and that it is used instead of DOS or Windows. In other words, it is a substitute for Windows, not a complementary application.

Even with this explanation, it is inconceivable to many that you can pull Windows or DOS off a system and use Linux as the operating system. To avoid this kind of confusion, let's discuss the generic role of an operating system.

All operating systems, whether they be DOS, Windows, Mac OS, Unix, NetWare, or Linux, provide four key functions in the computer system:

  • Application platform ” Applications generally don't access the system hardware directly. Operating systems provide a platform where applications can be run. Operating systems manage and prioritize application access to the system.

  • File storage ” Operating systems provide a means for writing, organizing, and retrieving data from system storage devices.

  • Security ” Most modern operating systems are multiuser systems. They use rules configured by the system administrator to identify who the authorized users of the system are and what they can do within the system.

  • Hardware moderator ” A key role of an operating system is providing applications with easy access to system resources. It provides a means for applications to address the CPU, place information in RAM, read and write information to the hard disk drive, and communicate with peripherals such as printers, COM ports, or network boards . Instead of having to write code from scratch to do these tasks, most operating systems contain prewritten, reusable routines that the application programmer can use to interact with system hardware. It also provides methods for managing system input and output devices such as the keyboard.

The difference between operating systems is how they are designed and how they fill these roles. As you might guess, some fill these roles better than others.

Introduction to the Linux User Interface

For an operating system to be useful, it must provide an interface that allows the end user to easily communicate with it. Linux provides two user interfaces:

  • The command-line interface ” The basic Linux interface is the command-line interface. The user communicates with the operating system by entering commands at a shell prompt. A common Linux shell prompt is shown in Figure 2.1.

    Figure 2.1. A Linux command-line interface.

    graphics/02fig01.jpg


  • The X Window System graphical interface ” In a world dominated by graphical user interfaces, a command-line only operating system may face some resistance. There are many computer users in the world today, both end users and system administrators, who have never had to use a command-line interface. To make it easier to use, the XFree86 project developed an X Window system that runs on Linux. Using the base XFree86 system along with a window manager (such as GNOME or KDE), users can interact with the Linux kernel in a graphical environment. The GNOME graphical interface on SUSE Linux is shown in Figure 2.2.

    Figure 2.2. A Linux graphical interface.

    graphics/02fig02.jpg


An Introduction to the Linux File System

As mentioned earlier in this chapter, one of the key roles filled by an operating system is managing a storage system that allows files to be written and retrieved from storage devices such as floppy disk drives and hard drives .

Linux uses a hierarchical file system much like other operating systems you might be familiar with. Consider the Windows file system shown in Figure 2.3.

Figure 2.3. The Windows file system.

graphics/02fig03.jpg


At the top of the Windows file system is the root directory. In this example it is C:\.

Real World

Technically, C: identifies the drive letter assigned to the NTFS partition. The \ indicates the root directory of the file system on that partition .


Files or other directories can exist within the root directory. Sometimes these are called subdirectories . Subdirectories can contain other subdirectories or files. In this example, there is a file named MyStuff.txt. It is located in the MyStuff directory. MyStuff is a subdirectory of the Temp directory; which is, itself, a subdirectory of the root directory \.

To describe the location of the MyStuff.txt file, you prepend the path to the file to its name . In this example, you would use C:\Temp\MyStuff\MyStuff.txt .

Linux works in a very similar manner. However, there are some differences you should be aware of. Consider Figure 2.4 as an example.

Figure 2.4. The Linux file system.

graphics/02fig04.jpg


Just as with the Windows file system, there is a root directory. Instead of being referenced as \, the Linux root directory is referenced as /. The root directory contains subdirectories and files. In this example, there is a file named MyStuff.txt located in the MyStuff directory. This directory is a subdirectory of the Temp directory ”which is itself a subdirectory of the root directory /.

Notice that the only apparent differences, so far, are the absence of a drive letter and the direction of the slash. Windows (and DOS, for that matter) use the back slash character (\) in the directory structure. Linux, on the other hand, uses the forward slash (/).

There are, however, more significant differences between the Windows file system and the Linux file system. Let's investigate, in the sections that follow, some of the most critical aspects of the Linux file system you need to understand to succeed in this course.

Case Sensitivity

Recall our Windows example: You can reference the file specified as C:\Temp\MyStuff\MyStuff.txt by C:\TEMP\MYSTUFF\MYSTUFF.TXT , C:\TEMP\MYSTUFF\MyStuff.txt , C:\Temp\MyStuff\MYSTUFF.TXT , or any other combination of upper- and lower-case characters . File and directory names under Windows (or DOS) are not case sensitive.

Under Linux, however, file and directory names are very case sensitive. In the example presented here, the correct path and file name is /Temp/MyStuff/MyStuff.txt . If you try to reference this file as /TEMP/MYSTUFF/MYSTUFF.TXT or as /temp/mystuff/mystuff.txt , it will fail. According to the standards used to define the Linux file system, these two names point to completely different files and directories.

Mount Points

The Windows file system uses a drive letter ”in the example given, the drive letter is C: . Drive letters are used by NTFS and FAT file systems to uniquely identify a partition on the hard drive. There could be multiple partitions on the drive (each with its own drive letter assigned), or there could be one partition that encompasses the entire drive. Each drive letter has its own hierarchical structure underneath it.

Linux, on the other hand, doesn't use drive letters. Like Windows, the Linux file system can use multiple partitions, but instead of assigning a new drive letter to each partition, the Linux file system incorporates each partition within the same hierarchical structure using mount points .

A mount point is simply a directory in the file system that points to a different Linux partition. This partition could be on the same hard drive in the same system, a partition on a different hard drive in the same system, or even a remote file system on a hard drive in a different PC.

Note

To mount remote file systems, you must use the Network File System (NFS) service .


When you change to the directory where the mount point is set, the Linux file system takes you to the different partition or file system.

For example, suppose you use your Linux system to edit video footage. The raw files you work on take tremendous amounts of space and you need to add a new 200GB hard drive to your system.

To do this, you would first partition and format the drive. Then you can create a directory in the existing file system where you want to mount the new partition ”say, in /home/rtracy/rawfootage . You can then use the mount command to mount the new hard disk in the file system.

Real World

To automatically mount the partition every time the system boots, you can place an entry in the /etc/fstab file ”a file system table. We'll cover the fstab file later in the book .


To save a file on the new hard drive, you simply save it to /home/rtracy/rawfootage and it will be automatically redirected to the new disk.

This metaphor applies to removable devices such as CDs, DVDs, or floppy disks as well. Recall that in the Windows file system, floppy disk drives and CD/DVD drives are assigned their own drive letter.

Under Linux, these devices are mounted and incorporated into the Linux file system's single unified hierarchical structure. On a SUSE system, CDs or DVDs are mounted, by default, in the /media/ cdrom directory. Floppy disks are mounted, by default, in the /media/floppy directory. SUSE uses the /mnt directory for mounting local hard disks or remote NFS file systems.

Note

Using the mount command, you can actually mount a CD or a floppy disk in any directory in the file system you want .


On other Linux distributions, such as Red Hat, the default mount directory for CD/DVDs is /mnt/cdrom . The default mount directory for floppy disks is /mnt/floppy .

Another difference is the fact that, on a Windows system, a floppy diskette or a CD/DVD is immediately available as soon as you insert it in the system. Depending on the Linux distribution you are using, this may or may not be the case. On some systems, when you insert a CD, DVD, or floppy disk, you must manually mount it before you can access it.

Other systems might be running a process that detects the insertion of a disc or diskette and automatically mounts it in the default mount directory specified in the /etc/fstab file.

Linux Partitions

A key difference between the Windows and Linux file systems is the types of partitions used. Windows 95, 98, and Me provide FAT16 and FAT32 partition types. Windows NT, 2000, and XP provide FAT32 and NTFS partition types.

Although Linux can actually mount these types of partitions into its hierarchical tree, the Linux file system itself uses very different types of partitions. Older Linux distributions use EXT2 partitions. Newer distributions use the EXT3 (Red Hat and others) or ReiserFS (SUSE) partition types.

EXT3 and ReiserFS partitions use a process called journaling. To understand journaling, you need to understand that one of the key responsibilities of the system is to protect data integrity.

One of the ways this is done is by recording information about each file in the file system such as its size , the time and date of the last modification, and its path.

In an EXT2 partition, an improper system shutdown could cause some of this cached data to not be written properly to disk.

When the system was subsequently restarted, this issue would be detected and a repair would be automatically attempted by the fsck (file system check) utility. The problem with this process is that fsck could take a great deal of time, depending on the size of the file system, to repair all the problems.

EXT3 and ReiserFS compensate for this using a process called journaling . Simply speaking, the journaling process records every action that is going to take place on all file system files before the actions actually occur. If an improper shutdown occurs, the system simply checks the journal and compares it against the actual state of the files. Any actions that were missed as a result of the improper shutdown can be quickly identified and subsequently completed. This allows an improperly shut down system to come back up much more quickly than a system that uses EXT2 partitions.

Another difference is the number of partitions used. On most Windows systems, a single disk system generally only uses a single partition, as shown in Figure 2.5.

Figure 2.5. Default Windows partitions.

graphics/02fig05.jpg


On most Linux systems, however, there are three partitions by default, as shown in Figure 2.6.

Figure 2.6. Default Linux partitions.

graphics/02fig06.jpg


  • /boot ” This partition is an EXT2, EXT3, or ReiserFS partition, and it is usually 50MB to 100MB in size. This partition is represented by the first entry in the list of partitions shown in Figure 2.6. Notice that it is the only partition marked as bootable. It contains the Linux startup files. Because it is a bootable partition, it must reside within the first 1,024 cylinders of the hard disk drive, although this usually isn't a problem. Most Linux install programs can automatically partition your hard disk for you, and they will ensure that this partition resides where it should on the disk. This becomes an issue if you decide to manually partition the drive, or if you are creating a dual-boot system.

  • / ” This partition is an EXT2, EXT3, or ReiserFS partition and is mounted at the root directory of the hierarchical file system. It contains the Linux system files, utilities, and user files. It is represented by the third partition displayed in Figure 2.6.

  • Swap ” If you're familiar with Windows, you know that every version since Windows 3.0 creates a swap file on the hard drive. Linux does things a little bit differently. Instead of a file in the file system, Linux uses a dedicated swap partition. This is the second partition shown in Figure 2.6. Again, if you let your Linux install program partition your drive for you, it should automatically determine the proper size for you. If you manually partition your hard drive, the general rule of thumb is that the swap partition should be at least as big as the amount of RAM in the system.

Linux Bootloaders

A bootloader is a small piece of software that resides in the boot sector of the first hard disk in the PC system. When a PC boots, the system BIOS on the motherboard first takes control of the system. It runs various tests to verify that critical pieces of hardware, such as the system memory, hard disks, and so on, are available and responding. When it's done, the BIOS searches for a bootloader. If it finds it in the prescribed location, the BIOS relinquishes control of the system to the bootloader.

The bootloader software is configured with the location of the startup files of the operating system on the hard disk drive. If multiple operating systems have been installed, the bootloader can be configured to present the user with a simple menu that allows him to choose the operating system to load.

All operating systems come with some kind of bootloader. There are two commonly used bootloaders in Linux systems:

  • Linux Loader (LILO) ” The LILO bootloader was used on earlier Linux systems. Because it was very popular at one time, most modern distributions still provide LILO as an optional bootloader that can be installed. The configuration parameters for LILO are stored in the /etc/lilo.conf file shown in Figure 2.7. If you make any changes to this file, you need to enter lilo at the shell prompt before rebooting your system, or else the changes won't take effect.

    Figure 2.7. The LILO bootloader configuration file.

    graphics/02fig07.jpg


  • Grand Unified Boot Loader (GRUB) ” GRUB is the default bootloader used on most newer Linux distributions. As with LILO, you can customize the way GRUB works by editing its configuration file. There are actually two files you need to be concerned with: /etc/grub.conf and /boot/grub/menu.lst . The menu.lst file is shown in Figure 2.8.

    Figure 2.8. The GRUB bootloader configuration file.

    graphics/02fig08.jpg


Introduction to Linux Users

The last topic we will address before actually installing a new SUSE Linux server will be that of Linux user accounts. Most modern operating systems are multiuser systems; this means that more than one person can use the same operating system on the same PC. When the system is first booted , you must authenticate using a valid username and password before you are allowed to do anything further with the system.

Note

Linux actually takes this concept one step further. Using various utilities and configurations not covered in this guide, multiple users can use the same operating system at the same time .


Most Linux install programs create two users by default when you first create the system. The first is the root user. This account is the superuser account. It is comparable to the Administrator account in a Windows system or the Admin account in a NetWare system. The root account has, by default, all rights to all files, services, and user accounts in the system.

The second account created during most installation routines is a generic user account that you name, which has limited access to the system. Because the root account is so powerful, most system administrators don't actually use it unless they have to. For day-to-day tasks, they will authenticate as a generic user that has limited access to the system. When they need to perform root-level tasks, they will change to the root account using the su - command at a shell prompt.

The concern is that if an administrator authenticates as root and stays logged in throughout the day, it creates a small security breach that unauthorized users can breach. For example, consider what could happen if the system administrator, logged in as root, steps away from her desk to pick up several documents she sent to the printer. While she's gone, an unscrupulous individual could potentially have enough time to exploit the root-level access and compromise the system.

To avoid this, you should log in to your system as a regular user and only switch to the superuser account when absolutely necessary.

Note

If you routinely use the root account, your fellow Linux system administrators will probably tease you mercilessly!


Whenever you create a new user account, a home directory is automatically created for that user in the /home directory, as shown for the student user in Figure 2.9.

Figure 2.9. The home directory for users.

graphics/02fig09.jpg


The exception to this rule is the root user. This user account has its own exclusive home directory called /root .

 <  Day Day Up  >  


Novell Certified Linux Engineer (CLE) Study Guide
Novell Certified Linux Engineer (Novell CLE) Study Guide (Novell Press)
ISBN: 0789732033
EAN: 2147483647
Year: 2004
Pages: 128
Authors: Robb H. Tracy

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net