November 10, 2004 Edition

by Andrew Forgue

This issue of Linux.Ars is special. We have two contributing authors, Rob Cook and Eric Newport. These two writers submitted articles on installing Nvidia drivers in Debian and booting a Linux distrubution called SLAX from a USB key. I thank both of them for their contributions and encourage anyone else who wants to contribute to email me at syndicate@arslinux.com. But that's not all, this time we have a very cool app of the week: filelight. Filelight gives you a graphical breakdown into filesystem usage. Without further delay, I present you the 30th issue of Linux.Ars.

Is that a Penguin in your pocket?

by Rob Cook

How many times have you sat at a computer and thought, If Linux was installed on this box I could.... Wish no longer, instead of carrying around bulky Live CD's or an external hard drive, how about Linux in your pocket? The combination of a USB key and SLAX, the Linux distro used in this example, is a powerful combination when it comes to troubleshooting and spreading the word about Linux. The ability to boot the key, browse the computer's hard drive (SLAX has NTFS support built in), locate and burn a file to CD can be very helpful especially with a computer that is ready to die. So grab your key and come with me, when were done you'll have a new tool to help out in the computing trenches.

What's needed:

  1. USB key, at least 256Mb in size. SLAX will take anywhere from 190-240Mb.
  2. The SLAX live CD found here: Download. I suggest the 4.2.0 version as there are some nice improvements over earlier versions, you can learn more here: Changelog. You will also see that there are various versions of 4.2.0, I used the plain version for this article and I can't vouch for the other versions. Use your favorite CD burning program to burn the .iso file to CD.

Prepare the USB key:

Prepare your computer:

With the above taken care of it's time to install SLAX to a USB key (you may want to print this out as we are going to reboot). Boot to the SLAX Live CD and when it has finished loading you need to login; Username is root, Password is toor, also go ahead and plug in your USB key now. Now you need to change to the /boot directory using the following command:

    root@slax:~# cd /boot

The command to install SLAX is following but make sure that you have a space in front of and behind the lone period, here is the command:

    ./create_bootdisk.sh . /dev/sda1 /dev/sda SLAX


Again, note the space in front and behind the lone period. When the installation has completed you may receive a message that LILO was not installed, you can safely ignore this.

Time to reboot. Remove the SLAX live CD when the computer has rebooted and if required by your computer press the key to allow booting from an alternate source. Choose to boot to the USB key or allow the computer to do so if it will on it's own. If all went correctly you should see the same shamrock logo as you did with the live CD, be patient, it can take some time to boot from a USB key. Once you see the login in screen go ahead and login; Username is root, Password is toor. I suggest issuing the gui command and taking a look around SLAX.

I am not affiliated with SLAX in any way it just happened that SLAX is very easy to install to a USB key, however if you like SLAX I'm sure they won't mind you making a donation.

Links in this article:

SLAX SLAX Download SLAX changelog SLAX donations

TTT: Tools, Tips and Tweaks

Doing the nvidia drivers "The Debian Way" under sarge or sid

by Eric Newport

The following tutorial explains how to set up nvidia cards in Debian. It's a fairly robust set of instructions that I've used to get nvidia cards up and running across multiple hardware configs without issue. Sometimes installing the nvidia driver with the installer nvidia provides just doesn't work right. This method is more true to "The Debian Way" of doing things.

Note: Being root when doing this makes things easier.

Note: You must be using sarge (testing) or sid (unstable) to do this.

Note: Make sure you have gcc installed.

    apt-get install gcc

Note: Make sure you have libc6-dev installed.

    apt-get install libc6-dev

Note: Make sure you have make-kpkg installed.

    apt-get install kernel-package

Note: Make sure you have modconf installed.

    apt-get install modconf

Firstly, you need the kernel source to match your kernel.

Question: I don't understand why the kernel has anything to do with installing some video drivers...

Answer: Because the kernel is where the DRI interface is which is necessary for 3D with any type of speed. If all you want is 2D you can use the "nv" module that comes with XFree. In which case you shouldn't be reading this tutorial...

Run this to see what kernel you have:

    uname -a

Then install the source code for your kernel. You can find the kernel source by searching for it:

    apt-cache search ^kernel-source

Then simply apt-get install the sources that matches your kernel.

After that, you need to get the nvidia kernel:

  apt-get install nvidia-kernel-source nvidia-kernel-common

That will give you a source tarball in /usr/src called nvidia-kernel-source.tar.gz.

Now you need to decompress it:

    # cd /usr/src 
    # tar -zxf nvidia-kernel-source.tar.gz

Next, for confirmation, please run:

    ls /usr/src

You should get output that looks something like this: kernel-source-2.x.x.tar.bz2 modules nvidia-kernel-source.tar.gz

