written by: Tolga BALCI•edited by: Lamar Stonecypher•updated: 3/5/2010
It’s hard to disagree that Linux is stable and only messes up when it is configured or tweaked badly. Here we look at the best practices for what to do (and what not to do) with your distribution.
slide 1 of 13
Linux offers more stability than you could possibly want. However, there can be uses and abuses. We’ll look at some of them in more detail and will do our best to stay on the “proper use" side.
slide 2 of 13
Configuring Your Distribution
When installing your distribution, I suggest that you pay attention to the details, especially of partitioning and package selection. If you are familiar with partitioning, set a separate partition for the /home directory. This will allow you to remove your distro, install another distribution, and still have your user files untouched. You can partition your hard disk by following the wizard that is present in almost all modern distributions’ installation programs.
Regarding the package selection, I suggest you select your main packages at installation time. For example, if you want to install LaTeX and a graphical editor for it like Kile, select the packages during the installation. Otherwise, when you finish installation and want to begin using your system, you will have to add repositories, download the programs from the Internet with all dependencies, and perform other time consuming tasks. If you select them during the installation, you will only have to download and install some small updates, which is normal.
I also recommend that you update your system regularly. In almost all distributions, there is an update applet which informs the user as soon as updates are available. Install them when they become available and do not leave them for the future.
slide 3 of 13
This isa concept with which many Windows users are not familiar. A live distribution is a bootable CD/DVD which you pop in to your CD/DVD drive that writes its working files to system memory (RAM) and runs from there. A live distribution does not do any damage to your existing system, because whatever you do is written to RAM. This also means that whatever changes you’ve made are lost when you power off your computer. Live distributions are the ultimate tools for system recovery and, believe me, an important tool for almost all Windows system administrators, too. Recently some Linux distributions come as Live CDs with the option to install permanently to the hard disk. (Ubuntu and Linux Mint are examples). Some distributions have a separate Live CD/DVD which you download and use, such as openSuSE. The mother of all live distributions is Knoppix, and I definitely suggest you to keep one Knoppix copy nearby.
If you want to try out Linux, but you do not want to make any changes to your system, you can use live distributions to give Linux a test drive. Download and burn Knoppix to a CD/DVD and boot your computer and experience what a Linux desktop environment looks and feels like.
slide 4 of 13
We continue our article with resetting root password when you forget it. Then we continue with finding the drivers for our hardware and see the steps to identify and solve problems.
slide 5 of 13
Forgetting the Root Password
If you forgot the root user’s password, it is not the end of the world. There are two ways to reset your root password, and I will go with the easy one. First of all you need to reboot your computer. When you see a countdown timer, hit the key that is written on the screen - for example “Hit Esc to enter menu." After that type linux single and hit Enter. You will access the root prompt and you can set your new password by issuing the passwd command and change the password to your liking.
If this does not work, we have another trick. Issue the vi /etc/shadow command at the prompt. You will see the users and their passwords on the screen; however the passwords are hashed (meaning that what you see there is not the actual root password.) What we will do is to delete the root password. To move the cursor in the file, use h (left), j (down), k (up), l (right), x (delete), and wq! (write changes and quit). Find the line that looks something like this:
Navigate your cursor to the character after the first colon (:), which is 1 in our case. Hit x until you delete all the characters until the next colon, so it looks something like:
Type wq! and you will see a prompt that warns you that you are editing a read-only file. That is normal, so keep going. When you reach the command prompt again, type passwd to change the root password. Then issue the shutdown -r now command or hit Ctrl - Alt - Del to reboot your system. Done!
slide 6 of 13
slide 7 of 13
Finding and Installing Drivers
If you are buying a new computer, I strongly advise you to check the system’s Linux compatibility before you make the final purchasing decision. Of course there are so many options out there, but paying a visit to Google and searching for “linux hardware compatibility" (without the quotes) will give you a lot of results with many details.
If you have already made the purchase and have a device that is causing you problems, then, as always, you have to diagnose the problem first. For example you can have a look at the KDE Info Centerand see all the hardware recognized by your Linux system (or type hwinfo from the command line). Do not get confused about the KDE Info Center; it runs in Gnome as well as KDE. (You can install it with your package manager if it’s not already installed.) To start it in a Gnome environment, open a terminal and type in kinfocenter.
Find the device which is not working and again consult Google about the problem, such as “Creative x-fi no sound." It is highly probable that some other user has had the same problem and the solution, if any exists, is readily available. If not, search for your hardware with the keywords “linux drivers," such as “creative x-fi linux drivers." When you find the driver to download, the website will give you instructions about how to install it.
slide 8 of 13
slide 9 of 13
We continue our article with sound configuration, which is really easy with the Alsa Configurator wizard. We first see the sound systems in Linux and then configure our sound card. Finally we have our recommendations about choosing hardware and seeking help.
slide 10 of 13
Soundcards work nicely under Linux. There are many sound systems present in Linux for managing the sound cards, such as ALSA (Advanced Linux Sound Architecture), OSS (Open Source Sound System) and Phonon (aRTS, Analogue Real Time Synthesizer before KDE 4.x series). Normally, during the installation the installer chooses the default sound system and sets the sound card for immediate use. If this is not the case, go to your hardware configuration program (YaST in openSuSE, Sound under Gnome Menu) and make the necessary changes.
I’d like to make a distinction between KDE and Gnome because KDE uses the aRTS sound system and if you will commit to making changes as I suggest, you’ll need to switch it to ALSA. Make sure that alsa-base, alsa-tools, alsa-source, alsa-utils and alsa-tools-gui are all installed on your system, which you can do from the hardware configuration utility previously mentioned.
When you are ready to proceed, start by issuing alsaconf from the terminal as root (or sudo alsaconf).You will begreeted with a wizard called the Alsa Configurator. The wizard will close the volume control, and when you are prompted by the desktop manager if you want it to start next time when the computer starts, say yes. When you are finished with the wizard, type alsactl store to save the configuration and then speaker-test to test the speakers. Then start the volume control from the menu (gnome-volume-control or KMix.) If you cannot hear anything, reboot your computer and try playing some sound files. If you still do not hear anything, then go to your hardware configuration utility and recheck if everything is set as above.
slide 11 of 13
slide 12 of 13
Other Hardware Problems
In most of the cases, hardware is properly recognized by the Linux system and you should not have problems. If not, there is a strong possibility that your hardware uses a generic driver; for example my Logitech Quick Cam Express uses the gscpa driver, which is also the driver for Creative Live Cam Notebook Pro.
The worst case scenario is when everything comes to a halt, which means that you do not have anything available at hand, which happened to me with my Acer Travelmate 5570Z notebook that arrived with an Atheros wireless card unsupported by Linux. I asked the vendor for a replacement, which Acer Turkey did happily. If that is the case, you will have to change your hardware with an equivalent that works under Linux.
slide 13 of 13
Many of the problems about Linux arise from hardware. I always advise the fellow penguins to go to the Internet and search for their hardware before purchasing it, and then to have a look at the forums to see if people are happy with the device and using it as they wanted to.
If you run into any problems after purchasing, then Google will be your best friend. First do a search and work through the results to see if those solve the problems. If not, go to a forum of your choice and post exactly what is the problem with the exact hardware specifications and the steps you have taken to solve the problem. Be sure that you will receive a reply or guidance if not the full solution.
In this series we target all the Linux users by touching the points that make our Linux experience enjoyable in the long-term. We look at the best practices for using applications, tips for analyzing log files, distribution troubleshooting and many others.