• No se han encontrado resultados

Capítulo 2. Estudio de las tecnologías relacionadas

2.5. Android y los dispositivos móviles

Once 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 is indicated by the

[FAILED]status shown during the boot process. Many of these services don’t keep you from logging in and using your system. Services usually fail because of misconfigurations or unsupported hardware drivers. Sometimes a problem service takes a long time to start up, so you may need some patience while you wait it out. Once the machine boots up, you can use the techniques described in Chapter 12 to shut off the problem 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. Rescue mode is covered in the next sec- tion. Entering Rescue ModeHeavy-duty system repair tends to happen in rescue mode, which is a special boot selection that simulates your hard disk in what is called a RAM disk,holding the files entirely in memory. The benefit of this disk is that you can perform necessary system surgery without requiring util- ities that are part of the installed system; everything you need is part of the rescue disk. The drawback is that this is a purely command-line interface, and you really have to know your stuff to find your way around.

Appendix A contains a list of Linux commands, roadmap 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 messages your kernel might have left behind. You may also be able to find helpful tips by reviewing your distribution’s documentation and help forums.

Knoppix is quite popular to use for system rescues because it’s a whole dis- tribution on a CD. (For more on Knoppix and live CDs, see Chapter 2.) See Chapter 20 for more on using Knoppix for things like rescuing broken Linux (and even Windows) systems.

Just about every Linux distribution includes a rescue mode. Due to space restrictions, I have room to cover entering only Fedora’s rescue mode in step- by-step detail, but at the very least, here’s a quick reference to how to find the rescue mode in the distributions covered in this book:

Linspire:The CD contains a rescue mode. When the installer starts, use your arrow keys to select Diagnostics and then press Enter.

Fedora:The DVD, or the first installation CD, contains a rescue mode that you can enter by typing linux rescueat the installer’s boot prompt.

Mandrake:The first CD contains a rescue mode. When the installer starts, press F1 to access the command prompt, type rescue, and press Enter.

menu option. Use your arrow keys to highlight this option and 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 press Enter.

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 bootprompt.

This action begins booting the system into maintenance mode.

2. Select your language and press Enter. 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 aren’t able to make any

changes to your hard drive installation.

• Skip: 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/sysimageto be able to use your system without having to type /mnt/sysimagein front of everything.

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 and 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 remembering 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 from just shutting 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 that no one can mess with their stuff and shut off the moni- tor 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 using the main menu’s Log Out option and then click the display manager option that says, strangely enough, Shut Down.

If you have a command prompt open, enter the haltcommand at the shell prompt (#) followed by the root password, and Linux shuts itself down and tells you when it’s all right to turn off the machine.

If you have a command prompt open, enter the rebootcommand, and Linux goes through the motions of shutting itself down and then immedi- ately reboots the machine.

If you have a command prompt open, entering shutdown -f nowis 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 the poweroff com- mand, 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 file system check while the machine makes sure that nothing was dam- aged. This process is similar to the one in Windows, where, if you power off incorrectly, the operating system may need to scan its hard drives to make sure that everything is okay.

puter to reboot, look into getting a UPS (Uninterruptable Power Supply) for your computer. These heavy recharging batteries can not only protect your computer from damage — read the box to see what features a particular UPS offers — but can also provide an extra five minutes or more of power to give you a chance to properly close your files and shut down a machine when the power goes out. Better yet, for those really brief spikes, the only inconven- ience you’ll have to deal with if you have a UPS in place is listening to it com- plain with beeps. Your computer won’t be affected by the spike at all!

Removing Linux from Your System

Although I’d hate to see you go, 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 your Windows option, 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 using your XP CD-ROM into the Recovery Console. Change to the Windows directory and then type fixmbr.

Chapter 6

Checking Out Those Desktops

In This Chapter

Finding your way around Fedora

Kicking around Knoppix

Looking around Linspire

Messing around with Mandrake

Seeing what’s what with SuSE

Xightseeing around Xandros

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 and can’t see 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.

Introducing the Interfaces

Linux has two interface types: the command-line interfaceand the graphical user interface(GUI). If you use other computer systems, such as Windows or the Macintosh, you’re already familiar with a GUI. Most Linux distributions include different versions of the GUI (which takes up the majority of this chapter), which you can heavily customize.

If you’ve been using computers for many years, you may also be familiar with the command-line interface, which usually consists of a black screen with white text. The initial release and early development 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!

Deciding Which Interface to Use

One important factor when choosing between the command-line interface and a GUI is speed. 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. You also need to typi- cally shut off the GUI when using Linux as a server, because it’s mostly a waste of RAM and processing speed — 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 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 don’t leave you without any clue about the command-line, just in case!

You also can choose from two major GUI versions: GNOME and KDE. Some people prefer one, and some the other, and I’m not here to tell you which to use. If you stuck with the defaults for your distribution, then you’re using

Fedora:GNOME Knoppix:KDE Linspire:KDE Mandrake:KDE SuSE:KDE Xandros:KDE

choose their preferred desktop. While it may look from here as though KDE is particularly popular compared to GNOME, this isn’t necessarily the case. Both are excellent desktops with strong fan bases. It’s a pretty personal pref- erence, so I encourage you to install and experiment with both and to see which you like better. 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 developers (and users) in the Linux community. 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!

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 and easy 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 environment, you can easily open a terminal window,which is a command- prompt window, to perform your command-driven tasks without having to completely 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, is that Linux commands are case sensitive. Typing LSis completely different from typing ls, and, in fact, gives you an error because there is an

lscommand 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 that you don’t have to retype it! You can then see that typing a cmakes it clear that you’re referring to groceryand not 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 the most recently used commands. 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.

When you installed Linux, you added a graphical login by default. (This addi- tion is true for all the versions discussed in this book.) Some versions of Linux give you the option of choosing a graphical or command-line login, which can cause a lot of confusion for folks who accidentally choose the command-line option. If you did so (or think you did) and find yourself lost after the machine boots up, see Chapter 19.

GNOME Basics

GNOME stands for the GNU Network Object Model Environment — not that this expansion tells you much! Suffice it to say that GNOME is a full graphical environment. I focus here on Fedora since it is the only distribution I’m cov- ering that uses GNOME by default. Figure 6-1 shows you what you see once you log into the system and the GUI finishes launching.

To find out more about GNOME, visit the main GNOME site, at www.gnome.org. Keep in mind that the programs you have depend on the type of installation you chose and what customizations you made; if what you have is different from what you see in descriptions or the figures, don’t panic!

The GNOME desktop environment is essentially broken into four separate parts:

The menus

The menu and icon panel at the top of the screen