Note: Adjust the following commands to match your kernel source.

Now that that's out of the way, you can copy your kernel config and make a custom nvidia installer for your system.

    cd /boot
    cp config-2.x.x-1-386 /usr/src/kernel-source-2.x.x
    cd /usr/src/kernel-source-2.x.x
    mv config-2.x.x-1-386 .config
    make oldconfig
    make-kpkg modules_image

After all that you should now see something like nvidia-kernel-2.x.x_1.0.5336-6+10.00.Custom_i386.deb in /usr/src. If so, run:

    dpkg -i nvidia-kernel-2.x.x_1.0.5336-6+10.00.Custom_i386.deb

Note: Adjust that command to match your file.

Next you need to run modconf and make sure nvidia is on the list.

    modconf

There should be an entry on that list somewhere regarding nvidia. (It should be at the bottom.) If all you see is a lot of kernel/blah/blah and nothing with the word nvidia in it, then exit out of modconf and run:

    ls /lib/modules

You should see some output that looks something like this: 2.x.x 2.x.x-1-386 modprobe.conf modprobe.conf.old

Note: If you have multiple kernels, ignore them. If you ran into the modconf not seeing nvidia problem, you should see two directories referencing your current kernel as the output above does.

Now check to see if there is a nvidia subdirectory in both of those directories.

    ls /lib/modules/2.x.x-1
    ls /lib/modules/2.x.x

If this happened to you, it installed the nvidia kernel module in the wrong tree. In my case, it should have went in /lib/modules/2.x.x-1. It needs to be copied over. Do so, then update your modules and run modconf again:

    cp -r /lib/modules/2.6.4/nvidia/ /lib/modules/2.x.x-1-386/
    update-modules
    modconf

Nvidia should be on your modconf list this time. Highlight it and hit enter. You should be able to install the module now. If all goes well, there should be a + sign next to it in modconf.

Now you're probably going to want nvidia-glx:

    apt-get install nvidia-glx

Now you're going to want to edit your XF86Config in /etc/X11 with your favorite text editor. In the Device section, change Driver "nv" to Driver "nvidia". Also comment out the lines Load "GLcore" and Load "dri". You'll also want to add Option "RenderAccel" "true" to the Device section along with turning NvAGP on.

Here is a sample finished Module section:

    Section "Module"
         #Load   "GLcore"
         Load    "bitmap"
         Load    "dbe"
         Load    "ddc"
         #Load   "dri"
         Load    "extmod"
         Load    "freetype"
         Load    "glx"
         Load    "int10"
         Load    "record"
         Load    "speedo"
         Load    "type1"
         Load    "vbe"
    EndSection

And here is a sample finished Device section:

    Section "Device"
         Identifier      "NVIDIA Corporation NV25 [GeForce4 Ti 4200]"
         Driver          "nvidia"
         Option          "RenderAccel" "true"
         Option          "NvAGP" "1"
         #Option         "NoLogo" "true"
    EndSection

Finally, since you've been doing this all as root, you may need to make sure that the other users of the computer can use the card:

    chmod 777 /dev/nvidia

Now your card should work. If you were running any X sessions while doing this, restart them. Otherwise, just start X. You should see a nvidia splash screen. The best way to test to see if your card really is working is to try running an OpenGL application. OpenGL screensavers are a good choice. I like Euphoria, personally.

I hope this tutorial was helpful!

Cool App of the Week

This week our Cool App of the Week is Filelight.

Filelight

Filelight is a really sweet filesystem usage application. It brings up your filesystem in a graphical display so you can tell where all your space is being used. It allows you to drill down to whatever level to zoom in on where your space goes. I'll let the screenshots speak for themselves.

From the main window, we can select to scan our home directory. This will go and catalog all the files and directories beneath ~ and will build a nice pie chart you see in the next image.

Image:Filelight-1.png

Here's the chart with the directory entry labeled. From this I can tell that E3EEVAENG.EXE takes up most of my home directory space.

Image:Filelight-2.png

If I hover on one of the outer elements in the chart, it shows the directories below it. You can tell the directories underneath without repositioning the center.

Image:Filelight-3.png

Now lets center it on /usr and hover on share/.

Image:Filelight-4.png

If I click on the share/ section of /usr it centers the chart on /usr/share. From there I can do a recursive delete of the filesystem (bad idea on /usr/share).

Image:Filelight-5.png

Filelight is a small but very useful utility. It has other options like omitting filesystems (for example, /dev and /proc), it will scan across filesystem boundaries for you if you wish. Filesystem full and you don't know why? Filelight will find the culprit. All in all, you should find this utility very useful. It's definitely a utility that you should not be without.

/dev/random

Linux.Ars Archives

The Linux.Ars Archives can be found Here.