Friday, October 15, 2010

Refurbishing : Getting system specs from a Linux machine

We rebuild and sell a lot of used Ubuntu GNU/Linux machines. Linux is a great option for us and for our clients because of: a) Licensing, b) Software Freedom, c) Cost, d) Ease of installation / drivers. Over the years a number of volunteers have come in and learned how much simpler Ubuntu GNU/Linux is to install than other proprietary operating systems (even with a fair amount of automation that we do - Unattended installs that grab a lot of the required Windows drivers from one of our servers). One of the things we hadn't done so well is use open source to "spec" systems, but that's all about to change.

Some of our more experienced volunteers have in the past used commands like:

cat /proc/cpuinfo | more
cat/proc/meminfo | more
df -hH

The first command grabs CPU information. The second command displays memory info. The last command displays information about partitions on the hard drive (giving a rough idea of the size of the drive). These are great commands, but much of this information can actually be replaced by one command:

sudo lshw -html > ~/Desktop/myhardware.html







Breaking down the command, lshw probes the hardware (which you should do as root, thus the sudo). The -html switch tells lshw to output to html. lshw can take a -xml switch to output to xml. We prefer html at the moment. The > redirects the output to a file called myhardware.html which is created on the system's desktop.


The resulting myhardware.html file can then be opened with Firefox or Chromium. The following is an example from a dual boot machine I use regularly. I have bolded information we actually use in the shop.


