Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

This chapter is from the book

This chapter is from the book

Hardware

There are many, many different types of hardware available for computers, including Webcams, network cards, hard disks, video cards, sound cards, and more. For each of these devices to work, a driver needs to be loaded by the Linux kernel. Unlike systems such as Windows, you don't need to install a special driver that is included with the device. Instead, the driver should already be included in Ubuntu and ready to work out of the box.

Of course, this is not always the case, and sometimes hardware can be something of a beast to get working. In this section we tear apart some of the hardware-related problems and attempt to resolve them.

Ubuntu Has Not Detected My Old Sound Card

Many older devices are not automatically detected by the current 2.6 kernel series. This is done to avoid hardware issues such as crashes. Unfortunately if you have an older sound card, it means you need to roll your sleeves up and poke around to get it running. To do this you need to know which kernel module your card needs and then load the module yourself. Loading the correct module for your device will not cause your system to crash, but loading the wrong one may well do so. You may need to experiment with different modules.

Look for the model of sound card you have by referring to your computer's specifications, the name of the device in Windows (if applicable), or by opening the computer case and looking at the sound chip. You can use Google to match a chip's serial number with the chipset type. Here is a list of devices and the relevant kernel module (taken from www.icewalkers.com/linux/howto/bootprompt-howto-8.html):

  • snd-dummy = Dummy soundcard
  • snd-mpu401 = mpu401 UART
  • snd-mtpav = MOTU Midi Timepiece
  • snd-serial = Serial UART 16450/16550 MIDI
  • snd-virmidi = Dummy soundcard for virtual rawmidi devices
  • snd-ad1816a = ADI SoundPort AD1816A
  • snd-ad1848 = Generic driver for AD1848/AD1847/CS4248
  • snd-als100 = Avance Logic ALS100
  • snd-azt2320 = Aztech Systems AZT2320 (and 2316)
  • snd-cmi8330 = C-Media's CMI8330
  • snd-cs4231 = Generic driver for CS4231 chips
  • snd-cs4232 = Generic driver for CS4232 chips
  • snd-cs4236 = Generic driver for CS4235/6/7/8/9 chips
  • snd-dt019x = Diamond Technologies DT-019x
  • snd-es168 = Generic ESS AudioDrive ESx688
  • snd-es18xx = Generic ESS AudioDrive ES18xx
  • snd-gusclassic = Gus classic
  • snd-gusextreme = Gus extreme
  • snd-gusmax = Gus Max
  • snd-interwave = Interwave
  • snd-interwave-stb = Interwave
  • snd-opl3sa2 = Yamaha OPL3SA2
  • snd-opti93x = OPTi 82c93x based cards
  • snd-opti92x-cs4231 = OPTi 82c92x/CS4231
  • snd-opti92x-ad1848 = OPTi 82c92x/AD1848
  • snd-es968 = ESS AudioDrive ES968
  • snd-sb16 = SoundBlaster 16
  • snd-sbawe = SoundBlaster 16 AWE
  • snd-sb8 = Old 8 bit SoundBlaster (1.0, 2.0, Pro)
  • snd-sgalaxy = Sound galaxy
  • snd-wavefront = Wavefront
  • ad1848 = AD1848
  • adlib = Adlib
  • mad16 = MAD16
  • pas2 = ProAudioSpectrum PAS16
  • sb = SoundBlaster
  • uart401 = UART 401 (on card chip)
  • uart6850 = UART 6850 (on card chip)
  • opl3 = Yamaha OPL2/OPL3/OPL4 FM Synthesizer (on card chip)
  • opl3sa = Yamaha OPL3-SA FM Synthesizer (on card chip)
  • opl3sa2 = Yamaha OPL3-SA2/SA3 FM Synthesizer (on card chip)

When you have found the name of the module required, try loading it into the kernel:

foo@bar:~$ sudo modprobe themodule

If there is no error message, it may just be the right one! Run alsamixer to see if there is a sound device for it to configure:

foo@bar:~$ alsamixer

If the module is the wrong one, alsamixer will not allow you to set the sound parameters. If you can, add the module name to the /etc/modules file so that it gets loaded every time you boot:

foo@bar:~$ sudo gedit/etc/modules

