Linux Newbie FAQ

IMPORTANT NOTE:
This FAQ is completely out of date, most of it probably not updated since the early 2000's. For example, it refers to moving ext2 to ext3, Redhat 6 or so (not RHEL--Redhat, before it divided into RHEL and Fedora), etc.

It was originally written for some Yahoo groups, back when these groups were far more active than they are now. I leave it up primarily for the netiquette section, most of which is still relevant.

So, be very careful if using any technical information from this FAQ, most of it is probably over 10 years old.

The rest of this is the FAQ--again, keep in mind that it's ancient.

These are the questions that I found myself answering most often. However, remember that as someone once wrote, there is always more than one way to do things in Unix and someone will think that your way is wrong. :) If you think there are any significant lapses, please feel free to drop me a line at scottro11[at]gmail.com. However this faq is almost unmaintained these days, especially as lately, especially on the yahoo lists, it seems to be almost unread by new members, despite being mentioned in the welcome message.

However, if you are new to those lists, please do take the time to read the netiquette section and the articles that it references. You will save yourself a lot of aggravation, and greatly increase the chances of your query getting answered by someone with more knowledge. If you choose to ignore it, that's up to you, but the various lapses in netiquette that are almost the norm on some of these yahoo lists these days, will probably result in the people most likely to be able to help you completely ignoring you. If you take my advice and read some of the articles to which it links, you'll see why.

In many cases, these were problems that I ran into myself when I first began, and, often, as much to remind myself as to help anyone else, I would put up a page. Therefore, in many cases, I'll send you to these pages for reference. Other questions that I'm ignoring are those where I simply don't know the answer.

The faq is somewhat loosely organized--it begins with issues of netiquette and more or less progresses through pre-installation questions, post-installation questions and more advanced questions. It has sometimes been suggested that I organize it still further, for example with a more proper table of contents, which each question grouped within a section. My stock answer is that when two weeks pass without someone either posting a question covered in the faq or violating one of the netiquette rules mentioned, such as cross posting or top posting, I'll do so. It's a fairly safe bet that I'll never have to, which is a good thing, since the real reason I don't is sheer laziness. I have made a few broad topics, but the majority is just lumped together under Post-Installation

In many cases, it refers to RH 7, which is of course, completely obsolete. Yet the answers to many questions remain the same.

My friend Godwin Stewart has made his own FAQ for Windows users, which, although there is a bit of overlap with this FAQ, is aimed more towards the person using Windows who is thinking of taking the plunge into Linux. It is a worthwhile read, and can be found here.

Another friend, Tom Newsom has a page that although Slackware oriented has a whole slew of one line answers to many of the questions covered in this faq. Tom's page can be found here.

Anyway, without further ado...

Changelog

Netiquette and mailing list issues

