Best of Tech Support

Various

Issue #133, May 2005

Paid for 20GB, Getting 2

I'm trying to set up Linux on a slightly older machine that has a 20GB hard drive. I'm trying to install Fedora on it, but the installation program and Disk Druid recognize it only as a 2GB drive. The same is true of QTParted running off of a boot CD containing Mepis Linux. A Microsoft Windows XP install CD recognizes the size of the CD just fine. Both Linux programs have a problem with the drive whether it is unpartitioned or has an NTFS partition on it. I can't put any Linux partition on it larger than 2GB. Any idea what the problem is?


Aaron Roberts


Alr8@georgetown.edu

It's important to back up any data you want to keep from this drive, even from non-Linux partitions, before you try any of the suggestions here. Changing partition tables can be hazardous to your data. You can get some background on this problem from the Large Disk HOWTO by Andries Brouwer, at www.tldp.org/HOWTO/Large-Disk-HOWTO.html.

First of all, if the drive is original equipment for the machine, try resetting the BIOS to factory defaults.


Don Marti


info@linuxjournal.com

Did you partition the drive with some proprietary disk partitioner? If so, you may want to boot from a bootable Linux CD and wipe the boot sector. If your drive is /dev/hda, as it usually is, use this command:

dd if=/dev/zero of=/dev/hda bs=512 count=1

Another thing to try is to upgrade the BIOS on that machine.


Christopher Wingert


cwingert@qualcomm.com

You can try to force the issue at boot time by supplying a parameter such as:


hda=<cyls>,<heads>,<sectors>

You usually can obtain these values by looking up the drive's model number on the manufacturer's Web site. Some BIOSes also have a variety of drive reporting mechanisms, such as NORMAL, LBA and LARGE. Try cycling between these and see what you get.


Chad Robinson


chad@lucubration.com

Making a Boot Floppy

I need information on how to create a floppy that will allow me to load Linux from a CD-ROM. Can you give me some information about doing this so I can run two OSes (dual boot) on my small system?


Everett E. Stone


103726.2236@compuserve.com

If its a newer machine, you can boot from CD-ROM. Try the Knoppix distribution.


Christopher Wingert


cwingert@qualcomm.com

It's not clear from your question whether your problem is that your CD doesn't boot and you need a bootable floppy to kick start the distribution or if you want to insert or remove the floppy to control whether the system runs from the CD.

If the former, look into Slackware, a popular and well-maintained distribution that still supports bootable floppy options for the load and emergency recovery tools. Otherwise, consider a distribution such as Knoppix, which allows you to run entirely from the CD without loading Linux on your hard drive. This is obviously a much slower option, but it eliminates the need to partition your drive, which is good for taking Linux for a test drive or working from a computer that is not your own.


Chad Robinson


chad@lucubration.com

You don't need a boot floppy to set up a dual-boot system. Most of the common distributions will configure dual-boot for you in the installer. See www.linuxjournal.com/article/4619 to help you select a distribution.


Don Marti


info@linuxjournal.com

Deleting Millions of Files

On my SuSE 9.1 system that is a server for more than 40 Windows machines, my directory /var/lib/dhcp/db contains nearly 1.6 million files with names of the form dhcpd.leases.AAgxyz and so on. If I try to remove them with a single command, such as:

rm -f /var/lib/dhcp/db/dhcpd.leases.*

The process fails with a command buffer too long message. My workaround has been to remove them piecewise, as follows:

for i in {a-z,A-Z}
do
  for j in {a-z,A-Z}
  do
    rm -f /var/lib/dhcp/db/dhcpd.leases.$i$j*
  done
done

Is there a better way to get rid of such large numbers of files? Any idea why the DCHP dæmon is running away like this?


Larry W. Finger


Larry.Finger@lwfinger.net

Determining why the DHCP dæmon is assigning so many leases would require investigating its log files. It's possible that NAK messages are not making it through, MAC addresses are being reassigned or other shenanigans are being perpetrated by the clients.

However, there are certainly easier ways to remove the files en masse. If your dæmon isn't running, you can simply remove and recreate the directory itself, as in:

rm -f /var/lib/dhcp/db
mkdir /var/lib/dhcp/db

Be sure you restore any permissions and ownership settings the directory originally held. If this isn't to your taste, investigate the find(1) command, which can execute commands on files matching the spec you provide, such as:


find /var/lib/dhcp/db -exec rm {} \;

Note that the semicolon is required—it tells find where the exec command ends—but that most shells treat it as a special character. The back slash prevents this.


Chad Robinson


chad@lucubration.com

You can also use the xargs command, which feeds an arbitrarily long list of arguments to a command:

ls  /var/lib/dhcp/db/dhcpd.leases.* | xargs rm

Another sometimes-useful technique is to build up a list of commands and preview it with ls to see if you got them right:

ls | awk '{print "rm " $1}' | less

