Skip to main content

lsscsi and systool


The lspci and lsusb commands are familiar to me, but lsscsi was unfamiliar. Written by Doug Gilbert, it provides information about SCSI devices by scanning the sysfs pseudo file system. The author maintained a web page (now defunct) that provided useful information about lsscsi, including some detailed descriptions of the SCSI subsystem information available. Fortunately, a copy resides here. Here's a sample listing from my system That also shows the generic SCSI device names (note that command can be run as a regular user) :

$ lsscsi -g
[0:0:0:0] disk ATA ST3250624A 3.AA /dev/sda /dev/sg0
[0:0:1:0] disk ATA Maxtor 6L200P0 BAH4 /dev/sdb /dev/sg1

[1:0:0:0] disk ATA Maxtor 6Y250P0 YAR4 /dev/sdc /dev/sg2

[1:0:1:0] cd/dvd HL-DT-ST DVD-RAM GH22LP20 1.02 /dev/sr0 /dev/sg3
[2:0:0:0] disk Seagate FreeAgent 102D /dev/sdd /dev/sg5
[3:0:0:0] cd/dvd SONY DVD RW DRU-810A 1.0a /dev/sr1 /dev/sg4
[4:0:0:0] disk ST910082 4AS 0000 /dev/sde /dev/sg6


The systool has been around for a while and has a Website. It's a utility developed for the sysfs virtual filesystem used since Linux kernel 2.5. The project's overall goal is to develop diagnostic tools for Linux and the site has several examples.

One use of systool is to reveal what option settings have been applied to kernel modules . For example, to see information about the libata module (note that it too can be run by a regular user):

$ systool -a -v -m libata
Module = "libata"
Attributes:
initstate = "live"
refcnt = "3"

srcversion = "9BD5A7BE268657853F9CEF1"
version = "3.00"
Parameters:

acpi_gtf_filter = "7"

allow_tpm = "0"

ata_probe_timeout = "0"
atapi_dmadir = "0"

atapi_enabled = "1"

atapi_passthru16 = "1"

dma = "7"

fua = "0"

ignore_hpa = "0"

noacpi = "0"


Sadly, many of these options are not well documented, even in the source code. Even when some comments exist, they are cryptic and could use a decent reference. For example, the allow_tpm option is described with modinfo only to the extent that it can be enabled or disable. There is some discussion of it in the source code, but WTF is it? It appears to be an acronym for Trusted Platform Module, part of software developed by TCG (the Trusted Computing Group). A TPM is a microcontroller on a motherboard used to store keys, passwords and digital certificates, i.e. a hardware-based security device. Why do Linux users care? It seems that a bit in the ATA identify data was re-assigned to TCG and could cause a serious problem for the Linux libata driver since a TGC-enabled drive would trigger 32bit I/O on some systems. Alan Cox submitted a patch to "fix" this by dis-allowing this bit on TCG-enabled drives, causing the system to "opt out" of complying with TCG "security/DRM" features. It does alert the user that they may not have full use of the device. It also was necessary to implement this feature because manufacturers of Linux-run devices may legitimately choose to implement DRM in their devices. Some module options for libata are set from the kernel command line (see kernel-options.txt in the kernel source Documentation). There's also a libATA FAQ which includes info on "Intel combined mode" explaining why your drives are accessed at wrong/different speeds and how to fix that (try combined_mode=libata on the kernel command line).

Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Return to Castle Wolfenstein for Modern Linux

Return to Castle Wolfenstein is a first-person shooter originally released on November 19, 2001. The game, like many other classic games, is available at GOG.com and costs only US$5.99. iortcw for Linux Don't bother with old and crusty Linux binaries offered by idsoft; they are problematic and it's painful to use them on a modern Linux. Fortunately for us, there are more modern GPL-licensed Linux binaries available for 32- and 64-bit systems as well as high resolution textures packages. The project at GitHub provides source code that can also be compiled for MS Windows using MinGW. iortcw for Windows and Mac You can download pre-compiled binaries for 32- and 64-bit Linux, MS Windows and Mac from here . Let's put our files in /usr/local/games/rtcw . As root, extract the downloaded .ZIP file for your architecture to  /usr/local/games/rtcw . All we are missing are the game data files. I purchased them from GOG.com. The game installer downloaded from GOG.com can be ...

Unreal Tournament GOTY/UT99 for Modern Linux

Released on November 16, 1999, Unreal Tournament (also known as UT99) is an arena first-person shooter for Multiplayer on-line competition or you can play against bots off-line. It features several game types, with more details provided at Wikipedia . The game was re-released on February 25, 2000 as Unreal Tournament Game of the Year Edition (GOTY) which included the three bonus packs released previously and additional mods, or game modifiers that had become popular. It is the GOTY version that is available from STEAM or  GOG.com . The GOG version for Windows installs in Linux and plays well using WINE , PlayOnLinux or Codeweaver's Crossover . There is a Linux binary available in two versions, one for the original game and one for the GOTY edition . Also provided at that site is the Official Bonus Pack with a Linux installer. All these Linux installers are created with makeself . There are some issues using such a crusty old Linux binary. Let's see why getting...