Ask Klaus!


Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com.

Inode Numbers

Question:

I have a query, and I am not even sure whether it is appropriate to address it to you. But just in case, you can help, it would be great.

I have been told that a Linux system can "fill up" when it runs out of inode numbers because too many small files are created. I have two questions about inode numbers:

    A. What happens to the inode number allocated to a file that has been deleted?
    B. Is it re-allocated to newly created files ?

My worry is that if a lot of small temporary files are created and subsequently deleted, the system would quite rapidly run out of available inode numbers if these are not re-allocated.

Answer:

It depends on the file system and on the system state. First of all, the inode number of a deleted file is not put back into the "free" pool until all references to the deleted file have been removed (i.e., no process has the file still open). But, once the inode is taken out of the inode cache, in theory, its inode number should be available for the next opened file immediately.

Out of curiosity, I just did a little test of the inode numbers on a reiserfs partition with Kernel 2.6.15.

If you create a file called file, and call stat file, compare the output of rm -f file ; touch file; stat file. In most cases (where nobody else was creating new files on the same test partition at the same time), I got the exact same inode number back for the newly created file, regardless of whether I used different file names.

However, for tmpfs, the behavior is entirely different. Here, I always get a DIFFERENT inode number after deleting and recreating a file.

So, as long as the same inode number is always unique in the inode tree (except for hardlinks), it is entirely possible that a file system will reclaim them for newly created files, though you shouldn't count on it due to various different file system implementations.

HP 940C printer problems

Question:

I have been looking into how to get my HP 940C printer working under KDE as it does under Windows. After much work, I found the hpinkjet and duplex projects in SourceForge as the closest Windows option. I tried both and I didn't get my printer to print two-sided. I would like to have some tool that will allow me to print a document with just a click. Then I would like some kind of dialog to appear to tell me to prepare the paper to print the second side. know

I could do that with no much more effort by just printing the first side (odd pages in reverse order) and then the second (even pages in normal order). However, it is easy to get confused and all the printed sheets go directly to the wastebin.

Answer:

As noted in an earlier article, you can find many tools that access additional features of hardware directly from the manufacturers "support" homepage. Besides that, my recommendation would be to only buy hardware that works fine without "secret" proprietary plugins, and just return this printer because if it is "defective" (described features are not working) under your chosen operating system. (You would also return the printer if it didn't work right in "Windows" too, wouldn't you?)

Surfing with Linux

Question:

I love surfing the web with Linux because it doesn't seem to collect the adware and spyware that gunk up my Windows computers. The only problem is that many of the websites I visit seem to be designed for Windows clients. I am sometimes unable to play video or audio clips or work with the forms provided at the site. A message tells me I need tools such as "Flash" and "Windows Media Player." I assume there are probably add-on extensions to Linux browsers that provide equivalent functionality, but I'm not sure where to start. Do you have any recommendations for how I can outfit my Linux web browser to surf in this Windows world?

Answer:

If you are an information-oriented web surfer, most of the pop-ups and animations will be rather annoying to you. I know there are "flash-only" sites. But flash sites aren't typically designed to give you a well-organized information structure or for ease of access.

Someone more oriented towards multimedia content and entertainment just can't seem to get enough plugins.

Technologically speaking, this is not an issue with any current browser (including Mozilla Firefox or Konqueror). It can, however, be a license or patent problem.

Figure 1: The Firefox Add-ons page lets you download common Firefox plugins.

Some licenses for proprietary plug-ins allow free download and installation, but NOT redistribution of the software. The flashplayer license was a good example of this until a short while ago. Because there is no license to distribute, the plugins can't be included with Linux distributions even though the plugin itself is free. The onle way to obtain it is to go to the vendor's website and download it yourself.

In some countries, it is even illegal to play your own bought-and-paid-for DVDs on your own computer because of very restrictive copyright laws. You are not even allowed to have software that CAN play "scrambled" movie formats (which is the majority of commercially available DVDs today, unfortunately). Technically, it is not a big deal to play these formats. You just risk being sued if someone catches you to use this illegal "circumvention device".

But back to the browser plugins. Debian offers "non-free" packages for the most common problematic cases. These packages don't contain the actual software; instead they contain a script that downloads the plugin (at the user's legal risk, when accepting the license) and installs the plugin automatically to the right place in the file system. So, you can get the flashplayer-plugin and lots of others, but you still should read each individual license in order to find out if you are maybe doing something illegal. Firefox, in particular, comes with its own plugin installation engine for easy plugin installation, and most plugins work fine in the Konqueror browser as well.

For proprietary video formats, you will probably have to install xine or mplayer as a plugin, and the proprietary codecs (you will have to obtain a license if you don't already own one) as object files or "dlls" from a different operating system. How far this is allowed by the individual license that came with the software or library, is up to the copyright holders.

Most things would be very easy if there was only a technical problem to solve. Technical solutions are often easy. But in the case of plugins, the problems are, unfortunately, often of a legal or political nature, which makes them much more difficult.

Graphics Settings

Question:

I sometimes find myself putting Linux on old computers that do not come with user manuals. I have the most trouble with the settings related to the monitor and graphics cards, such as the resolution, refresh rate, color depth, etc. The Linux installer doesn't always find the right settings, or even if it does find settings that work, I don't know if these are the optimum settings. Is there a command that will get the monitor and/or graphics card to output information on itself? If not, I would be interested in any tips you might have on arriving at the right monitor and graphics card settings.

Answer:

I ran into the same problem with Knoppix when trying to automatically determine the graphics setup. Now, the framebuffer or vesa X-Server usually work great, but they are often not optimal in terms of speed and support of special hardware features such as DRI. You therefore have to find out which chipset the graphics cards has hwsetup first, and then go on to load the necessary AGP drivers, set the main chipset driver in the X server's config file, and set up the correct frequencies for card and monitor.

A small program that helps to do this is ddcxinfo-knoppix, which is based on the DDC probing tool from libkudzu/RH. It supports automatic generation of Modelines for xorg.conf or XF86Config-4, and is integrated into Knoppix. If you have the Knoppix DVD from the November 2005 issue of Linux Magazine, (or see http://www.knoppix.org/), it may be a good start just to boot a Knoppix CD or DVD and find out the settings from there.

The X-Server itself usually comes with helper tools or a semi-automatic "-configure" or "-setup" option that helps you create a first (and hopefully working) configuration file.