hardwareDB

* jcastro a changé le sujet en : Ubuntu Open Week | Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | How to ask questions: https://wiki.ubuntu.com/UbuntuOpenWeek/Rules | Ask questions in #ubuntu-classroom-chat, prefaced with "QUESTION:" |See https://wiki.ubuntu.com/UbuntuOpenWeek/JoiningIn to filter out channel noise | "Hardware Debugging and Diagnostics" - Michael Anderson
<nosrednaekim> hello everyone
<nosrednaekim> My name is Michael Anderson, aka, nosrednaekim (extra points to those who can figure out what that stands for)
<nosrednaekim> I have been doing community support in #kubuntu (and now #kubuntu-kde4) ever since the release of edgy, so about 2 years.
<nosrednaekim> While I do work on the occasional app or bug for Kubuntu, I normally do just user support.
<nosrednaekim> At least half of the probems in user support deal with getting hardware functioning (its not called "hard" for nothing).
<nosrednaekim> In this session, we will deal with some simple command line applications to:
<nosrednaekim> *determine hardware configurations and associated drivers
<nosrednaekim> manipulating common hardware components
<nosrednaekim>  such as wireless cards, sound chips, and storage devices.
<nosrednaekim> Why not graphical applications to do these tasks you may ask?
<nosrednaekim> 1) the output of graphical applications is hard to communicate via any text means (forums, IRC)
<nosrednaekim> 2) command line output is usually far more informative and easily searchable with grep as well (more on that later)
<nosrednaekim> 3) a graphical tool is mot much use when you are trying to fix your video card drivers
<nosrednaekim> This information should be invaluable to you if you are either thinking of doing user support, or commonly do installs
<nosrednaekim> on different hardware configurations.
<nosrednaekim> So first, some commands to determine what your hardware devices are:
<nosrednaekim> (if I'm going to fast... someone yell at me in chat)
<nosrednaekim> There are three very useful command for this purpose -- lshw, lspci and lsusb.
<nosrednaekim> Everyone run lspci in a terminal/console. your output should look something like this:
<nosrednaekim> ....
<nosrednaekim> 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
<nosrednaekim> 01:05.0 VGA compatible controller: ATI Technologies Inc RS485 [Radeon Xpress 1100 IGP]
<nosrednaekim> 08:01.0 CardBus bridge: ENE Technology Inc CB-712/4 Cardbus Controller (rev 10))
<nosrednaekim> 08:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
<nosrednaekim> 08:04.0 Ethernet controller: Atheros Communications Inc. AR2413 802.11bg NIC (rev 01)
<nosrednaekim> ...
<nosrednaekim> As you can see, I have a not-so-nice ATI card on PCI bus 1:5.0
<nosrednaekim> Why is this important? Well, the PCID is a
<nosrednaekim> very crucial part of the "Device" section of the many xorg.conf configurations, allowing you to differentiate between multiple video cards in the same configuration file.
<nosrednaekim> A host of other information can be gleaned from this output such as exact model numbers for hardware components to google with.
<nosrednaekim> Next command is "lsusb". Everyone can run that too if you want. My output is:
<nosrednaekim> Bus 002 Device 001: ID 0000:0000
<nosrednaekim> Bus 001 Device 003: ID 05e1:0b02 Syntek Semiconductor Co., Ltd
<nosrednaekim> Bus 001 Device 001: ID 0000:0000
<nosrednaekim> ...
<nosrednaekim> Not really exciting since this is a laptop and the only thing I have attached right now is a webcam i'm trying to fight to get working (yes, I have hardware troubles too)
<nosrednaekim> Printers and fancy(USB) keybaords will show up here too.
<nosrednaekim> ...
<nosrednaekim> Onwards! to lshw, the most powerful command of them all.
<nosrednaekim> lshw is best run with sudo, since that gives you alot more information.
<nosrednaekim> Everyone can run "sudo lshw" if you want.
<nosrednaekim> As you can tell, it takes a bit longer and generates quite a bit more information than lspci.
<nosrednaekim> Here, you can find good information on everything from your BIOS version to what driver your wireless card is using.
<nosrednaekim> Lets run through one of these sections and see what information is included.
<nosrednaekim> ....
<nosrednaekim> *-multimedia
<nosrednaekim>              description: Audio device
<nosrednaekim>              product: IXP SB4x0 High Definition Audio Controller
<nosrednaekim>              vendor: ATI Technologies Inc
<nosrednaekim>              physical id: 14.2
<nosrednaekim>              bus info: pci@0000:00:14.2
<nosrednaekim>              version: 01
<nosrednaekim>              width: 64 bits
<nosrednaekim>              clock: 33MHz
<nosrednaekim>              capabilities: pm msi bus_master cap_list
<nosrednaekim>              configuration: driver=HDA Intel latency=64 module=snd_hda_intel
<nosrednaekim> ...
<nosrednaekim> This tells us alot of information we already knew from lspci.
<nosrednaekim> It also gives us another very crucial piece of information: the driver and kernel module for the device.
<nosrednaekim> The module can be used along with rmmod to very effectively disable this piece of hardware or "free it up" for a new driver.
<nosrednaekim> for instance, here I would run "sudo rmmod snd_hda_intel"
<nosrednaekim> If you want to permanantly disable this module/device, you can place a reference to the module in /etc/modprobe.d/blacklist with
<nosrednaekim> 'echo "blacklist modulename" | sudo tee -a /etc/modprobe.d/blacklist '
<nosrednaekim> or manually editing that file
<nosrednaekim> Ok, lets have a +1 fromeveryone who is keeping up
<nosrednaekim> in #ubuntu-classroo-chat of course
<nosrednaekim> *classroom
<nosrednaekim> ok, great!
<nosrednaekim> Finally, a related command to this is "lsmod" which lists the loaded kernel modules.
<nosrednaekim> In conclusion, you can "pipe" any of these commands though grep -i (-i makes the search case insensitive) to search for just what you want.
<nosrednaekim> For example: "lspci | grep -i ethernet" will return:
<nosrednaekim> ...
<nosrednaekim> 08:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
<nosrednaekim> 08:04.0 Ethernet controller: Atheros Communications Inc. AR2413 802.11bg NIC (rev 01)
<nosrednaekim> ...
<nosrednaekim> Thats on my computer of course.
<nosrednaekim> This is especially useful for IRC support where a pastebin would waste time when you only need one line.
<nosrednaekim> ...
<nosrednaekim> The next command we are going to explore is "dmesg"
<nosrednaekim> Dmesg prints out the errors and status messages from the kernel as stored in /var/log/messages.
<nosrednaekim> Dmesg output is useful for seeing the /dev location of newly attached removeable disks, and for many other things such as module loading errors.
<nosrednaekim> Normally, when you run dmesg, only the last 50 lines or so are useful for the purpose, so you may want to pipe the output through tail, or only paste that many lines.
<nosrednaekim> Now, lets move onto some diagnostics for pieces of hardware that commonly have "issues" within Ubuntu: wireless and sound.
<nosrednaekim> As many of you may know, Wireless is an especially finicky piece of hardware and the NetworkManager does not always work either.
<nosrednaekim> Iwconfig is the most powerful command for wireless diagnostics. If you have wireless, go ahead and run that.
<nosrednaekim> th0      IEEE 802.11g  ESSID:"OpenWRT"
<nosrednaekim>           Mode:Managed  Frequency:2.437 GHz  Access Point: FE:ED:FA:CE:DB:EE:F
<nosrednaekim>           Bit Rate=54 Mb/s
<nosrednaekim>           Power Management:off
<nosrednaekim>           Link Quality:48/100  Signal level:-65 dBm  Noise level:-96 dBm
<nosrednaekim>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
<nosrednaekim>           Tx excessive retries:1330  Invalid misc:5687   Missed beacon:0
<nosrednaekim> ....
<nosrednaekim> thats my output
<nosrednaekim> From this we can the following useful information:
<nosrednaekim> *can gather
<nosrednaekim> * the protocol of the card (IEEE 802.11x), if your card is in b mode, it could explain why you are getting slower speeds.
<nosrednaekim> * the mode, this should almost always be Managed, unless you are doing somthing special
<nosrednaekim> * Number of Errors for different reasons, these can tell you if your antennae is not on, or if you are
<nosrednaekim>   not correctly connected to your wireless AP (the error numbers in ifconfig are equally useful for this)
<nosrednaekim> You can also change any of these values (except the errors) with the iwconfig command (probably requiring sudo)
<nosrednaekim> Run "man iwconfig" to see how each of these (and others) can be changed (but not now since its a fairly long document)
<nosrednaekim> The next useful wireless command is "iwlist <devicename> scan"
<nosrednaekim> <devicename> is the logical name of the device seen on iwconfig, ath0 for myself
<nosrednaekim> This should give a list of AP's, their ESSID and any encryption they may have.
<nosrednaekim> Again, this information may be in the NetworkManager, but the text is both more informative and ALWAYS available
<nosrednaekim> ...
<nosrednaekim> Ok! thats it for networking!
<nosrednaekim> Next, lets do some hard drive diagnostics.
<nosrednaekim> Here will will have a nice speed contest, so stop watching those movies and playing those games and let your hard drive be dedicated to this benchmark (and your eyes to my talk!!!!)
<nosrednaekim> run "sudo hdparm -t /dev/hda" or whatever logical drive name you have, maybe /dev/sda
<nosrednaekim> When its finished, paste the MB/sec measurement in -chat, and we'll see who has teh l33test computer :)
<nosrednaekim> ok! thank you... as you can see, there is quite a range
<nosrednaekim> and I would bet that gscholz has a 4200RPM drive with that number...
<nosrednaekim> if you are getting numbers below 10, its not good, and could cause things to run very slowly
<nosrednaekim> ok, so that will tell you if a computer might be possibly be performing poorly because of a slow, or under utilized disc
<nosrednaekim> hdparm can tell you alot more stuff about your disc, as well as perform some --many potentially dangerous -- performance enhancments
<nosrednaekim> I just heard all the ricers listening to this talk suddenly become very interested,So
<nosrednaekim> if you are the ricer type, please do read the man page first :)
<nosrednaekim> ...
<nosrednaekim> Next, is the command "smartctl" for reading the SMART information for your hard drive.
<nosrednaekim> you can install it with "sudo apt-get install smartmontools" and execute it with "sudo smartctl --all /dev/hda"
<nosrednaekim> of course, changin /dev/hda for your device name
<nosrednaekim> Note... if your load count is over 100,000 and you have had your computer for a year or less, you may have the
<nosrednaekim> infamous power-management bug which could potentially drastically shorten the life of your drive.
<nosrednaekim> Ok, everyone done with that?
<nosrednaekim> ...
<nosrednaekim> SOUND!
<nosrednaekim> lets have a -1 from everyone who has had a problem with this essential function.
<nosrednaekim> I'm not very good at sound since it has always Just Worked(tm) for me, and I mostly only have experiece with commands I personally use.
<nosrednaekim> However, there is one command that is vital for sound debugging that I have been told about, and that is "alsa-info.sh."
<nosrednaekim> you can get it with "wget  http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh"
<nosrednaekim> (there is a wiki page for sound troubleshooting here as well where you can get this information https://wiki.ubuntu.com/DebuggingSoundProblems )
<nosrednaekim> execute this command with "./alsa-info.sh --no-upload"
<nosrednaekim> Include the output of this in your bug report/forum post for better reponses (I personally have no clue about what it all means, so don't talk ot me about it :P
<nosrednaekim> crimsun, you about?
<nosrednaekim> I guess not.... progfou I can take questions now
<progfou> <gscholz> QUESTION: What do the numbers in brackets mean ie [  320.656000] (dmesg output)?
<nosrednaekim> gscholz: that is the "kernel time" in seconds since boot
<nosrednaekim> next?
<progfou> <xxxYURAxxx> QUESTION: how to get rid of the problem sr0 device?  i am don install new version ubuntu because of this problem
<nosrednaekim> I am not aware of that issue or how to fix it, sorry :(
<nosrednaekim> next
<progfou> (no other question so far)
<nosrednaekim> <gscholz>QUESTION: What does that tell me (load cycle)? How to repare?
<nosrednaekim> gsholz, no, it simply tells you that you have an alot of on/off cycles, which depending on the age of the drive, can be very bad
<nosrednaekim> A word about what you should include when you make a forum post about certain issues
<nosrednaekim> VIDEO/X problems -- always include your /etc/X11/xorg.conf, the output of "lspci | grep -i Vesa" and the contents of "/var/log/Xorg.0.log"
<nosrednaekim> <rodolfo> QUESTION: What if my HDD has a load cycle count over 100K? Is there a script/patch to get around this?
<nosrednaekim> if you have a laptop, yes, there is a powermanagement patch to lessen this
<progfou> <DoruHush> QUESTION: There are plans when (if ever) to include into the Ubuntu distro an application with human interface (GUI) to analyze and configure hardware problems regarding network devices drivers, sound drivers, tvtuner devices?
<nosrednaekim> rodolfo: here https://launchpad.net/bug59695.html
<nosrednaekim> DoruHush: I am not aware of what Ubuntu has in that regard, but I know Kubuntu(KDE) includes such a app by default
<nosrednaekim> DoruHush: the ouput is akin to lshw, so you can't exactly fix things within it though
<nosrednaekim> DoruHush: such a application would be very nice though, yes.
<nosrednaekim> OK, I hope this session has helped you debug hardware problems better
<nosrednaekim> many of the commands I listed have more options, so "man programname" will help you hone your detection skills even better
<nosrednaekim> Thank you all for coming out today (and to OpenWeek in general since this is the last general session)!
<jcastro> thanks Michael!
<jcastro> ok, that was the last session, thanks everyone for coming!
<jcastro> and especially to our speakers for giving up their saturday!

MeetingLogs/openweekhardy/hardwareDB (last edited 2008-08-06 16:15:51 by localhost)