Share |

1.4 Reading information about your PC (dmesg, /proc/partitions)

Let 's summarize a little what 's already been said and look at reading info on your computer.

-/proc

Standard Linux always has a filesystem called "proc", which is a virtual filesystem in which files reside that have to do with your hardware and running processes. It 's a wonderful invention. We already talked about /proc/partitions, which is a file containing all local disk partitions.

Another interesting file is /proc/cpuinfo, which gives you information about your CPUs

/proc/meminfo gives you information about the memory usage. Don 't let yourself get misled by the Memfree line, which will always look very low. Actually, Linux always reserves most part of the memory so it can make use of it in a fast way. What you need to look at is the Active and Inactive. The maximum amount of memory you will see will never be more than 4Gb, since the TRK kernel needs to keep maximum compatibility

Another useful file to read info on your cdrom drive is /proc/sys/dev/cdrom/info.

Those are about the important files in /proc you need to know about now.

-dmesg

The command "dmesg" gives you your kernel messages. Any hardware detected will give you a message somewhere in the output of this command. If you want to know the type of network card that has been detected, perform 'dmesg|more' and look for any mentions of eth0, eth1,...

What type of harddisk controller you have: dmesg. Just use it when you find yourself stuck on hardware questions. Also disk failures will be visible with this command. Network errors, link down, etc, one command.

Another way of looking at this information is through /var/log/messages (more /var/log/messages), which on normal Linux distributions contain output logs of previous boots too.

To know what device your newly inserted USB stick has, plug it in, let it settle for a few seconds and then run dmesg again. Or just run 'dmesg|tail' to see only the last added lines.
Here 's an excerpt of what you might read from dmesg. It tells you something about your network card:
eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/eepro100.html
eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin < > and others
ACPI: PCI Interrupt 0000:05:08.0[A] -> GSI 20 (level, low) -> IRQ 16
eth0: OEM i82557/i82558 10/100 Ethernet, 00:08:02:C6:4E:9D, IRQ 16.
Board assembly 262285-001, Physical connectors present: RJ45
Primary interface chip i82555 PHY #1.
General self-test: passed.
Serial sub-system self-test: passed.
Internal registers self-test: passed.
ROM checksum self-test: passed (0x04f4518b).


-lspci and lsusb

This gives you any information on what 's on your PCI and respectively USB bus. This doesn 't only mean what 's in your PCI slots, but everything on the bus, so also onboard ethernet and usb controllers.

-lshw

Now here 's a great utility that can give you a complete listing of all your hardware, recognised and not recognised. When you run it, it will give you a LOT of output, so best here is to run it 'lshw | more', or if you only need specific info about f.i. disk drives, you can run 'lshw -C DISK'. Getting the info off your TRK can be done directly to the interweb (provided your network card got detected) by running 'lshw | wgetpaste', which will publish the output on http://pastebin.ca and return you a short url to where it can be found.


-smartctl

The smartmontools are part of Trinity Rescue Kit and not so common on normal Linux systems, yet they are a valuable addition to any system. What it does is read the s.m.a.r.t. information of disk drives so you can know when errors start to occur.

Just use it like this: 'smartctl -a /dev/sda' where sda is your first scsi or sata drive. Make sure smart is enabled in the computer's bios.

-acpi and acpitool

Two tools to read the battery and thermal information of your computer. Type acpi --help to get more info on possible options.

acpitool can give you much more information like fan speeds and cpu. Also certain laptop types are supported for their special features like brigthness on Asus laptops etc...

-df and du

Two standard utils provided in Linux. df shows you the usage of your mounted filesystems, du shows you the usage of a specific folder. Use it like 'df -h' and 'du -h' where "-h" stands for "human readable", making the output rounded to mega- and gigabytes.
This is in short how you can get to know your computer a little and how to jumpstart using Linux and Trinity Rescue Kit.

-lshw

Recently recommended and added, but looks very promising, lshw gives you a complete list of all your hardware in your computer. Best to pipe this to a file, because the list can get long.

 

Updated: August 12, 2010