My Cardbus Adapter Is Not Being Recognized

If you have a cardbus adapter and are having difficulty getting it work, open a terminal and run this command:

foo@bar:~$ sudo gedit /boot/grub/menu.lst

Find the line ## ## End Default Options ## below which you can see your kernel. As an example:

title          Ubuntu, kernel 2.6.12-10-686-smp
root           (hd0,0)
kernel         /boot/vmlinuz-2.6.12-10-686-smp root=/dev/sda1
                 ro quiet splash
initrd         /boot/initrd.img-2.6.12-10-686-smp

Add this to the end of the third line, one space after splash:

pci=assign-busses

It should now look like this:

title          Ubuntu, kernel 2.6.12-10-686-smp
root           (hd0,0)
kernel         /boot/vmlinuz-2.6.12-10-686-smp root=/dev/sda1
                 ro quiet splash pci=assign-busses
initrd         /boot/initrd.img-2.6.12-10-686-smp

Restart your computer, and your cardbus device should work.

I Plug in My USB Stick and Nothing Happens

When a USB stick is plugged in, it must be mounted before you can access it. This normally happens automatically, and you should see an icon on your desktop similar to that displayed in Figure 6-8.

6_8.jpg

Figure 6-8 To use a USB storage device you just double-click the device icon that appears.

Unfortunately, in some rare cases it doesn't work. To fix it, first check that your system is set to automatically mount USB sticks. Click System > Preferences > Removable Drives and Media and look in the Storage tab. The following checkboxes should be selected:

  • Mount removable drives when hot-plugged
  • Mount removable media when inserted
  • Browse removable media when inserted

When you have selected the boxes, click Close, and try plugging your USB stick in again.

If you still have no luck, plug the USB stick in and then click Places–Computer. If there is an additional drive in the Computer window, right-click it, and select Mount Volume.

If you still have no luck, you need to manually mount the disk. First, click Applications > Accessories > Terminal, and then plug in your USB stick. Now run the following command:

foo@bar:~$ sudo mount -t vfat /dev/sda1 /mnt

To view your files use the file manager to access the /mnt directory. Before you finish with the disk, unmount it with:

foo@bar:~$ umount /dev/sda1

I Copied Some Files to/from My USB Stick, but When I Access It Later the Files Are Not There

When you plug in your USB stick, Ubuntu automatically mounts it. When you copy files to or from the stick, the files are copied over in bursts. Due to the way the kernel in Ubuntu works, sometimes there can be a slight delay before your files copy. If you remove the USB stick before they have finished copying, some or all of the files may not have copied over successfully.

To ensure that everything you do with the USB stick is complete before you remove it, you should unmount it. To do this right-click the Drive icon on your desktop or in Places > Computer, and select Unmount. Give it a few seconds. and when the light on the USB has stopped flashing, you can safely remove it from your computer.

My CD-ROM/DVD Is Not Working

If you are having problems accessing your CD-ROM/DVD drive, it is most likely because it is not mounted. Click Places > Computer and look at the CD-ROM/DVD drive icon in the window. If the drive is not mounted, the icon looks like a drive; otherwise it looks like a disk. If the drive isn't mounted, right-click it, and click Mount Volume.

My CD-ROM/DVD Drive Won't Eject

If you press the eject button on your CD-ROM drive and it won't eject, click Places > Computer, right-click the CD-ROM/DVD drive, and select Eject. If this doesn't work, load up a terminal by clicking Applications > Accessories > Terminal, and type:

foo@bar:~$ eject

I Bought a Device, but It Doesn't Work in Ubuntu

When you buy a hardware device such as a graphics card, sound card, DVD drive, or webcam the device needs to have a driver installed for it to work. In the Windows world this driver is included with the device, and you simply install it after you have plugged the device in.

In the Linux world things work a little differently. Your Ubuntu system includes an important piece of software called the kernel that manages how devices are used. The kernel includes a number of drivers that cover a huge range of hardware out of the box. The philosophy in the Linux world is that you should not even need to install a driver—just install the hardware, and the kernel will pick it up.

