Today we are going to talk about what do you do when you are trying to make something work in Linux and it does not work as you expected. Yes, it does happen that the install or configuration does not work as expected. Some people just get frustrated and want to throw in the towel. But there are strategies for how to deal with this type of frustrating problem. We will discuss first how to go about finding help and then explore a problem and how it was solved using these methods.
We should probably start by discussing different types of help. One thing we have maintained all along is that Linux invites you to explore and try things. This means that you could be looking for answers on many different subjects. Here are some of the subjects which come to my mind:
Installation issues for your distribution
What hardware works on Linux or how to configure some piece of hardware to work.
Configuration issues with a specific application.
When you start a new Linux installation you need to start by creating a plan. A plan in this context is just a collection of information about how we want to configure the system. What drive are we using? How many partitions should we use? How big should the partitions be? etc.
The place to start with these type of questions is the documentation which comes with you distribution. Most installations come on CDs which contain a Doc directory or an installation document on their web site. These CDs are readable under both Windows and Linux so it is easy to stick the CD in a drive and start reading. It is almost impossible to install a new Operating System on a computer without having another computer available to read documents on or search the Web. Now don’t get me wrong, if the computer is known to work with you distribution of Linux, you can most likely do the install on that box without having another computer at hand. Myself, I always make sure I have another computer near by so I can look things up during the install. Remember you are breaking down your only access to the on-line documentation and the Internet during an install. IF something goes wrong how can you get help?
So what help is available for a new Linux Distribution installation? Well most installations come with a basic setup guide, if not no one would be able to get it running in the first place. Next you should check out the support information at the distributions web site. It is here that you an often find FAQ questions and answers. Next look at a mailing list for the distribution. These lists cover the back and fourth help common for distributions. Lastly I would try going to the Google Groups section. This is a search engine for the mail lists.
OK you have your Linux system working and you want to add a Wireless card to it. Can you just go to the local computer store and buy what ever catches your eye? Well you can, but you will be sorry. The fact of the matter is that most hardware manufactures either don’t support Linux or don’t release the specs so someone else can support their hardware. They build and distribute windows drivers only. Even if someone is willing to write a driver for their hardware, they will claim that the details of the hardware are proprietary so you may not use them. Some will even go to the trouble of suing anyone who tries to build a driver for their hardware under the DMCA.
So this means that it is up to you to find which hardware is supported under Linux or even better which is supported by your distribution. Many of the major Linux distributions maintain lists of hardware which is either supported or known to work on their distribution. So start by going to the home page of the distribution and check for Supported Hardware.
So what do you do if the hardware is not listed as supported or the distribution does not have a supported hardware list? The best answer now is to do a search on the Internet. I tend to use is Google Search for Linux. This leads to a search engine which has already filtered out the non Linux web pages. On this page you will need to be as specific as is possible. For example to find supported wireless pcmcia cards for Fedora Linux I might enter the string wireless pcmcia card Fedora driver. You will notice that each word helps refine the search parameters. I am searching for the driver to be sure it has one available. I can go back later and find where to purchase the card once I know it will work with my system.
OK this sounds fine but for one small problem. The stores usually sell the newest wireless cards, while the supported drivers are often for the older cards. This is a problem since the manufactures often like to change things between their older hardware and their newer hardware. So your best bet is to open another browser window and call up a computer store like: CDW and search on their site for the exact manufacturer and model of card. If you find a match between a supported driver and the hardware, do your self a favor. Order the card on the spot and download the driver and instructions. This will make sure you get the right combination. I use CDW because if I get the hardware and can not get it to work in the first few days, I can return it for a refund. I consider that a plus since sometimes even with the best information something will not work as expected. Now don’t let me scare you off buying hardware, it can allow your computer to grow with your needs and wants, while still maintaining your existing investment. To be honest, I would love to know about a fairly complete computer store on the Internet which sold hardware known to work with Linux. Any suggestions from this group would be appreciated, and I will post the results.
OK, you have your driver, you have your card, what could go wrong now? More than you think. As an example, I wanted better support for Graphics on my server, so I researched the ATI graphics cards and ended up purchasing a Radeon 9000 card. ATI supplies drivers for the card itself, so I figured it was a no brainer. WELL it did not go as expected. I could not get the driver to install correctly. I then found out that the MESA driver was not compatible with that card. It seems that the support was not as complete as I thought. Now to be fair, this laptop has a ATI Rage128 card in it and it is supported fine. The real kicker to me was when I thought, OK, I will just recompile the kernel modules and include the source for the Radeon 9000 in the build. That way all the flags and link options will match and it should work OK. Guess what, the compile of the Kernel modules crashed for Fedora 2.4.2188 source code. I was mad. One of the strengths of Linux is the ability to rebuild the system. If you can recompile the kernel, you are in trouble.
As an aside, in the past it was considered part of every install to recompile the kernel. In the past we did not have loadable modules for the kernel. Since the kernel shipped with the installations included drivers for hundreds of devices you did not own, it was normal to recompile the kernel and remove all the devices which were not on your system. This was not too difficult as long as you knew what hardware was in your computer, and often created a kernel at least 1/3 smaller. A smaller kernel uses less resources so you have more room for your other applications. Besides the ability to recompile programs has always been one of the strengths of Linux. I have not yet selected a replacement OS for my server. But I will assure you what ever replaces it MUST be able to compile it’s own kernel.
So if the driver you down loaded does not work as expected, what then? You could return to Google Linux Search, to see if anyone has another method of getting the driver to work. You might even try searching in Google Groups for email posts concerning your situation. If you do not already know, the groups section is created by archiving and indexing the old Network news. Some people even use Google Groups to read and write network news. Not my method, but then I tend to be somewhat old fashioned anyway. Hey I might seem set in my ways, but I believe in: “If it ain’t broke, don’t fix it.”. News groups are a very useful source of information since they allow you to ask questions, and get answers from other idiots like me. I still read quite a lot of computer news, I just don’t get to help as much as I used to. I am not on the cutting edge as much as I was when I had more time.
Linux contains many applications which need to be configured for your use. A few that come to mind are Apache, a web server, MySQL, a local database, Cups, a print driver, Network settings, Emacs, an editor, KDE or Gnome or what ever Windows system you use, and many more. Some of these applications have tools to assist you in configuring them, some you configure during the installation, some will be configured later, and sometimes you need to change the configuration after it has been installed. But when ever you need to configure an application, it might not work the way you expect. So were to go for help?
The first place to start with most applications is to check the local help. As we discussed in the spring of 2004, help is available as man pages, info pages, documentation shipped with the application, as well as the HOWTOs. Here is a list of the help for Apache I found on this computer. The daemon for Apache is named httpd.
% man httpd
Found a Man page discussing httpd is the Apache HyperText Transfer Protocol (HTTP) server program. It is designed to be run as a standalone daemon process. When used like this it will create a pool of child processes or threads to handle requests.
% info httpd
Found an Info Page. It is the same as the man page.
Found a Readme file and other information. The Apache HTTP Server is a powerful and flexible HTTP/1.1 compliant web server. Originally designed as a replacement for the NCSA HTTP Server, it has grown to be the most popular web server on the Internet. As a project of the Apache Software Foundation, the developers aim to collaboratively develop and maintain a robust, commercial-grade, standards-based server with freely available source code.
HowTo’s related to Apache on my computer they are in
When I checked the list of HOWTOs available for apache I found:
Apache-Overview-HOWTO: Apache Overview HOWTO
Apache-Compile-HOWTO: Apache Compile HOWTO (Linux edition)
Apache-mods: Apache+DSO+mod_ssl+mod_perl+php+mod_auth_nds+mod_auth_mysql+mod_fastcgi mini-HOWTO
Apache+SSL+PHP+fp: Linux Apache SSL PHP/FI frontpage mini-HOWTO
Apache-WebDAV-LDAP-HOWTO, Apache based WebDAV Server with LDAP and SSL HOWTO
Once you have exhausted the help available on your local computer, it is time to have a look on the Internet. The Internet is a great place to find information because most Linux programs have web sites dedicated to them. In our case the logical site would be Apache Http Server Project. This is where you can find the most current version of the documentation. In addition to the documentation you can find the local FAQ for the application.
The FAQ is extremely valuable because often the common questions from users already have answers. Being able to find an answer in short order is a big plus when you are stuck with a problem.
Finally if these sources of answers are not good enough, we can turn to our old friends Google Search for Linux or even go on to Google Groups. The power of a search engine is hard to over value. Now, just because I tend to use Google, doesn’t mean there are not other search engines that might do the job as well or better. I will admit that there is a certain prejudice on my part because Google is a major user of Linux. And currently Google is the engine to beat today.
You might have noticed that I often use the search engine Google. I find that Google provides a good index to the Internet. But one of the things I realized was that telling people to use a search engine, and having them use it effectively are not the same. So in an attempt to enlighten you about some of the tricks I have learned I thought I would discuss searching with Google. Again, I am not opposed to other search engines, I just find that between Netscape and Google I much prefer Google. There are other engines which can do a good job, so I encourage you to explore other search engines.
I went to both of the links above and entered what I would assume are similar searches. In Google for Linux I entered wireless pcmcia and in Google I entered linux wireless pcmcia. In the Linux section search it returned 56,100 hits, in the regular search location it returned 326,000 hits.
So I thought I would refine the search some. This time I entered wireless wifi pcmcia for the Linux search, and linux wireless wifi pcmcia for the regular search. The results, the Linux search returned 2,970 hits, while the regular search returned 54,200 hits. Now one interesting observation, is that in the regular search it shows you which terms were used in the search. It ignored the term wifi in the regular search, which I find interesting. Lets see if we can force it to use all four words.
I tried changing the terms in the regular search to +linux +wireless +wifi +pcmcia. This option says the search must include all the terms. The results were 43,800 hits, but it still ignored +wifi.
To learn more about the special characters for a search and how they affect the results, have a look at Advanced Search Tips on Google. This points out some interesting features that will help refine your searches.
For now lets see how well we can proceed by simply adding terms to the search strings. I tried the search again, but added the term driver to the end. This time the results were Linux search, 1,550 hits, regular search, 11,900 hits. Next refinement was to add the term 802.11b to the end of each search string. This brings us to 757 hits and 4,940 hits. One interesting fact is that at this point the web page Linux & Wireless LANs is at the top of both lists. I would say that the lists are starting to converge.
One more refinement, lets add “supported cards” to the end of the string. Notice that I used quotes in the phrase to indicate that the two words are to be treated as one word. The results were now, 23 hits and 138 hits respectively. Again, of interest is that the general search said that it ignored the terms wifi and 802.11b, but the linux search did not ignore them. When you look at the top most entry in both searches you will find all the terms represented.
So what have we accomplished? We have reduced the number of web sites down to a number where we can look at a number of them to get our final answer. It is interesting to note that in the Linux search, the web page Linux-Wireless.com is the 6th site returned, while in the regular search it is the 20th link. I mention this difference because this is a valuable site with links to much wireless information for Linux.
Lets try rearranging the terms to see how that affects the search. I tried the string linux “supported cards” wifi pcmcia 802.11b wireless driver in both search engines. The result were 23 hits and 138 hits respectively. So you notice it did not change with the reorganization which is useful to know.
The result is that by adding more terms you can often get better results from your searches. This is useful especially if you do a lot of searching, or are having trouble finding a sites specific to your needs.
I was talking to Joe the other day and he mentioned that he had some questions from some members. I thought I would add some of them to this weeks talk.
The first group of questions concerned Linux and Backups. Here are the questions as presented to me.
How to back up a single partition Hard Drive with Linux
How to back up a multiple partition Hard Drive with Linux
How to back up to a USB drive using Linux
How to back up to a CDRW/DVD using Linux
Before we start discussing how to backup these devices, we should take a couple minutes to talk about how Linux relates devices to the directory tree. In Linux you do not have drive letters as you do in Windows. Instead the system has a single directory tree starting from the root “/”.
So lets make the assumption that you decided to separate the system across 7 partitions on the first hard disk. Lets assume that these are named Partition 1-7. And we will assume that partition 4 is an extended partition. If you are unsure of what partitions are have a look at
man fdisk Now lets assume that the Partition 2 is Window 2000, and Partition 3 is another dos partition.
When you start up windows you will see a C: drive and a D: drive. If you looked at them using fdisk, you would see them as the second and third partition. So under windows it assigns a drive letter to each partition that it sees.
Now lets assume that you configured partition 7 as the Linux swap partition, partition 1 as the boot partition, partition 5 as the root partition, and partition 6 as usr.
Lets assume you booted into Linux now and executed the command
mount. You would probably see something like.
/dev/hda5 on / type ext3 (rw) /dev/hda1 on /boot type ext3 (rw) /dev/hda6 on /usr type ext3 (rw) /dev/hda2 on /win98 type vfat (rw) /dev/hda3 on /dosd type vfat (rw)
What this is showing is that the directory tree you see as a single entity really consists of many different disk partitions. Now in this example I have used only a single drive with multiple partitions. But I could have used multiple disk drives as well. The drives do not need to be the same either. I can just as easily mount a floppy on the tree as a DVD disk. The Kernel itself knows ow to talk to the different disk drives. The user is free to treat the drives all alike.
In fact it is not even necessary to mount a drive to work with it. For example to create an ISO image from a CD you do not mount the CD, you just place it in the CD drive and use the command
dd if=/dev/cdrom of=mydisk.iso. In this command the dd program is reading the cdrom byte for byte with no regard to it’s contents. It can just as easily copy a music CD as a program CD.
Now lets suppose you want to back up a partition to a tape drive. We will assume the tape drive is connected to
/dev/st0. If we wanted to use the tar command, and the partition we are going to backup was /dev/hda3 above. We could use the following commands.
% cd /dosd % tar czvf /dev/st0 . # There is a period after the tape drive.
What this command does is take the contents of the directory /dosd, which happens to be the partition /dev/hda3, and creates a compressed archive file on the tape drive.
For those of you who don’t know what an archive is, it is basically a byte for byte copy of all the file strung together in a single bit stream. The archive contains information about the location and name of the original file. So think of taking all the bytes of data from every file in a directory tree and stringing them together head to tail. That is basically what an archive is.
There are other archive programs in Linux. Here are a few others with an equivalent command to mimic the tar command above.
% find . -print | cpio -ov >/dev/st0
This archive tool works well, but does not have compression
% zip -r /dev/st0 .
This archive tool archives and compresses. Additionally it checks a CRC to each file as it is stored to catch recovery errors.
% lha -avo7 /dev/st0 .
This archive tool is a bit old and not used that much anymore.
OK we have seen how to backup a single partition. How do you think you would backup multiple partitions? Using tar you just list multiple sources and it will do the rest. If we wanted to do the entire Linux system we could just do:
% cd / % tar czvf /dev/st0 . # There is a period after the tape drive.
If you only wanted to do the Windows and the dos partitions listed above, /dev/hda2 and /dev/hda3, from inside Linux you could do.
% cd / % tar czvf /dev/st0 /win98 /dosd
So what do you think we backup to a USB drive? Simple just substitute the name of the USB device for the tape device above.
The only problem with backup to a CDRW is the size restriction of the device. But lets suppose you have a home directory which is less than 700 Meg. You could then use this command to back it up.
% mkisofs -J -R /home | cdrecord -v -D 0,4,0 -speed 6 -
Source of above script: re: suggestion for backup - CD-RW. Two entries to pay attention to is the -d option to cdrecord needs to point to your CDR drive. Additionally the option -speed should reflect the writing speed of your CDs. The biggest problem with backup to CDRWs is the size restriction on the target medium. I have not used the script above to backup to a CDRW, so you are on your own.
On a final note on backups, I found this site to have a lot of good information: Backup HowTo.
The question was asked “How to scan for viruses on a Windows marching using a Linux CD like Knoppix”. Well you are in luck, I happen to have come across a cd named: LinuxDefender Live! CD.
This is a combination of the Knoppix Live CD and a Virus scanner software from a company known as Bit Defender. Since it is Knoppix live CD you can boot it on any system which allows booting from the CD. Since this is a CD based Linux system it will allow access to both window and dos file systems.
Lets assume we want to scan the partitions /dev/hda2 and /dev/hda3 listed above. Here are the steps I would use.
Boot from the CD Linux Defender Live.
Click on the icon labeled “Hard Disk Partition (hda2).
By clicking on this icon you mount the partition in the directory /mnt/hda2.
Click on the Icon BitDefender Scanner.
This starts up the Virus scanner. You need to click on the Scan tab, and enter the Address /mnt/hda2. Next click the Scan button and wait for it to finish.
This is a good way to try to catch a virus which has invaded a Windows box since you are not depending on a compromised system to fix itself.
This is also a good tool to recover files from a system. Once you have Knoppix up, you can connect to the local network. Now you can use ftp to copy files from the broken machine to another machine over the network. This would allow you to save files which are on the broken machine to another computer.
Written by John F. Moore
Last Revised: Wed Nov 2 14:48:44 EDT 2016