(A quick note on this--Godwin Stewart has written a good beginners guide on netiquette, which can be found here.

Q: I have a gmail account. Why am I not seeing my posts to the list?

Q: Why aren't my posts getting to the list?

Q: What is cross-posting and why is it bad?

Q:What's wrong with posting in HTML? Or, I didn't realize I was posting in HTML, how do I turn it off?

Q: Any other netiquette rules that I should know?

Q:Nobody is answering my questions. What's wrong with this list?

Q: What sort of information should I give when posting a question?

Q: I was told to RTFM. What does that mean?

Q:I joined one of these lists and mentioned my web page, which is all about Linux (or FreeBSD or something related) yet people are saying I'm spamming. Why?

Pre-Installation Questions

Q: This will be my first time installing Linux. What distribution should I use?

Q: I want to keep Windows and only have one computer. How do I do this?

Q: How do I dual-boot with an MS operating system?

Q: I just downloaded an ISO and burned it to a CD. However, the CD won't boot, what's wrong?

Post-Installation Questions

Q: I just installed Linux. I had Windows installed, but now, when I start the computer, I don't see the option to start Windows. Is my Windows installation gone?

Q: I just did something (installed Windows, edited Grub or Lilo, etc) and now I can't boot into my Linux partition. Is there a way to fix it without reinstalling?

Q: I read the previous question. Now how do I reinstall Grub or Lilo?

Q: I've forgotten my root password. Is there a way to get it back, or boot into the system?

Q: Why should I avoid logging as root? Or, I can't login as root when I connect remotely.

Q: How do I set or change the hostname of my machine?

Q: You often say, "At a commmand prompt" or "type the command". How do I get to this command prompt?

Q: What's the best book for learning about Linux?

Q: I use AOL. Will I be able to use it with Linux?

Q:I just recompiled my kernel, and now, when I type shutdown -h now, it doesn't power off the machine. How do I fix this?

Q:Since I upgraded to the 2.6 kernel, my mouse doesn't work properly with my KVM switch.

Q: I have Gnome as my default desktop, but now I want to use KDE. Or, I like Gnome but my girlfriend wants to use KDE. How do I switch it?

Q:My Linux boots up in text mode and I want to change it to graphic mode. (Or vice versa). How do I do this?

Q:How I do switch between X and console mode?

Q: Is there any way to view more than one window at a time in console mode?

Q: I just installed RedHat or Fedora and I can't telnet to the machine. Or, I can't use Apache, or Samba, or SSH, FTP, etc

Q: I try to mount my cdrom in RH 7.x and get a message that /dev/cdrom is not a valid block device. (Or something similar) How do I fix it?

Q: How do you burn CD's in Linux?

Q: I'm trying to edit my inetd.conf file in RedHat 7.x and can't find it. Where is it?

Q: I was told to look at the man pages--however, I'm finding them difficult to understand.

Q: What about firewalls for Linux?

Q: I would like to set up Pine (or Mutt) as my email client, but can't figure out how to configure it.

Q: I downloaded a program with an .rpm (or tar.gz, .tgz, tar.bz2, tbz or tar.Z). How do I install it.

Q: I just installed a program. How do I start it?

Q: How do I access my Windows drive from Linux?

Q: Is NTFS supported by default in RedHat 7.3?

Q: How do I find out what version of the kernel is running on my machine?

Q: How do I recompile a kernel?

Q: I can't get Samba working properly. How do I fix it?

Q: I try to do a shutdown (or add user or similar root only command) and get "command not found" What's going on here?

Q: RedHat recommends updating to iptables. However, when I type iptables, I get an error message saying that I might have to upgrade the kernel. What is going on here?

Q: What's the best emailer for Linux?

Q: My modem works in Windows, but not in Linux. How do I fix this?

Q: How do I get the scroll wheel of my mouse working in Linux?

Q: I installed RedHat 7.2 and upgraded to the ext3 filesystem. Then, when I went to recompile my kernel, I ran into problems as there's no option for ext3 in the filesystems section? What do I do? (This question may be removed soon since as of November 9, 2001, the testing 2.4.15-pre2 has experimental ext3 support. Kernel 2.4.16, the current stable release as of December 1st, 2001 has it)

Q: How do I compile a C (or C++) program and run it? Or, I just compiled a C program but each one that I make shows up as "a.out"

Q: My Network isn't working, how do I fix it?

Q: How do I set (or check) my IP address?

I have a gmail account. Why am I not seeing my posts to the list?

A: According to gmail, it's a feature. According to almost everyone else, it's a complete pain in the neck. To, as they put it, "avoid clutter in your inbox" posts that you make to a mailing list will not appear in your inbox. If someone responds to the post, you will see that, but you won't see your original posts. There have been, judging from some googling, many requests for them to change this, but so far, they have not done so. It is the reason I don't use my gmail account for any mailing lists, because I consider it a bug, not a feature. Interestingly enough, some yahoogroups members do get their posts in their inbox. It seems that yahoo adds so much junk to an email that gmail doesn't realize it's what you sent. This seems to vary between lists and individuals.
(back to top)

Why aren't my posts getting to the list?

The RedHat list is moderated. Unfortunately, the list was almost ruined by people who refuse to follow simple netiquette. Don't top post. Don't cross post. Trim your messages.
Do a minimal amount of research before posting. Don't use texting, it isn't a language. We realize that many people don't have English as their first language. However, there is no excuse for laziness. U for you, plz for please, ne1 for anyone--these aren't English mistakes, they're sheer laziness.
For awhile the moderators gave up on this due to the sheer volume of people that ignored it. This is no longer the case. If you don't follow these very basic rules of netiquette, your post will not be approved.
Refer to Godwin's guide. There are always exceptions (not for texting, but for top posting and failure to trim) and the aim isn't to keep people from posting. It is simply an effort to make the list worthwhile. (back to top)

What is cross-posting and why is it bad?

A: Cross-posting is where you make the identical post to several lists. It's very common for beginners to post the same question to, for example, the Linux, Linux_Newbies and Redhat yahoogroups mailing lists.
Aside from the minor annoyance of seeing the same message more than once, and the waste of bandwidth, it is also a time waster for those most able to help. Say a Linux guru belongs to all three of those lists, plus another developer's list, etc--he may be getting over 100 emails a day. Therefore, he might only glance through the subject lines to see if there's a question he is able to answer. He then goes to the next list, same thing--looks at the subject lines--opens up another email, only to find that it's the same question he answered on another list. If he's having an irritating day, he might simply decide to stop answering questions entirely.
Additionally, although more and more people are getting broadband Internet connections, many are still on dial-up. We in the US, even those on dial-up connections, usually pay a flat rate, regardless of how many hours we're on the Internet--however, in other countries, they pay per minute rates, both for their phone and Internet access. In some circumstances, for example, a production environment emergency (or having messed up a child's computer) cross-posting is probably acceptable. However, show consideration for those most likely to be able to answer your question and do something such as CROSS-POSTED to linux, redhat, Linux_Newbies in the subject line. (It's been suggested that adding CROSS-POSTED to the subject line and then putting the different lists in the first line of the message might be better--the reader can decide for themself. The main point is to let people know that it's been cross-posted and to where it's been cross-posted.
To sum up--the considerate reason to not cross post is that it aggravates others and can cost them money as they download your message on several lists. The selfish reason to not cross post is that you might alienate the very people who are most able to help you.
(back to top)

Q:What's wrong with posting in HTML? Or, I didn't realize I was posting in HTML, how do I turn it off?

A: There are several reasons to not use HTML. Firstly, HTML can carry viruses and worms. The kak worm that was so widespread for awhile never would have gotten off the ground if people didn't use HTML.
It's also inconsiderate to people who use text based mail readers, such as mutt or pine. Have you ever tried wading through all those HTML tags to get the gist of a message in a text based mail reader? (Actually, newer versions of both can handle HTML fairly well but it's still a pain.)
It also wastes a lot of bandwidth. An HTML message that might be 90k in text will be as much as 300k in HTML. Not everyone has high speed connections and in many places people still pay for each minute they're connected--so you're costing them money, not to mention the extra unnecesary load on the server.
Somtimes, people don't realize that they are posting in HTML (which is the default in many email clients, choosing cosmetics over security and efficiency)
In Outlook Express go to tools/options/send. You'll see that there's a box saying HTML. Uncheck it and check plain text. Also, uncheck the box that says reply to messages in the format that they were sent.
In Outlook it's in Tools/Options/Mail Format. There's a dropdown textbox that says HTML. Click the little arrow and you'll have the option to select plain text. I haven't found a way to fix the default, however, of replying to messages in the format that they were sent.
In Netscape, the last time I looked, (I haven't used it for awhile--in Linux I use Konqueror as web browser and Sylpheed as my email client) it's under Edit/Preferences/Mail & Newsgroups/Formatting. Move the little dot in front of use HTML editor to Use Plain Text Editor.
In Eudora it's under Tools/Options/Styled Text. There's an option to send plain text only.
Sometimes, one does all this and it still comes across as HTML. This is usually due to default settings on a Microsoft Exchange Server. If you can, talk to your Network Administrator--or, if you're the Network Admin, then change it. :)

There's an excellent article about why one should NOT use HTML which can be found here.

Q: Any other netiquette rules I should know?

A: Yes, probably several--but a few to keep in mind. While we all get lazy and/or careless and break this one, in general, if replying to a message, begin your answer BELOW the previous message, as if it were a conversation. (Or below the point in the previous message that you are answering.) Putting your reply above the message is known as top posting and is considered a Bad Thing(TM). If you're answering various points in the previous email, put your answer inline--that is answer paragraph a below paragraph a, paragraph b below paragraph b, etc.
Every so often, people get annoyed at this request. However, consider the following.

A: Because it messes up the order in which people normally read text. 
Q: Why is top-posting such a bad thing? 
A: Top-posting. 
Q: What is the most annoying thing on usenet and in e-mail?
Top posting seems to, on Linux_Newbies, generate a lot of heat, even if someone answering a question requests that others don't top post if they want that person to continue to to help them. This article gives an excellent illustration of why properly trimmed and posted messages are easier to read.

As this is a Linux list, many people use Pine or Mutt as their email client. Both are text based, and work better if you keep your lines at 72 characters or so. Some GUI (Graphic Based) emailers allow you to set this, others don't, but try to hit the enter key every 70 or so characters--if you rely upon your emailer to automatically return some of these text based emailers find it difficult to read. Again, keep in mind the selfish reason for doing this--often the most knowledgeable folks are the ones using such email clients, and they will be less inclined to answer your question if they have to take extra effort to read it.
Clarity is important of course, but try to keep in only what is necessary--at time of writing, this list is on Yahoo, and they include all sorts of ads or other superfluous things at the bottom of the email---try to delete that from the message to which you are replying, so we don't have to see it twice.
Don't hijack threads. Thread hijacking is when you want to post a new subject, simply delete the previous subject line, put in your new subject, write your email and send it. If you have a totally new subject, then write a new email--don't just take a previous post at random, delete its subject, put in your own, and write an email. Thread hijacking is a nuisance for those who set up Mutt, for example, to follow threads. If someone is not following thread x and deletes the entire thread, and you have simply changed the subject line, that person won't see your question. For an example see this picture One poster simply changed the subject line from Hallo to everybody to Is linguistics OT at all? However, in an email client like mutt, it becomes part of the same thread.
If you are replying to a previous email, but feel that the subject line should be changed, then, if you put in your new subject, add (was old subject.) For instance, if a discussion about distros is turning into a discussion about burning ISO's you might, in your subject line put
burning ISO's (Was distro discussion)
Some of the common instant messaging and mobile phone abbreviations aren't really appropriate on a tech mailing list. Using u instead of you, coz instead of because and plz instead of please tends to annoy people. If someone is annoyed, they're not going to bother answering your question, they may not even read it.

The links in the "Why aren't my questions getting answered" give excellent guidelines for questions, subject lines, etc.
You might find these rules restrictive--however, if you gain in knowledge and wind up on more advanced lists, you'll find them quite mild. The lists which refer to this faq are all aimed at newcomers. Other lists, aimed towards the more advanced user, expect even more from someone who is posting with a question. For an example of a list aimed at the more advanced user and their guidelines, see the Tokyo Linux User Group's List Policy
I have a little survival guide for the newcomer. It makes an effort to explain why you might have been flamed.

For those who find all these rules unreasonable, an anarchist friend has his own list, appropriately called linux-anyway. There, although newcomers will be informed of things they're doing wrong, the rule is that they will be told very nicely, and only with the aim of letting them know about these things in case they join other lists. For info on that list, please go to their welcome page
(back to top)

Q:Nobody is answering my questions. What's wrong with this list?

A: There are several possible reasons. Firstly, you might want to read Greg Lehey's excellent How to get the best results from FreeBSD questions Even though it's for a different operating system, much of it is applicable to any mailing list. Another excellent guide to proper posting can be found at How to Ask Questions the Smart Way.
Did you put in a descriptive subject line? Many of the people most able to help are on many tech support lists and get hundreds of emails a day--they glance through the subject line to see if there's anything interesting and if not delete it without reading. A subject line of "Help" is one that they often just delete. Another thing to keep in mind is that if you get the list in digest mode, and hit reply, the subject will show as Digest number xxxx. That's another thing that makes folks just delete without reading--change the subject line to read problem with remote login (was Digest number xxx)
Did you give enough information? This is always a fine line, but to say, I just installed Linux and X doesn't work gives us little to work with in helping you. If we have time, someone might send a reply saying tell us your distro, the error message, what happened, etc. Or, someone might simply see it, shrug and say, ok, I'll leave it to someone with time to play 20 questions. (For some tips on what information might be included, see the the next question.

Remember that people aren't obligated to help you and are doing it out kindness. No one owes you an answer. To become rude after not receiving an answer one almost guarantees that no one will help you in the future as well. It might simply be that no one knows the answer, or no one who knows the answer saw your post. If you don't get an answer after a day or two, it's alright to repost, and perhaps comment, politely, that you posted this before and no one answered, but you hope that this time someone who knows the answer or has time to help will see the post.
Is your mail formatted correctly? This is better covered on the Greg Lehey page referenced above, but also mentioned in the netiquette section and html sections in this faq.
Was your question phrased clearly? We understand that many list members don't have English as their first language, however even some folks that do have English as their first language don't describe something well. Once, a fellow on Linux_Newbies became outraged and abusive when no one answered his question correctly. He felt the fault was the reader's. However, when several people so obviously misunderstood what he was asking, there was a good chance that the fault was in his phrasing of his question.
Did you cross-post? Some folks automatically ignore cross-posted messages.
Did you RTFM? Even newbie friendly groups will sometimes not answer a question if it's obvious that the person made no effort to find out the answer on their own.
Are you a help vampire? Follow the link to get a fuller explanation, but basically, are you showing that you expect the list to do your work for you?
As Linux, Linx_newbies and RedHat are all newbie friendly groups, you will usually get these things pointed out--usually politely, though not always so. The best thing to do, if you don't get an answer after a day or so is to post again and perhaps ask if there's a good reason that you didn't get an answer the first time.
(back to top)

Q: What sort of information should I give when posting a question?

A: The distribution and version you are using. For example, RedHat 7.3, Gentoo 1.4, etc. If, for example, you're posting a question that the make command isn't working properly, and tell us right away that it's RedHat 7.0, we can tell you that make was broken in that version.
While on the subject--a very common mistake of newcomers is to say, "I'm running Linux 9.0," when they mean RedHat 9.0, Slackware, etc. Try to be careful with this. As most of the major distributions are up around version 9, we can't tell which distribution you have. So, I repeat--it isn't Linux 9.0 it is RedHat 9.0, etc.
The kernel version. (This can be found by typing uname -a at a command prompt). Knowing some of the hardware might be helpful--for example, there is a frequent problem with two lines appearing under the mouse in X with the SiS chipset. It can't hurt to give processor speed and type (eg Pentium III, Athlon) amount of memory and manufacturer of the motherboard. If you're having trouble with sound, then the make of the sound card, if the trouble is with video, then the make of the video card, if the trouble is with networking, the make of the network card.
Also, let us know, did anything change before this trouble began? That is, did you add a program and suddenly other programs stop working?
What steps have you taken to solve the problem? If you tell us, I searched google and deja using these key words, or I looked at the man page but saw nothing, this saves us from having to play 20 questions. Many of the older man pages were written by engineers for engineers, and it is alright to say I looked at the man page, and this part might have something to do with my problem, but I don't quite understand it. Telling us you searched google stops a grouchy person from saying, well, look at google and see what you find. If you're too inexperienced to know what steps to take first, that's alright too--but tell us. The idea is to save the people who might help you from having to play 20 questions. To summarize:
Distribution and version
Relevant hardware
Did anything happen that might have caused the problem (that you know of)
Where have you researched the problem
What steps have you already taken before posting
(back to top)

Q: I was told to RTFM. What does that mean?

Perhaps this is best answered by a quote from my friend Josh Glover.

Now, the more pressing issue. Are you familiar with the RTFM program? It is a great tool for learning how to use Linux. Here is all you have to do:
ln -s /usr/bin/man /usr/bin/rtfm
Now, anytime you have a question about a program, say "echo", for example, type:
rtfm echo
into the nearest text (or X, RTFM works under X now!) console.
Josh is being a bit droll, though his method, of linking rtfm to man is one of the cleverer ideas I've heard. RTFM stands for Read The Fine Manual. (Other people believe that rather than the word, "Fine" it refers to another common, albeit vulgar, English adjective beginning with F. The reader can choose for themselves.)
(Note: FreeBSD actually has a command called rftm in /usr/ports/misc. It will search the man and info pages for a command)
(back to top)

Q:I joined one of these lists and mentioned my web page, which is all about Linux (or FreeBSD or something related) yet people are saying I'm spamming. Why?

A: This can be a very fine line, and in general, it is better to err on the side of caution. If you join one of these lists, and immediately post about your Linux web page, it is somewhat poor netiquette and will be considered by many to be acting like a spammer. However, if you join a list, and the next day someone posts a question and you reply, "I have a web page which covers that..." it's probably acceptable. If you've been a member of one of these lists for awhile, and often post answers (or even questions) then it's possibly ok to post something about a new web page you're developing. Yet, again it can be a very fine line. For example, I'm a co-moderator on linux@yahoogroups.com, yet I asked permission to post about a new shell-scripting list that I was starting. This was simple courtesy to the actual owner and other moderators. Posting about your own mailing list on another mailing list should almost certainly be cleared with the list owners first.
If in doubt, ask is probably a good rule. It is definitely a bad idea to join a group and immediately post about your wonderful Linux page.
(back to top)

Q: This will be my first time installing Linux. What distribution should I use?

A: You will find that some people have an almost religious dedication to one distribution (commonly known as distro) vs. another. However, for the beginner, I think that the threemost important factors are ease of installation, including hardware recognition, sharing a machine with Microsoft, and ease of use once it's installed.

Distrowatch has a section with brief comparisons giving the pros and cons of 10 major distributions. It might be useful and can be viewed here.
Hardware detection has improved tremendously since the early days. Knoppix raised the bar for live CD's, that is, a distribution that runs from the CD drive so you can test it out without installing it. Ubuntu has become the most popular, but in late 2006 their latest version doesn't support several popular graphic cards, including various Matrox ones, without some fiddling that might take more knowledge than the beginner has.

If you look on Distrowatch you will see that most distributions are based on either Debian, RedHat or Slackware. (These days, one can also add Gentoo and ArchLinux.) Knoppix and Ubuntu are somewhat based on Debian, however, these days, you'll see that many distros are based on Ubuntu, which makes them, to my mind, based on Debian.

Many distributions now have LiveCDs, enabling you to try it before installing, to see if it will work with your hardware. There are 371 active distributions with another 177 on the Distrowatch waiting list, so the chances are, you will be able to find one to suit your needs. Browse through their listings--if you go to a distro's page, you will often see reviews, complete with screenshots.

(back to top)

Q: I want to keep Windows and only have one computer. How do I do this?

A: There are a number of ways, and that is one reason that I recommended looking at the installation guides. Caldera, for example, comes with a "lite" version of PartitionMagic, that can non-destructively partition your drives. I have heard from some people, however, that PartitionMagic doesn't play nicely with Windows 2000, at least through version 6, although others have had no problem. Always back up your data before playing with partitions--in one of my early Linux installs, I managed to wipe out 5 partitions with some mistypes.
Most distros of Linux also come with FIPS, another tool that I haven't used. It is supposed to non-destructively shrink your FAT32 partitions, leaving room for your Linux installation.
The better solution is to either have a drive free for Linux, or already have space. With the size of today's hard drives, this is less complicated than it used to be. Again, you are urged to check the distributor's installation guide, since almost all of them deal with the issue of already having Windows on the hard drive.
A full treatise on drive partitioning is beyond the scope of this FAQ, but hopefully, the above will get you started. It is covered in the latest Linux installation howto.
The section on partitioning is here.
(back to top)

Q: How do I dual-boot with an MS operating system?

A: If the MS system is on a FAT32 partition, Lilo will automatically detect it and include it in the menu. Grub will do the same, and later versions will do so even if it's on an NTFS partition.
There are a variety of possible setups--one can boot Linux from NT, which is a bit of a nuisance to setup, or NT from Linux, which takes, in modern distros at least, about 2 minutes to get working. For using grub see my grub page.
For the harder way, booting Linux from Windows (or using lilo) see my page here which gives step by step details for dual booting Linux and NT.
(back to top)

Q: I just downloaded an ISO and burned it to a CD. However, the CD won't boot, what's wrong?

A: Many people make the mistake of copying an ISO image directly to a CDROM. If you see one large iso image on your cd, as opposed to files and directories, that's probably what happened. This is not how it should be done. The ISO image is used to create a CDROM--it is not the actual thing that will go on a CDROM. Unfortunately, a few CDROM burning software manufacturers make a demo version available that won't actually do more than copy files to a CD, as opposed to making a bootable image from an ISO.

linuxiso.org has a good faq on this. They also have a good page on burning CDs with various types of software.

Some CD burning software can have confusing terms. They will give the option to burn a bootable CD. This would seem to be what you want, but what you really want, if you've downloaded a distribution's ISO, is something saying burn ISO to disk. (SonicMedia is one of ones with this issue.)

To use Linux itself to burn CDs see the burning CD question for a link to an easy to understand page about it.
(back to top)

Q: I just installed Linux. I had Windows installed, but now, when I start the computer, I don't see the option to start Windows. Is my Windows installation gone?

A: It's possible, if you messed up your partitioning during installation. However, the more likely possibility is that LILO or GRUB was installed in the MBR (Master Boot Record). If your MS partition is on a FAT32 filesystem, GRUB or LILO should have seen it and given you the choice to add it to your boot menu, but perhaps you missed it--or, even in Linux, things don't always work as they should. If it's on an NTFS partition, then they might not have seen it. In either case, it's easily remedied.
You probably have your MS partition on the first partition of the first hard drive. If this is the case, and your boot manager is LILO, then, as root, add the following to your /etc/lilo.conf file
other=/dev/hda1 label=NT (Or dos, or whatever--just remember there can be no spaces)
Then, run LILO to update it
/sbin/lilo
Upon reboot, you should have access to your Windows installation--depending upon your Linux distribution, you may have to hit the tab, space or shift key to see the choices.
If your boot manager is GRUB, then add the following lines to /boot/grub/grub.conf (or /boot/grub/menu.lst, depending upon your distribution) title Windows 2000 (or whatever--in Grub, you can have spaces)
rootnoverify (hd0,0)
chainloader +1
Upon reboot, you will see that Windows 2000 (or whatever) has been added to the menu.
(back to top)

Q: I just did something (installed Windows, edited Grub or Lilo, etc) and now I can't boot into my Linux partition. Is there a way to fix it without reinstalling?

A: Assuming that your Linux partition isn't trashed, then you can possibly fix it with the rescue option. Different distributions have different ways of doing this. In RedHat, one would do it this way.

Boot from the CD, and at the prompt choose linux rescue. It will begin as it were doing an install. It will then tell you that it is going to try to mount your RH partition under sysimage and that if that doesn't work, you can skip the step. The one or two times I've done it, I've skipped the step. Either way, the procedure is similar. In this case, we'll assume that your Linux partition is on the 2nd partition of your first hard drive, i.e. /dev/hda2 If skipping the sysimage step then

mkdir rh
mount /dev/hda2 rh
chroot rh /bin/bash

You are now inside the Linux partition and can do whatever you want. If you don't add the /bin/bash then you're using the sh shell, which has fewer features. Often, it just involves editing your lilo.conf or grub.conf (or menu.lst in distros other than RH).

If using sysimage, where they've mounted the partition for you (although you will have to know which partition it is, especially if you have more than one Linux partition) then it would be

chroot sysimage /bin/bash

(As I said, I haven't used the sysimage method--it might be chroot /mnt/sysimage or something like that, but there should be instructions on the screen.)
When done I think that if you use the sysimage thing, it will automatically unmount for you, when you're done. I'm not sure of that though, so you might want to do it as I would. When done with everything, and ready to reboot

exit
cd /
umount rh
reboot

In other words, exit the chrooted environment and unmount the partition that you were working with before rebooting
If you have the boot CD, and know in which partition you have your installation, this should work with almost all distros. If you have more than one Linux distribution on a machine, you can also boot into the working distro, then mount the drive containing the broken one. For example, if you have RedHat on /dev/hda5 and Slackware on /dev/hda2 and can boot into Slackware

mkdir /mnt/rh
mount /dev/hda5 /mnt/rh
chroot /mnt/rh /bin/bash

Don't forget to cd back to the Slack install and unmount the partition when you're done.

exit
cd
umount /mnt/rh

back to top

Q: I read the previous question. Now how do I reinstall Grub or Lilo?

A: I have a page on Grub that gives the details here. The short answer, once you're in your chroot environment (see the previous question), do the following.

grub

This will bring you to a grub command prompt, which looks like this >
For purposes of example, we'll assume the Linux partition is on the second hard drive, 2nd partition. Grub starts numbering at 0 rather than 1.

root (hd1,1)

If you're not sure of the partition, after doing root (hd1,
you can hit the tab key, and grub will list the different partitions that it sees. After you enter the partition, it will give information about that partition, such as its reiserfs or ext3 etc.

setup (hd0)

You'll see that it's checking for some files in your /boot/grub partition and then, hopefully, you'll see that setup succeeded. Once you exit your chroot environment and unmount the mounted drive and reboot, you should be back at your Grub prompt. (Don't forget to edit your grub.conf or menu.lst file before rebooting, if necessary).

Note that with some distributions, such as Gentoo and Arch that are using devfs, it might be slightly different. You may have to use devfs syntax. For instance, if in trying to mount /dev/hdb2 you get something like no such device then use

mount /dev/discs/disc1/part2

You will also have to mount /dev. So, if I booted from an ArchLinux CD as an example, rather than making a directory, I can just use /mnt. (Note that each distribution does this slightly differently, and you may have to adapt slightly.) So, with ArchLinux, after booting from the install CD--again assuming that my ArchLinux partition, which has grub, is on the 2nd partition of the second hard drive

mount /dev/discs/disc1/part2 /mnt
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash

From there, one would continue as has been already explained. With Lilo, it's usually a bit simpler. Get into the chroot environment. Check your /etc/lilo.conf. If you're redoing your Windows partition, it's probably already there, a line like

other=/dev/hda1 label=dos

If it's there, fine, if not add it. You can label it as WinXP, etc, just be sure that there aren't any spaces. Then, run lilo

/sbin/lilo

Hopefully, you see something saying it has been successfully updated. If so, you're fine, again exit out of the chroot environment, unmount the Linux partition and reboot. (This is assuming that you've put Lilo in the MBR. If not, change the boot= line to read boot=/dev/hda

back to top

Q: I've forgotten my root password. Is there a way to get it back or boot into the system?

A: In many systems, you can recover your root password by booting into single user mode. If you use Grub, when the grub screen appears, select the system you want to fix and hit

e

This will enable you to edit the entry. Take the line that looks something like

kernel /boot/vmlinuz ro root=/dev/hda2

Add the world

single

to the end of that line. When it boots, in RedHat and many others, you will simply be presented with something like sh #. At that prompt, you can then change the root password by simply typing

passwd

If using Lilo rather than Grub, you would, at the lilo prompt, type the name you've given your kernel (that is if you have label=linux, you'd type linunx) and the word single. So, assuming that your lilo.conf has

label=linux

you would, at the lilo prompt, type

linux single

Again, you'll be presented with a # prompt and be able to change the root password.

Some more secure systems, however, don't allow this. For example, in Gentoo Linux, if you boot into single user mode, you are told to enter the root password for maintainance. If your system is configured this way, then you would have to use the previous questions's method for booting from CD or another installation and doing a chroot to change the password.

back to top

Q: Why should I avoid logging as root? Or, I can't login as root when I connect remotely.

A: By default, remote root logins are not permitted. This makes it more difficult for a cracker to invade your machine. You shouldn't change this.

When you log on as root, there are no restrictions upon what you can do to the machine. Therefore, you are always safer and better off logging on as a regular user and either using the su command or the sudo command to do things that require root privilege.

back to top

Q: How do I set or change the hostname of my machine?

A: This depends upon the distribution. In RedHat, you will find a file called /etc/sysconfig/network. In there you'll see a line

HOSTNAME="localhost.localdomain"

or something similar. Change the localhost.localdomain line to your desired hostname. Other distributions have a file called either /etc/hostname or /etc/HOSTNAME. You may have to create the file if it doesn't exist. Often doing

man hostname

will tell you which file is used. In Gentoo, for example, you manually create a file called /etc/hostname and put your desired hostname in there.
back to top

Q: You often say, "At a commmand prompt" or "type the command". How do I get to this command prompt?

A: The chances are that if you're asking this question, you're relatively inexperienced and have, during installation, accepted the distro's defaults. So, I'm going to assume that you're booting into a graphical login and are using either Gnome or KDE.
Both of these desktops have an icon (a small picture) on the taskbar (that bar at the bottom of the screen) that looks a bit like a computer monitor. Clicking on that will open up what is called a terminal window. Depending upon your distribution, the window will have a command prompt looking something like
user@localhost user $
Your window will say something else, but will have either a $ or a # at the end of the line. (It may, if you have a different shell, have a % but the chances are that it will have either the $ if you're logged in as a normal user or a # if you're logged in as root). That is the command line. At that prompt, you can enter the various commands mentioned in this faq.
If you chose a non-graphical login, then, as soon as you log in, you are at the command line, often known as CLI for Command Line Interface as opposed to a GUI or Graphical User Interface (GUI is usually pronounced "gooey"). In that case, you can enter any of the commands there, in the console.
In some recent versions of RedHat, I believe that rather than seeing a terminal icon, you have to right click anywhere on the desktop, and are given a menu which includes starting an xterm.
(RedHat 9.x's version of GNOME works this way--you right click on the desktop and are given the option of a terminal. In their version of KDE, you have to go to the RedHat icon to open the menu, then choose system tools => terminal. You can drag the terminal icon from that menu down to the taskbar, and afterwards, always open an xterm by clicking on the new icon. You can also do that in GNOME, that is drag the icon from the system tools menu down to the the taskbar.)
As some folks have had this question, to clarify, let me say that any of these commands can be entered either in the terminal while running X, or in console mode (with no graphical intereface). It doesn't make a difference.
(back to top)

Q: What's the best book for learning about Linux?

A: This is also a matter of personal taste. Another problem is that as I've progressed, it's harder to look at a book through a complete beginner's eyes. In my own case, I found the three most helpful things to be The Linux Installation and Getting Started Guide an online guide to installation, Mark Minasi's, of NT and 2K fame, book on Linux for the NT System Administrator, which can be found here, (Mr. Minasi's book assumes knowledge of WinNT, so doesn't start exactly from scratch) and Visual Quickstart Guide to Unix
The installation part of the Getting Started guide is a bit dated, however, the rest of it teaches you how to use the command line, and familiarizes you with the Unix commands used by Linux. Most distributions also have online guides that are useful, especially to the novice.
A quick note here--I know that some folks will read this and ask, "How could you have left out....". I reiterate, this is a matter of personal taste, and these were the things that I found most helpful, when I was a newbie. (Not that I'm an expert now, but my mentors expect more of me.) For example, I've been castigated for leaving out a link to the Rute book. (If that link doesn't work, try googling for Rute Linux >book.) I don't consider it a book for the novice. Mr. Minasi's isn't really a book for the computer novice either, but it is one for the Linux novice.
Once you're more experienced, you'll probably be able to find several good online books yourself.
tldp.org has collections of all the howtos and guides online. Many of these guides are also sold as books, and are quite good. Some are newbie friendly, some are written for the more advanced user. It's not a bad place to start. Some, such as the installation howto, are excellent for the beginner.
One more point--different distributions have different ways of doing things--a book that might be perfect for learning RedHat might not be that helpful in learning to use Debian and vice versa. You might be best off searching for a book about the particular distribution that you're trying to master
(back to top)

Q: I use AOL. Will I be able to use it with Linux?

A: Although I haven't used it myself, you can check pengaol.org. (The link may take you to the page in French--assuming you're not fluent in the language, there's a link for the English version on the left of the French page.)
(back to top)

Q:I just recompiled my kernel, and now, when I type shutdown -h now, it doesn't power off the machine. How do I fix this?

A: There are a few options in the kernel that have to be there. Many distros include them by default, and they sometimes get missed when we recompile.
These are the options I have--I haven't experimented by leaving out one, then another and recompiling each time, however, at least, with these two options in, the machine powers down. (Note that this is for the 2.4 kernel--I really have to update this faq one day).
All are in the General Setup section

Power Management Support
Advanced Power Management BIOS Support

James Drabb suggests adding

Enable PM at boot time

(back to top)

Q:Since I upgraded to the 2.6 kernel, my mouse doesn't work properly with my KVM switch.

A: This solution is from my friend Jonathan.

The problem in a nutshell is that many KVMs supress some parts of the data stream from the mouse (a part of faking that there's a mouse there when it's really on another computer) and that the psmouse module can't deal with that.
The fix is to explicitly tell it to use the imps protocol
One can add

options psmouse proto=imps

to /etc/modprobe.d/aliases He commented out alias char-major-10-1-psmouse which was in modprobed/aliases. (Commenting it out may or may may not be necessary).
(back to top)

Q:o I have Gnome as my default desktop, but now I want to use KDE. Or, I like Gnome but my girlfriend wants to use KDE. How do I switch it?

A: RedHat and its clones have a command called switchdesk. Type it in an xterm, and a GUI dialog box comes up--this will enable you to switch the desktop for a particular user. If, however, you use a window manager not included with your distribution, such as blackbox, you'll have to manually create an .xinitrc file (note the period before the file name.) I am using blackbox as an example--to start it, the file should say exec blackbox. (Each window manager has its own syntax--KDE is startkde, etc.) So, using blackbox as an example--in the home directory of the user who wishes to use blackbox, you type the following:

touch .xinitrc
echo "exec blackbox" > .xinitrc
chmod 500 .xinitrc

You have done the following. The touch command creates a file. The echo command with the less than sign redirects the words exec blackbox to that file. Lastly, you change the permissions on the file so that the home user can read and execute it.
(This is also how you'd choose the window manager in any distro without switchdesk)
You can also, if you like, use a little script that I've written. In its current state, it gives the choices of Gnome or KDE but it is easily modified. It can be found here.

(back to top)

Q:My Linux boots up in textmode and I want to change it to graphic mode. (Or vice versa). How do I do this?

A:In Redhat, you edit the /etc/inittab file. If you open the file you will see a part that looks like:


# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# 
id:3:initdefault:

(There will be more things in the file, but this is what we want to change.) Change the id:3:initdefault to id:5:initdefault and RedHat will then boot up in graphical mode. If you are booting in graphical mode and wish to change it to text mode, then reverse the process and change the 5 to a 3. For normal purposes, these are the modes you need--3 is text and 5 graphical.

Slackware uses a different system--it too uses /etc/inittab but the runlevels are different--for Slackware, you would change it to 4, I believe, to boot up in graphics mode However, regardless of which distribution you're using, the file itself should tell you what each mode means.

NOTE: Around March 2008, Ubuntu and Fedora, at least, are now using upstart rather than the standard Sysv init. Therefore, editing /etc/inittab won't work. Other distros might start doing this too.

In Fedora, you will now edit a line in /etc/sysconfig/init. I'm not sure what Ubuntu is doing. So, if editing /etc/inittab doesn't work, check your distribution's forums and release notes and see if they too are changing to upstart. If so, no doubt someone will document what file should be edited and how to change your inital run level. (back to top)

Q:How I do switch between X and console mode?

A: While in X hit Ctl+Alt+F1. This will take you to console mode. To get back to X hit Ctl+Alt+F7. (In FreeBSD, rather than F7, use F9)
(back to top)

Q: Is there any way to view more than one window at a time in console mode?

A: There is a pretty simple program called splitvt available (at time of writing, August 2002) here. To install it, follow the instructions given in the question about rpms, tar.gz files, etc.
tar -zxvf, cd into the new directory, ./configure && make && make install. Then, in a console (it also works in an xterm, though of course, if you're in X, you're better off with two xterms)just type
splitvt
A second window will open below the first. You can toggle between the two windows with ctrl+w
Another program, screen, is included with many distributions. Screen is a far more flexible program and used for many purposes besides splitting a console screen. To use it, at a command prompt, type
screen
To open a second console window type
ctrl+a
This prepares it to accept a command. Then type shift+S which will open a second window. To toggle to the second window, once again type
ctrl+a and then hit the tab key. You'll now be in the second window, but unable to input anything. So, once again, hit ctrl+a and then hit c which will bring you to a command prompt.
back to top

Q: I just installed RedHat or Fedora and I can't telnet to the machine. Or, I can't use Apache, or Samba, or SSH, FTP, etc

A: As one of the mainstream distros, RedHat has started becoming more security conscious. Telnet is disabled by default. Rather than explaining how to get it running, I am going to suggest that you use SSH. SSH is actually easier to setup on RH 7.1 than is Telnet. Briefly:

Make sure you have openssh-server installed. Fix the firewall to allow it (at a command prompt type lokkit, which will open the RH firewal configuration tool--if you're editing manually, than allow port 22). For a Windows client to use SSH to get in, you will have to add software to the Windows box---I use Terraterm and TTSH. Lastly, start the sshd daemon

/etc/rc.d/init.d/sshd start

For a fuller description of installing and setting up SSH, including links to free Windows clients, see my page here.
For Samba, there are a variety of possible problems, so see the Samba section below. Redhat's default medium security firewall also blocks FTP and Apache. FTP has its own security risks, so I'm not going into detail here. Apache, of course, has its risks too, but at any rate, one reason none of them is working may be your firewall. Again, use lokkit. One way to see what ports are open is to type (assuming you are running the default, ipchains as of time of writing is to type
ipchains -L -n at a command prompt--this will show you what ports are open.
Note that the above was originally written for RedHat 7.1. Although there may be some very old legacy machines running ipchains, almost all now run iptables instead. The lokkit program is RedHat (and probably Fedora) specific, other distributions will have their own firewall configuration programs. The command to show your rules with iptables should be
iptables -Ln
(back to top)

Q: I try to mount my cdrom in RH 7.x and get a message that /dev/cdrom is not a valid block device. (Or something similar) How do I fix it?

A: This seems to be a glitch in RH7.x. I've had it happen on occasion, but not with every install. It's usually fixable by typing
depmod -ae at a command prompt. (This should be done as root) This seems to survive a reboot as well
(back to top)

Q: How do you burn CD's in Linux?

A: There is an excellent guide here.
The author doesn't cover copying a bootable CD. To do that you'll need to extract an image of the CD-ROM and burn that to another CD. Use:

dd if=/dev/hdc of=cdrom.img

It'll suck the entire CD off /dev/hdc (or whatever your CD-ROM's device node is) and dump it into cdrom.img. Once the process reaches the end of the CD it'll fail with an I/O error but by that time the image will be complete on your hard disk. Then, all you have to do is burn the image onto a new CD.
(back to top)

Q: I'm trying to edit my inetd.conf file in RedHat 7.x and can't find it. Where is it?

A: In RedHat 7.x, inetd has been replaced by xinetd. It allows more granular control than inetd. Some of the functions that used to be handled by inetd are handled by allowing or disallowing ports and protocols in ipchains or iptables, while others are handled by a combination of ipchains (or iptables) and xinetd. VERY generally speaking, if you find no indication of the particular service listed in /etc/xinetd.d then it can probably be handled by allowing (or ceasing to allow) the port and protocol in ipchains or iptables.
(back to top)

Q: I was told to look at the man pages--however, I'm finding them difficult to understand.

A: I believe that I once read that the man pages were originally written simply as reminders to people who already knew what they were doing. At first glance, many of the man pages can seem incomprehensible. However, keep going back to them. Look at them for commands that you do understand. Gradually, they will become more helpful to you.
If it makes you feel better, note that to many users of Unix and Unix like systems, Linux man pages are considered to be the most poorly written of any system. The BSDs, for example, consider document writing to be important, and one will often (though not always) find BSD man pages to be far superior to the Linux version.
(back to top)

Q: What about firewalls for Linux?

A: There are some out there. As you get a little more experienced, you'll be able to create your own with iptables or ipchains. Out of the distributions I listed above, I know that RedHat 7.1, Mandrake 8.0 and SuSE 7.2 all have easy to configure firewalls. This is another thing to check on the distributor's website before installation.
(back to top)

Q: I would like to set up Pine (or Mutt) as my email client, but can't figure out how to configure it.

A: I have a page with what I feel is a clear explanation here. and one for Mutt here. (Both pages deal with simply setting it up for the single user) In brief, you have to setup a .fetchmailrc file for Pine and do a bit more with Mutt for them to work.
(back to top)

Q: I downloaded a program with an .rpm (or tar.gz, tgz, tar.bz2, tbz or tar.Z). How do I install it.

A: If it's an RPM then
rpm -Uvh packagename
It will then be installed for you.
If it's a tar.gz, or .tgz (which is simply an abbrevation of tar.gz) then tar -zxvf packagename
You'll see, after untarring it a new file, which is actually a directory--same name without the tar.gz extension. Change directory to that directory
cd filename
In there, there will usually be a README file and possibly an INSTALL file. Read them
less README
(And the same for the INSTALL, just substitute INSTALL for README)
They will give you installation instructions.
If it's a tar.bz2 file, (or .tbz, an abbreviation of tar.bz2) then, with RedHat and some others, instead of tar -zxvf use tar -jxvf. If you get -j unknown option then try tar -yxvf (that one works in Slackware 8.0 and probably some others that use an older version of tar. If neither of these work, though one should, then do
bunzip2 filename.tar.bz2 && tar -xvf filename.tar
From there, as in untarring a tar.gz file, you'll now see a directory of the file name without an extension. Follow the instructions for tar.gz files giving above, starting with cd'ing to the new directory
On occasion, you'll come across a file with a .tar.Z extension. In that case
uncompress filename.tar.Z && tar -xvf filename.tar
From there, once again follow the instructions for tar.gz given above beginning with the cd'ing to the new directory Once again I have a page on it for more detail.
(back to top)

Q: I just installed a program. How do I start it?

A: Most window managers have their own way to add a program to their menu. Both KDE and Gnome (I believe--I haven't used either in so long that I've forgotten) have something from their start menu where you can add an application to the list of programs.
In other window managers, such as Blackbox or Icewm you have to edit their menu file--usually, the man page for the window manager will tell you how to do this.
Note that after installing a program, you sometimes have to do a hash -r (in bash) to refresh the shell (a poor choice of words, but I can't think of better at this moment). :)
Meanwhile, for the impatient, you can simply open up an xterm window and type the name of the program. Putting an & sign after it makes run as a background program, meaning you can still use that xterm. For example, if you've just installed Opera, you can open an xterm and type
opera &
This will open it. If it doesn't open after a reasonable length of time, then try typing it without the & sign after it--this will allow you to see any error messages and give you a hint about why it's not opening.
(back to top)

Q: How do I access my Windows drive from Linux?

A: If it's on FAT or FAT32 one can simply do the following:
Make a directory in which to mount the drive
mkdir mswin
Mount the drive--let's say it's the first partition on the first hard drive, which would be, in Linux terminology, /dev/hda1
mount -t vfat /dev/hda1 mswin
(The -t vfat label is if your Windows drive is formatted with FAT32--if it's in FAT then change the -t vfat to -t fat)
You should now be able to access your Windows drive in the directory mswin. Keep in mind that there are sometimes differences--a notepad text file might sometimes look peculiar in Linux and a vi text file might look odd in MS.
At present, Linux has experimental read and write support for NTFS, but it doesn't always work perfectly. You will have to recompile your kernel to get it to work. (In the filesystems section, there is a section for NTFS) Though some people have had success, I would be leery, especially of writing to NTFS partitions
(back to top)

Q: Is NTFS supported by default in RedHat 7.3?

A: Not at this time. You would have to recompile your kernel and add NTFS support under filesystems. Read support is now pretty good, I haven't tried write support, which is still experimental, though others have had no problem with it. (UPDATE: As of early December, 2004, NTFS support is apparently not enabled by default in Fedora Core 3, either.
(back to top)

Q: How do I find out what version of the kernel is running on my machine?

A: If you boot up in text mode, (which, by the way, will load far more quickly than a graphical login) it will be there above the login prompt, along with what distribution and version of Linux you have, for example
RedHat Linux release 7.2 (enigma)
Kernel 2.4.16 on an i586
However, if you have a graphical login, you can also type
uname -a
at a command prompt, which will give you the kernel (though not the distro) version, such as
Linux asa.localdomain 2.4.16 #1 Sun Dec 2 13:37:56 EST 2001 i586 unknown
In this case, the kernel is 2.4.16 and it was built on December 2nd.
(in some cases, the command cat /etc/issue will also give you this information--it works in RedHat, but not in Slackware)
cat /proc/version
can also give the same or more detailed information.
(back to top)

Q: How do I recompile a kernel?

A: This is a frequent question, but rather involved. The quick answer:
Download the source and move the tarred file to /usr/src. Untar it. Change to the newly created /usr/src/linux directory.
>From there, do make menuconfig or make xconfig. Go through it and make >your choices. When done for a 2.6 kernel do

make && make modules_install
For a 2.4 kernel do
make dep; make clean; make bzImage.
If that goes without errors, then do

make modules; make modules_install
Now, copy the new bzImage to your boot directory

cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.10

(That would be assuming that you had just compiled the 2.4.10 kernel--obviously, use the name.)
Add the new image to your lilo.conf, grub.conf or menu.lst depending upon your bootloader. Cross your fingers, reboot and see if it comes up.
One common error--people miss the processor section--if the boot hangs at
Ok uncompressing the kernel
you probably chose the wrong processor.
I have two pages, with links--one for general kernel compilation, here and one specific to RedHat, which has its own quirks, here. Note, however, that both refer to the 2.4 kernel. As I use FreeBSD almost exclusively these days, they probably won't be updated
(back to top)

Q: I can't get Samba working properly. How do I fix it?

A: The problems that I've encountered, which may or may not be your problems, are:
Not uncommenting encrypted passwords. If you're running Win2k on the MS side, that is often necessary.
Sometimes, it starts working if you change security from user to share. This isn't ideal, but sometimes it fixes the problem. Be sure that the MS user also has an account on the Linux box with the same name and password. Also, add the user to the smbpasswd file.

smbpasswd -a (username). The first time you'll get an error message about the file not existing, but that can safely be ignored.
One error you might get is something like couldn't open file /var/lock/samba/STATUS..LCK. That's the easy error--create the file. First
ls var
If you have a file /var/lock then do
ls /var/lock
If you don't, then make the directory
mkdir /var/lock
See if you have /var/lock/samba and if not do another mkdir
mkdir /var/lock/samba
Now, create the STATUS..LCK file touch /var/lock/samba/STATUS..LCK
You might have to do a chmod on it--try 755 and if that doesn't work, do 777.
Slack is a bit harder--I got various more cryptic error messages. I fixed it with smbclient -L localhost -N substituting the name of my machine for localhost.
Also, I've sometimes had to add my machine's netbios name to /etc/hosts. If you look at /etc/hosts you'll see something like
127.0.0.1 localhost
If my machine's netbios name is scottr and it's IP addie on the LAN is 192.168.0.101 I'd add
192.168.0.101 scottr
(This is one that I've sometimes had to do, and sometimes haven't)
On RedHat, the default medium security firewall doesn't allow Samba. You have to add lines to your ipchains (which is what is running by default) or your iptables (if you've upgraded.) The default firewall blocks both tcp with syn packets and udp on well known ports (ports 0-1023). To do this, first do a listing of ipchains with line numbers

ipchains -L -n --line-numbers. See where the first rejection is, it's usually around line 4 or 5. So, if your network is one of 192.168.1.x and the first line rejecting things is at line 5 you would type at a command prompt:

ipchains -I input 5 -s 192.168.1.0/24 -p udp -d 0/0 137:139 -j ACCEPT

We need tcp with syn packets so add

ipchains -I input 6 -s 192.168.1.0/24 -p tcp -y -d 0/0 137:139 -j ACCEPT
(if you were using iptables instead, the syntax would be:
iptables -I INPUT 5 -s 192.168.1.0/24 -p udp -d 0/0 --dport 137:139 -j ACCEPT
iptables -I INPUT 6 -s 192.168.1.0/24 -p tcp --syn -d 0/0 --dport 137:139 - ACCEPT
(For further explanation of ipchains, see my ipchains page.)
Lastly, obvious though it is, make sure that the smbd and nmbd daemons are running. In RH this is easy
/etc/rc.d/init.d/smb start
In Slack you have to uncomment the lines (that is, remove the # in front of the lines) about netbios in /etc/inetd.conf. Then, to send a SIGHUP to it
ps ax | grep inetd
You'll get back a pid number. Usually, it's the only number in a line something like 65 ? S 0:0 /usr/sbin/inetd
kill -1 65
This should restart it.
One quick way to check is, from the MS machine do (if the Samba machine's IP addie is 192.168.0.101)
nbtstat -a 192.168.1.101
If you get back its netbios name and a few other things, that's a good sign.
Once again, I've put up a page on it.
(back to top)

Q: I try to do a shutdown (or add user or similar root only command) and get "command not found" What's going on here?

Well, for one thing what's going on is that you're not giving us the whole story. You logged on as a different user and then su'd to root, didn't you? How do I know? I'm psychotic--errr psychic.
Seriously, the quick answer is that you can run the su command as su - or, a better solution in my opinion, type the whole path to the command, which is usually going to be /sbin/shutdown -h now or whatever. When you log on as a user, your path, that is the places that the shell looks for commands, doesn't include some areas that root's path has. You can tell your current path by typing echo $PATH at a command prompt. /sbin has many commands that should only be done by root, therefore, it's not in the typical user's path. When you do an su, you're still in the previous user's home directory, and still subject to their path--this is the case even if you cd to root's home directory.
Doing the su - rather than a simple su also gives you root's path. Therefore, if you su - you will then be able to execute commands such as adduser or shutdown. However, it is probably a better habit to avoid this step and type the full path to the command name. It helps you learn where commands are located, and probably gives you more realization of why only root can execute these commands. Doing su - all the time makes you lazy and careless--trust me on this, I learned it the hard way. As they say, good judgement is gained by experience. Experience is gained by bad judgement
(back to top)

Q: RedHat recommends updating to iptables. However, when I type iptables, I get an error message saying that I might have to upgrade the kernel. What is going on here?
(As of version 8.0, RedHat now uses iptables by deafult)

A: Although RH is recommending iptables, their default (as of RH 7.1) runs ipchains. The default firewall that was created during installation uses ipchains. The two can't run together, so to enable iptables to run you have to first remove the ipchains module.
rmmod ipchains
>From there, you can run iptables. Keep in mind, however, that the default iptables simply allows everything in. Once you've learned how to make these scripts, if you wish to have iptables, rather than ipchains, run at start up, then simply type
ntsysv
This opens a tool that will enable you to choose which services run at startup. Deselect ipchains and select iptables.
I reiterate--don't do this until you have some idea of what you are doing. My ipchains page has a very simple example--while I wouldn't trust my machine to it, it does, at least, duplicate RH's default medium security firewall.
(back to top)

Q: What's the best emailer for Linux?

A: This is another one that is a matter of personal taste, however, especially for those used to Outlook Express, I'm going to recommend Sylpheed. Like OE, it can create filters, easily create multiple accounts, etc. Although others swear by Kmail, the last time I used it, it wasn't able to create multiple accounts with different smtp servers (which has changed, I believe.)
(back to top)

Q: My modem works in Windows, but not in Linux. How do I fix this?

A:The chances are that you have a winmodem. Winmodems are less expensive to make and rely on software to do what higher quality modems have hardware do. There is limited Linux support for them at linmodems.org.
They don't work as well as better modems, even in Windows, and it is recommended that you purchase a better modem.
A quick aside on this... if your machine has a winmodem, the chances are that it is running a program called ptsnoop. I've heard, (though not checked) that all this does is make you able to hear the modem dial in and connect (which can of course be handy for trouble shooting). Regardless, if you buy a better modem or switch to a broadband connection, you definitely want to get rid of ptsnoop as it is a resource hog. (I reiterate, I haven't checked what happens if you get rid of it on a machine that only has a winmodem--you might still be able to get rid of it, I don't know.) At any rate, the steps for ridding yourself of it are as follows.
You have to be in Windows. Do a ctrl+alt+delete which will bring up a list of running applications. Highlight it and click end task. Then, do a search for it. (You may have to change, in My Computer the listing of files to show hidden files. There will be two files, ptsnoop.exe and ptsnoop something, I've forgotten the extension. Delete them.
Go to start, run and type in regedit. This will bring up the registry editor. (Always be careful when editing the registry, as mistakes can make your computer unusable in Windows.) Do ctrl+f to open up find. Do a search for the registry key for ptsnoop--there's only one key, when you find it, you can delete it.
Lastly, again go to start, run and type in win.ini. This will bring up a file and you will see ptsnoop around the 2nd or 3rd line. Delete it from there as well.
(back to top)

Q: How do I get the scroll wheel of my mouse working in Linux?

A: I found that in RH 7.1 if I chose MS Intellimouse during installation, it worked without problem. Here is my /etc/X11/XF86Config pointer section:

Protocol "IMPS/2"
Device "/dev/psaux"
ZAxisMapping "4 5"

Some folks find that if this doesn't work, even if it's a three button mouse that adding the line
Buttons "5"
helps, but I haven't found it necessary.

The above was for XFree86 3.x. In 4.x the syntax is a bit different.
>From a Slackware configuration:

 Identifier  "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "IMPS/2"
    Option "Device"      "/dev/psaux"
    Option "ZAxisMapping"  "4 5"

One interesting thing here--when Slack set it up, it didn't do it correctly and the scroll wheel didn't work--it had the last line as:
Option ZAxisMapping 4 5
leaving out the double quotes. This caused it to not work.
(As an aside, I had to search to make it work in FreeBSD, so here's my BSD /etc/X11/XF86Config pointer section--you'll note it's similar save for the Device, which is a FreeBSD thing)

Protocol "Intellimouse"
Device "/dev/psm0"
ZAxisMapping 4 5

That worked for XFree 3.x. In 4.x, although xf86config chose Intellimouse, I had trouble until I changed protocol to Auto. My current mouse section looks like

Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "Auto"
    Option "Device"      "/dev/psm0"
    Option "ZAxisMapping"  "4 5"

This is in FreeBSD 4.5-PRERELEASE
(back to top)

Q: I installed RedHat 7.2 and upgraded to the ext3 filesystem. Then, when I went to recompile my kernel, I ran into problems as there's no option for ext3 in the filesystems section? What do I do?

A: As of kernel release 2.4.16 ext3 support is an option in the filesystem section. So therefore, make sure that you included it when you configured your kernel. If you are using an older kernel then read on.
The following has worked on both Slackware 8.0 (running ext2) and RedHat 7.2 that was already on an ext3 filesystem.
Assuming you have unpacked the kernel source, go to http://www.zip.com.au/~akpm/linux/ext3/index.html and get the patch for your kernel. (The example is from their page, and assumes that you have downloaded the patch into your home directory).

cd /usr/src/linux

Apply the patch

gunzip < ~/ext3-2.4-0.x.y.patch.gz | patch -p1

(The ~ indicates your home directory--if you have put the patch.gz somewhere else obviously put that path in your command. The x.y. in this case simply represents version number, replace it with the actual patch name)

Now configure your kernel and the option for ext3 will be there in the filesystem section. If you are already using ext3 rebooting into the new kernel is sufficient. If not, then,once the kernel is compiled reboot into it. Now run the following command

tune2fs -j /dev/hdXX

(replace xx with the name of the mounted drive or drives.) Upon reboot, you will be using an ext3 filesystem. You can check this with

dmesg | grep ext3.

Also, if you weren't using ext3 before, be sure to edit /etc/fstab--you'll see for example, something like

/dev/hda1            /             ext2           noauto

Change that ext2 to ext3
Actually, I've forgotten that step on occasion, without problems, but I suspect I was lucky.
For a more detailed explanation you can go to the using the ext3 filesystem page. However, I found that it wasn't necessary to do the rest of what they suggested, that is, downloading util-linux and e2fsprogs.
(As of November 9th, 2001, the testing 2.4.15-pre2 kernel has experimental ext3 support, so this question and answer may be removed soon. As of December 1st, the current release, 2.4.16 has ext3 support. So, if you have the same problem, just make sure that you did add the ext3 support when you configured your kernel)
(back to top)

Q: How do I compile a C (or C++) program and run it? Or, I just compiled a C program but each one that I make shows up as "a.out"

A: For C programs:
Write your program. Let's say it's your first one, and you have saved the source code as hello.c, you are in the same directory as hello.c and you are going to save the program as hello.
gcc -o hello hello.c
The -o flag tells the compiler what name to give the compiled program--note that you put the name for the compiled program first, then put the name of the file that's being compiled. If you don't use the -o flag, then the program will be saved as a.out. Hopefully, it compiles without errors.
Now if you do a ls you'll see that you have a new program named hello in that directory. You can test it immediately by doing
./hello
If it was a C++ program rather than a C program, you probably saved it as hello.cpp
g++ -o hello hello.cpp
After it compiles ./hello
(back to top)

Q: My network isn't working, how do I fix it?

A: Unfortunately, the question is often this vague. You've told me nothing. What network admins hate are descriptions like that--I've gotten calls from users, who frantically tell me the network is down to find out that what it meant was that they weren't able to, while goofing off, log into their aol account from work.
Now, you might be inexperienced and we understand that. I might ask, can you ping the localhost and you'll say what's that? That's fine. However, to help troubleshoot a networking problem, here are the steps you should take before asking for help. When you post, give us the results, so we have an idea of where to begin.
Tell us, how is your network configured? In other words, do you have three computers, sharing an Internet connection through a Linksys router? Do you have a hub? Is your Internet connection cable, DSL or dialup?
Was it working previously? Have you made any configuration changes, for example, upgraded Windows 98 to Windows XP?
Next, network troubleshooting 101.
On a Windows box, start, run, command (or cmd in Win2k and XP). You'll get a black DOS type window with a command prompt.
ipconfig
This will give you your ethernet information. For example, (if you were using a Linksys router, which automatically assigns IP addresses and gives itself the address of 192.168.1.1) you might see
IP Address. . . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Next, first check if the TCP/IP stack is working
ping localhost
Hopefully, you get a response.
Next, ping your local machine's IP address
ping 192.168.1.100
If you get a response then the gateway
ping 192.168.1.1
If you get a response, then you know the trouble is probably elsewhere.
Ping the other machines on the network--see if you get a response.
>From here, it changes, depending upon the situation. However the command
ipconfig /all | more
will show your DNS servers--try to ping them as well. On the Linux box
ifconfig eth0
If you get no such device, or only get a hardware address (something like 00:AA:CC:3D:60:8A) you've at least located the problem. If it's something like "error fetching device information; device not found" then Linux is not recognizing your ethernet card. Dealing with that is beyond the scope of this faq, but many distros have hardware detection and configuration programs that might work--in RH, for example, type
kudzu
at a command prompt.
If it's showing the card but only showing a hardware address, then see the question on configuring an ethernet card >From there, same procedure, ping localhost, (even if your card isn't configured, you should get a result from that one, showing, at least that TCP/IP is working on your machine) ping the IP address, ping the gateway. (ifconfig doesn't show the gateway, for that type route or netstat -r)
When pinging in Linux it continues until stopped with ctrl+c so instead of ping, type
ping -c 4 and the address, which will limit it to 4 pings.
Check the connections. Is the cable plugged in securely? Are the LED lights on in the back of your computer where the cable connects to the NIC? Are they on in the hub or router? If you have extra cables, try changing the cable. If a cable is in an uplink port, or the uplink switch is on, try turning it off and seeing what happens.
These are all things to do before posting your problem. The results will help us help you. I don't want to make this into a treatise, but also, if you're familiar with networking, then see if you can ping the far side of the router, try pinging www.yahoo.com (if you can ping it by address, but not by name, then it indicates that it's a DNS problem). If you're not familiar with networking, you will still be able to do everything up to this paragraph so do those things, post the results, and perhaps someone can help you.
(back to top)

Q: How do I set (or check) my IP address?

A: If you are receiving your address through a DHCP server (many cable and DSL providers do this) then you should get an address when the machine boots. You can check this by typing
ifconfig eth0
You should see something like

eth0      Link encap:Ethernet  HWaddr 00:A0:CC:37:9A:7C
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask
:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING  MTU:1500  Metric:
1
          RX packets:80 errors:0 dropped:0 overruns:0 frame:
0
          TX packets:62 errors:0 dropped:0 overruns:0 carrie
r:0
          collisions:0 txqueuelen:100
          RX bytes:6298 (6.1 Kb)  TX bytes:5287 (5.1 Kb)
          Interrupt:11 Base address:0xe800

The line you're looking for is the inet address xxx.xxx.xxx.xxx.This means that you go an address from your ISP. If you're supposed to get an address from them, and didn't, you can try
dhcpcd
which will attempt to get the address from a DHCP server.
If you have to set the address yourself, we'll assume that your network is 192.168.1.0 (in other words, all the addresses on your network have IP addresses of 192.168.1.x) your subnet mask is 255.255.255.0 and that your gateway is 192.168.1.1. The following commands will set the address, let the card know what network it is on and give it instructions to use the gateway. We'll give it the address of 192.168.1.100
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
route add -net 192.168.1.0 netmask 255.255.255.0 eth0
route add default gw 192.168.1.1 eth0


There is also the ip command. It's more flexible than ifconfig and can combine some of the attributes of ifconfig and route. The syntax with the ip command would be
ip addr add 192.168.1.100/24 dev eth0
ip route add default via 192.168.1.1

Note that it uses the /24 notation. If your subnet was 255.255.0.0 it would be /16. If your subnet is 255.0.0.0 then it would be /8. If your subnet is something else, the chances are that you know enough about subnetting to figure it out.

To see your address you'd use

ip addr show dev eth0

In FreeBSD it's somewhat different--the naming of the interface is also slightly different, in this case we'll use tx0, an SMC card.

ifconfig tx0 192.168.1.100 netmask 255.255.255.0
route add default 192.168.1.1
If you want to do it via dhcp, then it depends. Some distros, such as Gentoo (I believe) use dhcpcd, others, such as Fedora, use dhclient. In either case, assuming the network card is interface eth0 just run the command on the interface.
dhcpcd eth0

or
dhclient eth0

(back to top)

Changelog

Well, here's the changelog

Last week of October 2001 (I forget the date)
Added the section on ext3 after compiling a kernel and finding I didn't have it. Whoops

6 November 2001
Added this changelog--hopefully, there'll be enough additions to make it worthwhile

8 November 2001
Added the link to the Rute book in the books section. Added the link to the linux@yahoogroups.com mailing list, as this is going to be the list faq.

9 November 2001
Added the section on HTML, after someone on one of the Linux lists asked why it was discouraged. Although our linux@yahoogroups list covers it in the welcome message, unfortunately, most other groups don't.

10 November 2001
Added the information that the testing 2.4.15-pre2 has ext3 support. I'll leave the section on it in until they stop marking it experimental. :)

11 November 2001
Added the section on tar.Z files after someone placed a question about it on the Linux list

16 November 2001
Added the Visual Quickstart Guide to the books section

19 November 2001
Added to the Samba section

1 December 2001
Added the C and C++ compilation question Added basic network troubleshooting information

12 December 2001
Added the finding kernel version question

19 December 2001
Added the information that inetd.conf has been replaced by xinetd in RedHat

21 December 2001
Added the question about being unable to mount /dev/cdrom in RH 7.x after it happened to me. :) Added FTP, Apache and Samba to the telnet question, as frequent questions on the various lists indicate that many people don't realize these are blocked by RH's default firewall rules. Added the section about doing an su with - or typing an entire command path, as we're getting many questions about why this command or that one doesn't work.

27 December 2001
Added the question about what to do if LILO or GRUB is in the MBR and you can't boot your MS O/S

30 December 2001
Added the ifconfig commands

17 January 2002
Added a line or two to the networking question about the card not being recognized and corrected a typo which would have really made it difficult for someone to correctly set their gateway properly. :)

27 January 2002
Added the question about starting a program once it's installed

4 April 2002
Well, as you can see, I've not done too much with this in awhile, but added the burning question--get it, burning question?--about burning CDs.

19 April 2002
Added a bit on netiquette, including top posting, linewrap, etc

11 May 2002
After a flame war, started by a troll who didn't get an answer to his question, added the section on what to do if your questions aren't being answered.

27 May 2002
Added the section on actually creating a CD from a downloaded ISO after it seemed that several folks were making the mistake of just copying the ISO image over to a CD

22 June 2002
Added the section on using the rescue capabilities of most installation CDs.

2 August 2002
Added the section on RTFM after Josh gave me the great suggestion that newcomers should be told to link it to the "man" command.

4 August 2002
Added the question on how to get to a command prompt. As MS makes poorer and poorer marketing decisions--one begins to think they hired someone away from Apple--more and more newcomers try Linux, and for better or worse, how to get a command prompt has become a frequently asked question

8 August, 2002
Added the section on splitting a console screen using splitvt or screen

29 September, 2002
Added the hostname and recovering root password questions.
Added the question about what information should be included

9 November, 2002
Added the question about why one shouldn't join a list and immediately post a link to their own page

Well folks, that's it for now. If you think of questions that should be answered (and please provide the answer if you know it) just drop me a line.

(back to top)