Then, replace the less with sh to do the commands:

ls | awk '{print "rm " $1}' | sh



Don Marti


info@linuxjournal.com

Server for Home Network?

I am new to Linux, and I would like to know if there is Linux software that would let me set up a file server for my home network that can be monitored and maintained remotely. I have six-plus computers on my local area network running Windows, and I have a spare computer that I would like to set up as a file server for the other computers for storage of MP3s and data. I would like to have this computer set up so that I can connect to it from any of the other computers to do maintenance and updates. I would like some kind of access control for the computers that can access this file server. Any suggestions or links to other sources regarding this project would be a great help.


Dan


dpinko@shaw.ca

Try Samba; more than likely, it already is on your machine. SMB is the native file-sharing protocol for Windows, so it is already there too.


Christopher Wingert


cwingert@qualcomm.com

Any number of options can allow you to do this. Two good starting points are Samba, a Windows-compatible file and printer sharing service, and Webmin, a Web-based administration tool. Webmin includes modules for configuring and administering Samba and provides its own Web server, so you need not install Apache, unless you want to.

If you must do something Webmin doesn't support, you still can manage the system via traditional command-line tools. Simply enable your distribution's SSH services on the Linux box, and use an SSH terminal from one of the clients to connect to it.


Chad Robinson


chad@lucubration.com

A good SSH client to install on the Microsoft systems is putty: www.chiark.greenend.org.uk/~sgtatham/putty.


Don Marti


info@linuxjournal.com

make or gmake?

I installed Ubuntu on my laptop, which does a fairly skinny install. It has make, but the project I am working on needs gmake. I need to install gmake and compile C++ code on a Linux box; I am compiling nachose-4.02. I did a search in dselect and could not find gmake. I went to the GNU site, and it does not specify gmake, only make. Are they the same?


Seamus Rhys


seamusrhys@msn.com

Here is a page specifically about the gmake package for Ubuntu. Download links are provided: higgs.djpig.de/ubuntu/www/hoary/devel/make.


Chad Robinson


chad@lucubration.com

Yes, make and gmake are the same program on Linux systems. For historical reasons, some projects specify gmake so that they can be sure to use the full-featured GNU version of make instead of an earlier, limited implementation.

An easy way to add gmake to your system, so you don't have to change the project or install software, is simply to make a symlink in /usr/local/bin:


cd /usr/local/bin \
&& sudo ln -s ../../bin/make gmake




Don Marti


info@linuxjournal.com

Thumbprint Readers?

I was in a large discount store the other day, and I saw a rack of thumbprint readers that tout things like “log on to your computer and Web sites with the touch of a finger, just place your finger on the receiver whenever a password or username is required.” A device like this would allow a user or a system administrator to use very large complex passwords for system access.

My office uses Red Hat and another OS; I use Debian. So far, I have not found a product or a HOWTO that recommends a product for use on a Linux machine. Is there a product you can recommend that would work on a Linux system?


Tony Freeman


tony.freeman@insightbb.com

This is possible under Linux, but you may need to roll your own solution using a variety of available packages. As far as I know, no distribution comes with support for this enabled out of the box yet, and certainly the software included with the product will be for Windows. To get started, take a look at Pluggable Authentication Modules (PAM). Basically, this is a subsystem that acts as an intermediary between applications, such as your login manager, and authentication sources, such as passwords, certificates and, yes, fingerprint scanners. You may have to configure some system files yourself, but it's possible to make this work using software available today.


Chad Robinson


chad@lucubration.com

Getting Sound Working on Fedora

Being a bit of a newbie to Linux—I can install packages but recompiling the kernel might be beyond me—I am looking for some help getting audio support added to my PC. I am using Red Hat FC2 installed on a Compaq Deskpro P550, which has an onboard sound chip ESS Audiodrive 1869. Any help or suggestions would be greatly appreciated.


Tom Corcoran


tomc@meridianp2p.com

Your sound card is supported by the ALSA Project, and that's where you should start. It doesn't require a kernel recompile. Although ALSA drivers are included in the kernel, the ALSA Project itself provides external, loadable modules that often are more up to date than those in any kernel package you may have installed. Visit www.alsa-project.org to get started. The site provides downloadable packages and documentation for installing them.


Chad Robinson


chad@lucubration.com

You shouldn't have to add drivers to a relatively new distribution. Run the sndconfig utility to detect and test your audio hardware, then make sure the volume is turned up using the mixer applet in the GNOME panel.


Don Marti


info@linuxjournal.com

Tracking Down malloc Errors

I disagree with the BTS advice “segfault when allocating memory” in the February 2005 issue. I bet ya a nickel that the culprit in this case is the previous malloc followed by writing outside the array boundary. One tool to figure this out is “electric fence” which is open source. There are also good proprietary tools to do this. Maybe you can review a few of them?


Jorg Kewisch


jorg@bnl.gov