Although the kernel includes huge support for devices, there are occasions when a driver is not included. At this point you should find out if the device is actually supported in Ubuntu. To do this, search the Ubuntu forums wiki and do a general search on the Internet for your device and the keyword Linux. After a bit of hunting around you will probably find a driver that is available but obviously was not included with Ubuntu. Your first job should be to submit a bug report to say that the driver is not included in Ubuntu (see It Was Suggested I File a Bug Report but I Don't Know How later in this chapter). Include in your bug report the address of the Web site with the driver.

My Computer Says It Is Out of Memory

If you get memory errors and have a reasonable amount of memory (256MB or more) and a swap partition, your memory may be faulty. To check if your memory is working, restart your computer and when you see GRUB loading, press Escape to display the boot menu. Select the Memtest option, and a small tool will check your memory for errors.

The memtest utility tries its best to find problems with your memory, but there may be cases where memtest passes but the memory still has problems. To test against this, try swapping the memory with some that is known to work and see if the problems go away. If they do, the memory is certainly faulty.

How Can I Copy Photos from My Mobile Phone to My Ubuntu Computer with Bluetooth?

Ubuntu has built-in Bluetooth support, but you need to install the GNOME-Bluetooth package. Inside this package is a small tool called GNOME-obex-server. This application allows you to transfer files from your mobile to your computer.

When you have installed the package, hit Alt+F2, and enter GNOME-obex-server. A small blue icon appears in the notification area, and you can now send a file from your phone via Bluetooth.

I Can Read My USB Storage Device, but I Can't Write to It

If you are having trouble writing to a USB key or external USB hard drive, there are a number of possible causes of the problem.

The first and most simple to diagnose is that you may not have permission to write to the device. When you plug in the drive, right-click the icon that appears on your desktop, and select Properties. In the window that appears, click the Permissions tab and ensure that the Others line has the Write checkbox selected. If this is not selected, you don't have permission to access the drive.

To change these permissions, fire up a terminal, and move to the /media folder:

foo@bar:~$ cd /media

Now take a look at which drives are in there:

foo@bar:~$ ls -al

In the output that appears you should see "usbdisk" as one of the entries. Now change the permissions so everyone can access it:

foo@bar:~$ sudo chmod a+w usbdisk

You should now be able to access the disk.

Filesystem Fun

If you have permissions to access the drive but still can't write to it, the problem is likely to be a filesystem issue. On a storage device such as a floppy disk, USB key, or hard drive, a specific type of filesystem is used to manage how the files are written to the physical disk. Ordinarily, you don't need to worry about this. But when things go wrong, it's time to figure out the details.

There are a number of different filesystems. The default Linux filesystem is ext3. In the Windows world, a few other filesystems are available such as FAT16, FAT32, and the NTFS system used by Windows NT.

Although FAT16 and FAT32 are fully supported in Ubuntu, an NTFS filesystem cannot yet be written to on a Linux computer. However, recent new code has gone in the Linux kernel to write to NTFS with FUSE or a kernel module. This code is still rather experimental and not included in a stock Ubuntu system, so be careful when playing with it.

To find out which filesystem the device uses, run the following command:

foo@bar:~$ sudo mount

In the output, look for the /dev/sda1 or /dev/sdb1 line. USB devices are usually located at either of these locations. You can see the filesystem next to where is says type. As an example, see the following:

/dev/sda1 on /media/usbdisk type ext3 (rw,noexec,nosuid,nodev)

In this example, the filesystem is ext3. You can also add the umask=0000 option if you want to allow any user to read the disk.

If the file system is supported (ext3, VFAT, FAT16, FAT32) but you still can't access the disk, the filesystem may be corrupted. In cases such as this it makes sense to format the disk with a new filesystem.

Before you format your disk, make absolutely sure that you are happy to remove the entire contents of the disk. If you need the files on the disk, have a look around the Internet and post to the Ubuntu forums to see if anyone else can help you before you format the disk. Formatting really is the last option you have available!

How Do I Format a Disk?

When most people think of formatting a disk, they think it is the process of deleting everything on the disk. Formatting a disk actually involves a little bit more, and it completely replaces the filesystem on the disk.

A side benefit to formatting a disk is making the disk work on different computers. Only certain types of filesystems are supported by each OS, and formatting a disk with a common filesystem can ensure that it works with these different OS. As an example, if you format a USB key with the ext3 filesystem, it won't work in Windows. If you use the VFAT filesystem, it will work in both Windows and Linux.

Formatting is fairly simple, and you just need to know the location of the device. USB storage devices (such as USB key rings and key fobs) tend to be located at /dev/sda1 or /dev/sdb1. Make sure that you have the right device, and then use one of the many mkfs commands to create the relevant filesystem. As an example, to create an ext3 filesystem, use the following command:

foo@bar:~$ sudo mkfs.ext3 /dev/sda1

There are a range of other mkfs commands that can be used to create other filesystems:

  • mkfs
  • mkfs.cramfs
  • mkfs.ext2
  • mkfs.ext3
  • mkfs.jfs
  • mkfs.minix
  • mkfs.msdos
  • mkfs.reiser4
  • mkfs.reiserfs
  • mkfs.vfat
  • mkfs.xfs

Each of these commands is used in the same way.

The Keys on My Keyboard Spit Out the Wrong Letters/Symbols

Every keyboard on a computer has a particular keyboard layout and locale attached to it. The keyboard layout specifies how many keyboard keys you have, in what order, and the locale specifies what each key does.

The locale is particularly important as letters and symbols vary dramatically in different locales. Aside from different types of letters, common symbols are often placed in different areas. As an example, on some keyboards the double quote (") is on the key above the right shift key. On some keyboards it is Shift+2. Having the wrong keyboard settings can be incredibly frustrating, and if the symbols printed on your keys don't match up to the symbol that spits out when you press it, your keyboard settings are incorrect.

To fix this click System > Preferences > Keyboard. Click the Layouts tab, and next to the Keyboard model box click the... button to select your keyboard model if you know it. If you don't know it, use the default setting. Now click the Add button, and resize the window so you can see the keyboard layout diagram more easily. Choose a different locale that matches your keyboard, and then click OK.

Now click on the Keyboard tab, and use the Type to Test Settings box to test if your keyboard settings are correct.

My Serial Mouse Is Not Working

To get a non-USB serial mouse working, first run this command:

foo@bar:~$ sudo dpkg-reconfigure xserver-xorg

When asked for the mouse device, select /dev/ttys0 for COM1 or /dev/ttys1 for COM2.

My Mouse Scroll Wheel Does Not Work

To enable your scroll wheel, you need to run the X configuration program:

foo@bar:~$ sudo dpkg-reconfigure xserver-xorg

One of the questions asks if you would like to enable the scroll wheel. Enable this, and then restart your desktop. Your lovely little scroll wheel should work now.

My Remote Control Doesn't Work

If you want to use a remote control with your Ubuntu computer, you need to install the Linux Infra Red Control (LIRC) package in Synaptic. LIRC is the library, and it supports a wide range of remote-control units.

The first step is to determine which LIRC driver is required for your particular remote control. Take a look at the list of remotes on the LIRC site at www.lirc.org/ or use your favorite search engine if it is not listed on the site. LIRC includes a number of built-in drivers, and you can see which ones are included by running the following command:

foo@bar:~$ lircd –driver=help

When you know which driver is required and you know your installed LIRC supports, you can edit the hardware.conf file in the /etc/lirc file to configure which one is used. Simply set the DRIVER line to the driver you selected. With this complete, restart LIRC:

foo@bar:~$ /etc/init.d/lirc restart

With LIRC ready and running, you can test it by running the following command:

foo@bar:~$ /etc/init.d/lirc restart

When you press the buttons on your remote control, a code should appear. This code can be mapped to a button on your remote by editing the lircd.conf file in /etc/lirc. For specific configuration details, see the LIRC Web site.

How Do I Find Out Which Hardware Works in Ubuntu before I Purchase It?

Currently, there is no centralized device database to search for hardware that works with Ubuntu, although work is going on to support this in a future version of Ubuntu.

A good place to start is to look at https://wiki.ubuntu.com/hardware support. You should then search the discussion forums and use Google to find out if anyone else has used it. Although not an ideal way of digging out the information, the forums and Google are likely to give you the information you need until the full device database is complete.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020