Primer Estudio: Aproximación Cuantitativa
Factor 2: Conversación política con amigos y vecinos
After the kernel’s finished loading, it passes off the system initialization process to a program named init. The initprogram is responsible for start- ing all services and programs. You can see these processes starting as they scroll up the screen with [OK]or [FAILED]on the right side of the monitor. If you see these lines, you know that your kernel has finished loading.
The main problems you may encounter with initare services(programs that run in the background) that fail to start properly, as indicated by the
[FAILED]status shown during the boot process. Services usually fail because of misconfigurations or unsupported hardware drivers. Sometimes a problematic service takes a long time to start up, so you may need some patience while you wait it out.
With many of these services, failure to start doesn’t keep you from logging in and using your system. After the machine boots, you can use the techniques described in Chapter 13 to shut off a problematic service if it’s being a pain. If the machine can’t boot because of this service, you’ll need to access your distribution’s rescue mode to shut off the service — and rescue mode is cov- ered in the next section.
Entering Rescue Mode
Heavy-duty system repair tends to happen in rescue mode — a special boot selection that simulates your hard disk by setting up what is called a RAM disk,holding the files entirely in memory. The benefit of this option is that you can perform necessary system surgery even if your installed system is hopelessly broken. The drawback is that this is a purely command-line interface — you really have to know your stuff to find your way around. Appendix A contains a list of Linux commands to try to help you out. Chapter 20 addresses, among other things, how to fix your boot loaders from here (if your problem is with the boot loader), and how to track down the error mes- sages your kernel might have left behind. You may also be able to find helpful tips by reviewing your distribution’s documentation and online help forums. Knoppix is quite popular to use for system rescues because it’s a whole distribution on a CD or DVD. (For more on Knoppix and live CDs and DVDs, see Chapter 4.) See Chapter 21 for two ways you can use Knoppix for system repairs.
Just about every Linux distribution includes a rescue mode. Fedora’s is the only rescue mode I have room to cover in step-by-step detail (a little farther along in this chapter), but at the very least, here’s a quick reference to how to find the rescue mode in the distributions covered in this book:
Getting into rescue mode (a quick guide)
⻬Linspire:The CD contains a rescue mode and there’s also one availableat the boot loader menu if you can get that far. For the CD, when the installer starts, use your arrow keys to select ADVANCED OPTIONS, press Enter, and then navigate with the arrow keys to RUN Diagnostics, pressing Enter to proceed. If you can get into the boot-loader menu, select Diagnostics by using the arrow keys and then press Enter.
⻬Fedora:The DVD that came with this book, the DVD that you down- loaded, or the first installation CD, contains a rescue mode that you can enter by typing linux rescueat the installer’s boot prompt.
⻬Mandriva:The first CD or DVD contains a rescue mode. When the installer starts, press F1 to access the command prompt, type rescue, and then press Enter.
⻬SuSE:If you obtained OpenSuSE or purchased the full version, the DVD, or the first installation CD, contains a Rescue System menu option. Use your arrow keys to highlight this option and then press Enter.
⻬Ubuntu:The CD contains a rescue mode. When the installer starts, press F1 to access the command prompt, type rescue, and then press Enter.
⻬Xandros:The CD contains a rescue mode. When the installer starts, press the Shift key. This action opens a list of menu options. Use the arrow keys to select Rescue Console, and then press Enter.
Using Fedora Code rescue
mode (step by step)
To enter rescue mode in Fedora Core, place the DVD or your first CD into your DVD-ROM or CD-ROM drive and boot the machine. Then follow these steps:
1. When the disk first loads, type linux rescueat the boot prompt.
This action begins booting the system into maintenance mode.
3. Select your keyboard type and press Enter.
The rescue system does its thing for a while, perhaps a minute or two on a slow system.
4. When asked whether you want to start the network interfaces, answer No unless you know you need to download something.
5. At the Rescue screen, select one of the three options offered, and then press Enter.
Your three options are
•Continue:The rescue interface tracks down your installed Fedora Core system for you.
If you select this option (or the next) and it fails, you may need to reboot and restart the rescue system. After restarting, choose Skip. •Read-Only:The same as Continue, but you can’t make any changes
to your hard-drive installation.
•Skip:If you choose this one, it’s like saying Don’t bother trying to locate the filesystem, just give me a prompt!
I assume that you chose Continue. If so, a shell prompt(the rescue command-line interface) appears, and you now have access to the rescue interface.
6. If the rescue process was able to load your Fedora installation, type
chroot /mnt/sysimage.
Doing so enables you to use your system without having to type /mnt/ sysimagein front of everything.
7. When you’re finished, keep typing exituntil the machine reboots, and then eject the CD or DVD as the reboot happens.
Don’t Just Turn Off the Machine!
Even when you’re not tapping the keyboard or clicking buttons, Linux is still running along in the background, doing lots of housekeeping chores. Some of these chores may involve swapping cached datato and from the fixed disk — a geeky way of saying that it’s actually jotting down things onto your hard drive that before it had just been making sure to remember in RAM. When you shut off the power out of the blue, anything the computer was remember- ing but hadn’t written is lost (kind of like when you or I fall asleep before making a to-do list for the next day).
If you’re used to Windows 98, you need to recondition yourself: Don’t just shut off the power when you’re finished. For one thing, many Linux users leave their computers on when they’re not using them — they just log out of their accounts so no one can mess with their stuff — and (oh yeah) shut off the monitor because monitors draw a lot of power.
When you do decide to turn off your Linux machine, for whatever reason, you must shut down the computer in an orderly manner. You can use one of these methods to shut down Linux properly:
⻬If you’re in the GUI, log out of your account by using the main menu’s Log Out option — Fedora Core users will find it under System➪Shut Down — and then click the dialog box option that says (strangely enough) Shut Down.
⻬If you have a command prompt open, type the haltcommand at the shell prompt (#) followed by the root password; then when you press Enter, Linux shuts itself down and tells you when it’s all right to turn off the machine.
⻬If you have a command prompt open, type the rebootcommand; then when you press Enter, Linux goes through the motions of shutting itself down, and then immediately reboots the machine.
⻬If you have a command prompt open, typing shutdown -f now(and then pressing Enter) is the most traditionally accepted method. The
shutdowncommand optionally allows you to send messages to logged- in users and determine how long until the shutdown takes place. Another method is to use the poweroffcommand, which is just an alias to the previously mentioned haltcommand.
If you do accidentally cut the power to your Linux box, take heart; all is not lost. More often than not, you can reboot your computer and pick up where you left off. However, you may have to pay for your error by waiting during a quick filesystem check while the machine makes sure that nothing was dam- aged. This process is similar to the one Windows uses when somebody powers off incorrectly: The operating system may need to scan its hard drives to make sure that everything is okay.
If you’re plagued with brief power outages or spikes that cause your computer to reboot, look into getting a UPS (Uninterruptible Power Supply) for your computer. These heavy, rechargeable batteries are designed not only to pro- tect your computer from damage (read the box to see what features a particu- lar UPS offers) but also to provide an extra five minutes or more of power so you have a chance to close your files properly and shut down your machine when the power goes out. Better yet, for those really brief spikes, the only
inconvenience you’ll have to deal with if you have a UPS in place is listening to it complain with beeps. The spike won’t affect your computer at all!
Removing Linux from Your System
Although I’d hate to see you exit the Linux universe, I’d also hate to see you get trapped in Linux if you don’t want to use it! How to most easily get rid of Linux depends on what you want to do:
⻬If you want to replace Linux with Windows, just install Windows on the machine. It will overwrite all of Linux, including the boot menu.
⻬If you want to remove Linux from a dual-boot setup, then boot into Windows, access a command prompt, and type fdisk /mbr. This action removes the Linux boot loader. It doesn’t erase Linux, but you can then format the Linux drive(s) or partition(s) for Windows. Windows XP and Xandros users have a special command they can use to remove this distribution. Boot your machine by placing your Windows XP CD-ROM into the Recovery Console. Change to the Windows directory, type
Chapter 6
Checking Out Those Desktops
In This Chapter
䊳Choosing the right interface
䊳Utilizing the command line
䊳Getting into GNOME basics
䊳Considering KDE basics
䊳Changing between GNOME and KDE
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a workstation . . .
— Steven Wright
A
lot of people like to characterize Linux as a DOS-like environment, where all you can do is operate in this antique-feeling world where you have to type a lot of cryptic stuff without any pretty pictures. However, the Linux desktop offers you quite a nice working environment, as you see throughout this chapter. The cool thing is that most of it is configurable. Those who like to customize their systems can have way too much fun changing things around.Deciding Which Interface to Use
Linux has two interface types: the command-line interface (CLI)and the graph- ical user interface (GUI).If you use other computer systems, such as Windows or the Macintosh, you’re already familiar with a GUI, with its pictures to look at and icons to click. Most Linux distributions include different versions of one of the two main GUIs available in the Linux world (GNOME and KDE).
If you’ve been using computers for a long time, you may also be familiar with the command-line interface, which usually consists of a black screen showing nothing but parallel lines of white text. The initial release and early develop- ment of Linux was all command-line oriented; GUIs then grew as the icing on the Linux cake, making it a lot more colorful to use and easier for people who would rather point and click than type.
In choosing between the command line and the GUI, you need to consider a number of factors. For a lot of people, this decision is pretty much a no- brainer issue. They have no intention of leaving GUIs behind. That’s fine, but at the very least, you may want to become familiar with what’s under the hood. Some day, your GUI might break and leave you at the ever-dreaded login prompt!
Speed is one important factor to consider when choosing between the command-line interface and a GUI. Keep in mind that if you’re a programmer who needs to compile programs (or a scientist who needs to run software that does heavy number crunching), the GUI slows down your system. Also, typically, you have to shut off the GUI when using Linux as a server, because all those pictures are mostly a waste of RAM and processing speed — after all, more often than not, a server just does its thing with no one sitting there watching over it.
Readability can also be a big issue when you’re choosing between the GUI and the command prompt. If you have a hard time reading text in those small command-prompt windows from within the GUI (Chapters 14 and 20 cover various ways to switch around), you can either make the windows and the font bigger, or work directly with the command prompt outside of the GUI. However, on a desktop that you want to use for word processing or editing images, you’ll want a point-and-click environment. (This setup is the type I focus on, but I clue you in to the command line anyway, just in case!) You also can choose from two major GUI versions: GNOME and KDE. Some people prefer one, and some the other; I’m not here to tell you which to use. If you stuck with the defaults for your distribution, then here’s what you’re using:
⻬Fedora:GNOME ⻬Knoppix:KDE ⻬Linspire:KDE ⻬Mandriva:KDE ⻬SuSE:GNOME ⻬Ubuntu:GNOME ⻬Xandros:KDE
Most distributions come with both KDE and GNOME, so most users simply choose their preferred desktop — Linspire, Knoppix, Ubuntu, and Xandros
only come with their default GUI. Both GNOME and KDE are excellent desk- tops with strong fan bases. It’s a personal preference, so I encourage you to install and experiment with both — and see which you like better. When you ask people why they chose one over another, often they really can’t give you much of a good answer aside from, “That’s what I’ve always used.” Keep this in mind when people try to convince you that one or the other is the best thing since sliced bread!
The cool thing is that you can run most KDE programs under GNOME and vice versa. This ability is vital when it comes to making it easier on develop- ers (and users) in the Linux community.
I cover how to switch between KDE and GNOME later in this chapter, in the section “Switching between GNOME and KDE.”
Making the Best of the Command Line
The Linux command-line interface provides a quick, efficient way of entering commands and executing actions. Even if you’re mostly a “GUI person,” after you get the hang of using the command line, you discover that it’s faster to perform some tasks at the command line than with a mouse in the GUI envi- ronment. However, if you prefer to use a GUI interface as your working envi- ronment, you can easily open a terminal window,which is a command-prompt window, to perform your command-driven tasks without having to com- pletely leave the point-and-click environment (see Chapter 14).
There are some interesting things that you might find useful to know about using the command-line interface. One difference between the Linux com- mand line and other interface command lines, such as the Windows MS-DOS prompt, Linux commands are case sensitive. Typing LSis completely differ- ent from typing ls, and, in fact, gives you an error because there is an ls
command but there is no LScommand. The Linux command line also has an
autocompletionfeature. If you know the first few characters of a command or filename, type part of it and press Tab to complete the rest automatically. For example, if you’re trying to use the lesscommand to view the contents of the file /home/bob/grocery_list, you can type less /home/bob/gro
and press Tab to try and complete the filename. However, if you also have the subdirectory (folder) /home/bob/group_projects, you hear a beep. You can press the Tab key again, like double-clicking a mouse, to see the output:
grocery_list group_projects
The cool thing here is that the command prompt beneath these items still has the text less groso you don’t have to retype it! You can then see that typing a cmakes it clear that you’re referring to groceryand not to group, so you just add a cto make less grocand press Tab again to finish the
autocompletion. This technique can save you a ton of typing, especially with really long filenames!
Most Linux distributions also keep a running historyof commands most recently used. To use this list, press the up-arrow key on your keyboard. This action pulls up the last command you typed. As you continue to press the up-arrow key, you step through the most recently entered commands from the most to least recent. If you accidentally pass what you’re looking for, use the down- arrow key to go back. When the command you want appears at the command prompt, press Enter to execute the command, or edit it and then press Enter. In Chapter 14, I cover the command-line environment in more detail.