66bf-charlesm-ubuntu
    description: Mini Tower Computer
    product: HP d530 CMT(DG769A)
    vendor: Hewlett-Packard
    serial: CAC40101D6
    width: 32 bits
    capabilities: smbios-2.3 dmi-2.3 smp-1.4 smp
    configuration: boot=normal chassis=mini-tower cpus=1 uuid=5514BF93-AA2F-D811-BBD8-7F28EBD2000E
  *-core
       description: Motherboard
       product: 085Ch
       vendor: Hewlett-Packard
       physical id: 0
       serial: CAC40101D6
     *-firmware
          description: BIOS
          vendor: Hewlett-Packard
          physical id: 1
          version: 786B2 v1.11 (07/10/2003)
          size: 128KiB
          capacity: 448KiB
          capabilities: pci pnp upgrade shadowing cdboot bootselect edd int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int5printscreen int9keyboard int14serial int17printer acpi usb agp ls120boot zipboot biosbootspecification netboot
     *-cpu
          description: CPU
          product: Intel(R) Pentium(R) 4 CPU 2.66GHz
          vendor: Intel Corp.
          physical id: 5
          bus info: cpu@0
          version: 15.2.9
          slot: XU1 PROCESSOR
          size: 2666MHz
          capacity: 3200MHz
          width: 32 bits
          clock: 533MHz
          capabilities: boot fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe up pebs bts cid xtpr
          configuration: id=0
        *-cache:0
             description: L1 cache
             physical id: 6
             slot: Internal L1 Cache
             size: 8KiB
             capacity: 20KiB
             capabilities: burst internal write-back data
        *-cache:1
             description: L2 cache
             physical id: 7
             slot: Cache L2
             size: 512KiB
             capacity: 4MiB
             capabilities: burst internal write-back data
     *-memory:0
          description: System Memory
          physical id: 27
          slot: System board or motherboard
        *-bank:0
             description: DIMM DDR Synchronous [empty]
             vendor: JEDEC ID:
             physical id: 0
             slot: DIMM1
        *-bank:1
             description: DIMM DDR Synchronous 266 MHz (3.8 ns)
             product: K
             vendor: JEDEC ID:7F 98 00 00 00 00 00 00
             physical id: 1
             serial: F0712C6C
             slot: DIMM2
             size: 1GiB
             width: 64 bits
             clock: 266MHz (3.8ns)
        *-bank:2
             description: DIMM DDR Synchronous [empty]
             vendor: JEDEC ID:
             physical id: 2
             slot: DIMM3
        *-bank:3
             description: DIMM DDR Synchronous 266 MHz (3.8 ns)
             product: K
             vendor: JEDEC ID:7F 98 00 00 00 00 00 00
             physical id: 3
             serial: F0612C6E
             slot: DIMM4
             size: 1GiB
             width: 64 bits
             clock: 266MHz (3.8ns)
     *-memory:1 UNCLAIMED
          description: Flash Memory
          physical id: 28
          slot: System board or motherboard
          capacity: 512KiB
        *-bank UNCLAIMED
             description: Chip FLASH Non-volatile
             physical id: 0
             slot: SYSTEM ROM
             size: 512KiB
             width: 4 bits
     *-memory:2 UNCLAIMED
          physical id: 0
     *-memory:3 UNCLAIMED
          physical id: 2
     *-pci
          description: Host bridge
          product: 82865G/PE/P DRAM Controller/Host-Hub Interface
          vendor: Intel Corporation
          physical id: 100
          bus info: pci@0000:00:00.0
          version: 02
          width: 32 bits
          clock: 33MHz
          configuration: driver=agpgart-intel
          resources: irq:0 memory:ec000000-efffffff
        *-pci:0
             description: PCI bridge
             product: 82865G/PE/P PCI to AGP Controller
             vendor: Intel Corporation
             physical id: 1
             bus info: pci@0000:00:01.0
             version: 02
             width: 32 bits
             clock: 66MHz
             capabilities: pci normal_decode bus_master
             resources: memory:f9000000-fa1fffff memory:f0000000-f81fffff
           *-display
                description: VGA compatible controller
                product: NV34 [GeForce FX 5200]
                vendor: nVidia Corporation
                physical id: 0
                bus info: pci@0000:01:00.0
                version: a1
                width: 32 bits
                clock: 66MHz
                capabilities: pm agp agp-3.0 vga_controller bus_master cap_list rom
                configuration: driver=nvidia latency=248 maxlatency=1 mingnt=5
                resources: irq:18 memory:f9000000-f9ffffff memory:f0000000-f7ffffff memory:f8000000-f801ffff
        *-generic UNCLAIMED
             description: System peripheral
             product: 82865G/PE/P Processor to I/O Memory Interface
             vendor: Intel Corporation
             physical id: 6
             bus info: pci@0000:00:06.0
             version: 02
             width: 32 bits
             clock: 33MHz
             configuration: latency=0
             resources: memory:fecf0000-fecf0fff
        *-usb:0
             description: USB Controller
             product: 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1
             vendor: Intel Corporation
             physical id: 1d
             bus info: pci@0000:00:1d.0
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: uhci bus_master
             configuration: driver=uhci_hcd latency=0
             resources: irq:16 ioport:1440(size=32)
        *-usb:1
             description: USB Controller
             product: 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2
             vendor: Intel Corporation
             physical id: 1d.1
             bus info: pci@0000:00:1d.1
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: uhci bus_master
             configuration: driver=uhci_hcd latency=0
             resources: irq:19 ioport:1460(size=32)
        *-usb:2
             description: USB Controller
             product: 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3
             vendor: Intel Corporation
             physical id: 1d.2
             bus info: pci@0000:00:1d.2
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: uhci bus_master
             configuration: driver=uhci_hcd latency=0
             resources: irq:18 ioport:1480(size=32)
        *-usb:3
             description: USB Controller
             product: 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller
             vendor: Intel Corporation
             physical id: 1d.7
             bus info: pci@0000:00:1d.7
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: pm debug ehci bus_master cap_list
             configuration: driver=ehci_hcd latency=0
             resources: irq:23 memory:f8500000-f85003ff
        *-pci:1
             description: PCI bridge
             product: 82801 PCI Bridge
             vendor: Intel Corporation
             physical id: 1e
             bus info: pci@0000:00:1e.0
             version: c2
             width: 32 bits
             clock: 33MHz
             capabilities: pci normal_decode bus_master
             resources: memory:f8200000-f84fffff
           *-network
                description: Ethernet interface
                product: NetXtreme BCM5782 Gigabit Ethernet
                vendor: Broadcom Corporation
                physical id: 2
                bus info: pci@0000:05:02.0
                logical name: eth0
                version: 03
                serial: 00:0e:7f:28:eb:d2
                size: 100MB/s
                capacity: 1GB/s
                width: 64 bits
                clock: 66MHz
                capabilities: pm vpd msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
                configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.110 duplex=full firmware=5782-v3.13 ip=192.168.1.35 latency=64 link=yes mingnt=64 multicast=yes port=twisted pair speed=100MB/s
                resources: irq:20 memory:f8400000-f840ffff
        *-isa
             description: ISA bridge
             product: 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge
             vendor: Intel Corporation
             physical id: 1f
             bus info: pci@0000:00:1f.0
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: isa bus_master
             configuration: latency=0
        *-ide:0
             description: IDE interface
             product: 82801EB/ER (ICH5/ICH5R) IDE Controller
             vendor: Intel Corporation
             physical id: 1f.1
             bus info: pci@0000:00:1f.1
             logical name: scsi0
             logical name: scsi1
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: ide bus_master emulated
             configuration: driver=ata_piix latency=0
             resources: irq:18 ioport:1f0(size=8) ioport:3f6 ioport:170(size=8) ioport:376 ioport:14c0(size=16) memory:80100000-801003ff
           *-disk
                description: ATA Disk
                product: WDC WD2500BB-55R
                vendor: Western Digital
                physical id: 0.0.0
                bus info: scsi@0:0.0.0
                logical name: /dev/sda
                version: 20.0
                serial: WD-WCANKF087680
                size: 232GiB (250GB)
                capabilities: partitioned partitioned:dos
                configuration: ansiversion=5 signature=9cec9cec
              *-volume:0
                   description: Windows NTFS volume
                   physical id: 1
                   bus info: scsi@0:0.0.0,1
                   logical name: /dev/sda1
                   version: 3.1
                   serial: 509d82ba-6961-d844-a189-1e1ebb52865c
                   size: 116GiB
                   capacity: 116GiB
                   capabilities: primary bootable ntfs initialized
                   configuration: clustersize=4096 created=2009-04-09 12:05:53 filesystem=ntfs modified_by_chkdsk=true mounted_on_nt4=true resize_log_file=true state=dirty upgrade_on_mount=true
              *-volume:1
                   description: Extended partition
                   physical id: 2
                   bus info: scsi@0:0.0.0,2
                   logical name: /dev/sda2
                   size: 116GiB
                   capacity: 116GiB
                   capabilities: primary extended partitioned partitioned:extended
                 *-logicalvolume:0
                      description: Linux filesystem partition
                      physical id: 5
                      logical name: /dev/sda5
                      logical name: /
                      capacity: 111GiB
                      configuration: mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro,barrier=1,data=ordered state=mounted
                 *-logicalvolume:1
                      description: Linux swap / Solaris partition
                      physical id: 6
                      logical name: /dev/sda6
                      capacity: 4872MiB
                      capabilities: nofs
           *-cdrom
                description: DVD-RAM writer
                product: DVD-RAM GH22LP20
                vendor: HL-DT-ST
                physical id: 0.1.0
                bus info: scsi@1:0.1.0
                logical name: /dev/cdrom
                logical name: /dev/cdrw
                logical name: /dev/dvd
                logical name: /dev/dvdrw
                logical name: /dev/scd0
                logical name: /dev/sr0
                version: 1.02
                capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
                configuration: ansiversion=5 status=nodisc
        *-ide:1
             description: IDE interface
             product: 82801EB (ICH5) SATA Controller
             vendor: Intel Corporation
             physical id: 1f.2
             bus info: pci@0000:00:1f.2
             version: 02
             width: 32 bits
             clock: 66MHz
             capabilities: ide bus_master
             configuration: driver=ata_piix latency=0
             resources: irq:18 ioport:14f0(size=8) ioport:1808(size=4) ioport:14f8(size=8) ioport:180c(size=4) ioport:14d0(size=16)
        *-serial UNCLAIMED
             description: SMBus
             product: 82801EB/ER (ICH5/ICH5R) SMBus Controller
             vendor: Intel Corporation
             physical id: 1f.3
             bus info: pci@0000:00:1f.3
             version: 02
             width: 32 bits
             clock: 33MHz
             configuration: latency=0
             resources: ioport:fc00(size=32)
        *-multimedia
             description: Multimedia audio controller
             product: 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller
             vendor: Intel Corporation
             physical id: 1f.5
             bus info: pci@0000:00:1f.5
             version: 02
             width: 32 bits
             clock: 33MHz
             capabilities: pm bus_master cap_list
             configuration: driver=Intel ICH latency=0
             resources: irq:17 ioport:1000(size=256) ioport:1400(size=64) memory:f8500400-f85005ff memory:f8500600-f85006ff

Because we have volunteers with varying skill levels (some never build systems) this amount of information can be a bit intimidating, but it provides some of our more experienced volunteers with good information. For example, the machine above has memory in slots 1 and 3, 0 and 2 would have been better. Also the memory is 266MHz when the board is capable of running 400MHz DDR SDRAM. And while the CPU is a speed 2666MHz, it could be upgraded to a 3200MHz CPU.

In the past we've tried tools like sysinfolabs' ASTRA, a great tool, but the trial version we tried has misinformed us on a couple of pieces of hardware (video cards in particular). Ultimately we love open source / GNU software and prefer to use free software tools whenever possible.

No comments:

Post a Comment