Red Hat Linux 9 Professional Secrets [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Red Hat Linux 9 Professional Secrets [Electronic resources] - نسخه متنی

Naba Barkakati

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








Starting Red Hat Linux for the First Time


After the installation is complete, the Red Hat Linux installation program automatically reboots the system. The PC goes through its normal power-up sequence and loads the boot loader-GRUB or LILO, depending on which one you selected when you installed Red Hat Linux. A graphical screen appears with the names of the partitions the boot loader can boot. You can press the up and down arrow keys to select the partition from which the system should boot. When you installed the boot loader, if you specified the Linux partition as the default one, you can simply wait; after a few seconds, Red Hat Linux starts.


Controlling Linux with Boot Parameters


Before you select a partition to boot, you can get a text-mode prompt from the bootloader and enter other commands. If you use LILO as the boot loader, press Ctrl-X and you get the following prompt:

LILO boot:

You can view the names of the available bootable partitions by pressing the Tab key. For example, a typical result of pressing Tab might be the following:

linux windows

Then, you can type the name of the partition from which LILO should boot.








Secret


Sometimes you need the text-mode LILO boot prompt so that you can specify boot-time arguments that LILO passes to the Linux kernel. For example, if you want to mount your root file system read-only so that you can run the file system consistency checking program (called fsck), you can specify this by typing the following line in response to the LILO boot prompt:

linux ro

Note that after you boot your Linux system with the root file system mounted read-only, no processes can write to the file system until you remount the file system again with the

mount -w -n -o remount / command.

If you use GRUB as the bootloader, press a when the GRUB screen appears. This causes GRUB to prompt you for commands to add to its default boot command (which, I assume, is set to boot Red Hat Linux). Then, you can type anything else you want to add to that command. For example, to boot the system into single user mode, press the Spacebar and type:

single

You can pass many more parameters to the Linux kernel. To learn the kernel boot parameters, type man bootparam in a terminal window (after you boot Linux).











After Linux starts, you should see a long list of opening messages, including the names of the devices that Linux detects. One of the messages says

Calibrating delay loop...

xxx.xx

BogoMIPS , where

xxx.xx is some number. BogoMIPS is one of those words that confound new Linux users.






Insider Insight

As you may know, MIPS is an acronym for millions of instructions per second-a measure of how fast your computer runs programs. As such, MIPS is not a very good measure of performance because comparing the MIPS of different types of computers is difficult. BogoMIPS is bogus MIPS, which refers to an indication of the computer's speed. Linux uses the BogoMIPS number to calibrate a delay loop, in which the computer processes some instructions repeatedly until a specified amount of time has passed.

The BogoMIPS numbers can range anywhere from 1 to 3,000 or more, depending on the type of processor (386, 486, or Pentium). An older 33MHz 80386DX system has a BogoMIPS of about 6, whereas a 66MHz 80486DX2/66 system shows a BogoMIPS of about 33. The BogoMIPS for newer Pentium systems is much higher. For example, on an old 200MHz Pentium MMX system, Linux reports a BogoMIPS of 398.13. However, on a laptop with a 1.5GHz Celeron processor, the BogoMIPS is 2,971.18. It's higher yet on more recent 3GHz or better Pentium 4 systems.



Configuring for the First Time with Firstboot


If you are booting Red Hat Linux for the first time after installation, a server named firstboot runs and displays a welcome screen about setting up Red Hat Linux. The firstboot server (Red Hat calls it the Red Hat Setup Agent) takes you through date and time setup, gives you a chance to register with Red Hat Network, and install any additional CDs.





Caution

If the screen goes dark and there is no activity, the first-time configuration utility may be having trouble starting the X Window System. Unfortunately, you cannot proceed any further without fixing this problem. Sometimes the graphical environment fails even though the graphical interface seems to work fine during installation. There are ways to fix this problem. Go to Chapter 2 for more information on how to troubleshoot this problem.


The Red Hat Setup Agent takes you through the following steps (you can skip these steps if you want)



  1. Set the date and time from a GUI screen. If your system is connected to the Internet, click the check box labeled Enable Network Time Protocol and then select a server from the drop-down list labeled Server. This way, the system is going to get its time directly from one of the superaccurate time servers on the Internet using the Network Time Protocol (NTP). After setting the date and time, click Forward.



  2. The Red Hat Setup Agent then prompts you if you want to register with Red Hat Network. To register, click Forward and respond to the requested information. After that step is done, click Forward again.



  3. The Red Hat Setup Agent displays a window from which you can install additional CDs. If you have additional CDs to install, click the appropriate icon. Otherwise, click Forward.










Secret


When you're done with the Red Hat Setup Agent you're really done for good because it is set to run only once when you boot for the first time. If, for some reason, you want to go through these steps again, you can run the firstboot server again. Log in as

root , and type the following command in a terminal window (to open a terminal window select Main Menu>System Tools>Terminal):

rm /etc/sysconfig/firstboot 
chkconfig --level 5 firstboot on

That's it! Next time you reboot the PC, firstboot should run again. If you want to run firstboot interactively from GNOME or KDE, you can do so by logging in as

root and typing the following commands in a terminal window:

rm /etc/sysconfig/firstboot
firstboot












Logging in at Graphical Login Screen


On first-time boot, you get the graphical login screen after you're through with the Red Hat Setup Agent. At other times, you would first see the boot messages, and at the end of all the messages, if all goes well, you get a graphical login screen, such as the one shown in Figure 7-1.


Figure 7-1: Graphical Login Screen in Red Hat Linux.








Secret


You won't get a graphical login screen if your system is set for text-mode login or if there is something wrong with your X Window System setup. If you get a text-mode login screen, log in as usual and then you can configure X or switch to a graphical login. First check the runlevel with the following command:

runlevel

If you see a response with the number 3, then your system is set for text-mode login. You can enter graphical login with the following command

telinit 5

On the other hand, if the output of runlevel contains the number 5, then there may be something wrong with the X setup. You should consult Chapter 3 for more information on how to set up X.

If you get the graphical login screen, a login window in the middle of the screen displays a welcome message with your system's hostname-the name you assign to your system when you configure the network. If the network is not configured,

localhost.localdomain is the hostname. If you use DHCP to configure the network, the DHCP server provides a hostname for your system. The login window also has a text input field that prompts you for your user name.











You can log in using any of the accounts you define during the installation, including

root . For example, to log in as

root , type root in the first text field, and press Enter (move the mouse over the login dialog box before you begin typing). Then, type the root password (the one you set during installation) to log in as the super user.

Because the default GUI is GNOME, the GNOME desktop appears, as shown in Figure 7-2. As you can see, the desktop is similar to the Windows desktop. Now, you can perform a few initial chores and learn how to shut down your Red Hat Linux system.


Figure 7-2: Initial GNOME Desktop.

Take a moment to look at the initial GNOME desktop as it appears in Figure 7-2. The GNOME desktop is very much like the Windows desktop. The GNOME Panel-similar to the Windows taskbar-appears along the bottom edge of the screen.You can access various menus and launch applications from the GNOME Panel. The Panel also contains such applets as the Clock, which displays the time in a small area at the right edge of the Panel.






Cross Ref

You learn more about the GNOME desktop in Chapter 9. For now, all you need to know is that the red hat icon at the left edge of the GNOME Panel is the Main Menu button. This button is like the Start button in Microsoft Windows. You can access many programs from the Main Menu button (the red hat icon). You can also start some programs by clicking the icons on the Panel. For example, to start the Mozilla Web browser, click the earth-and-mouse icon on the Panel.


The following sections show you how to log out of and shut down your Red Hat Linux system.


Logging Out


Now that you have seen how to log in, you should learn how to log out. To log out, select Main Menu (the red hat icon)>Log Out. The screen is grayed out, and a dialog box asks you if you really want to log out. Click the OK button to log out.






Cross Ref

After a few moments, the graphical login screen (refer to Chapter 9.



Shutting Down Linux


When you are ready to shut down Red Hat Linux, you should do so in an orderly manner. Even if you are the sole user of a Linux system, several other programs are usually running in the background. In addition, operating systems such as Linux try to optimize the way in which they write data to the disk. Because disk access is relatively slow (compared with the time needed to access memory locations), data usually is held in memory and written to the disk in large chunks. Therefore, if you simply turn the power off, you run the risk that some files will not be updated properly.

Any user (you do not have to be logged in as

root ) can shut down the system from the GNOME desktop. The Logout dialog box provides the options for rebooting or halting the system. To shut down the system, simply select Shutdown, and click OK. The system then shuts down in an orderly manner.





Caution

Note that it does not require root access to shutdown or reboot the system in this manner. This is why you need to make sure that physical access to the console is protected adequately.


As the system shuts down, you see messages about processes being shut down. You may be surprised how many processes there are, even though no one is explicitly running any programs on the system. If your system does not automatically power off on shut down, you can manually turn the power off.








Secret


If you are already logged in as

root , you can use the

shutdown command to halt or reboot the system. If you are already logged in using another user name, you can become the super user by typing the following command (your input is shown in boldface; my comments are in italic):


su -
Password: (type the root password and press Enter)

When you become root by typing

su - (instead of

su alone), you also get root's environment, including settings such as the

PATH environment variable. This enables you to run many system utilities without having to explicitly specify their path.

After you become a super user, type the following command to halt the system:

shutdown -h now

After a few moments, you see many more messages about processes being stopped. On older systems, you see a message about the system's being halted. You can then turn the power off. On newer systems, the shutdown process also turns the power off.

If you want to reboot the system instead of halting it, use the

shutdown command with the

-r option, as follows:

/sbin/shutdown -r now

On the other hand, you can also simply type reboot to restart the system.












/ 341