Linux - Hardware-related articles

How to detect and use my HP Deskjet printer / scanner on Debian ?

Situation :

I have an HP Deskjet F2480 "all-in-one" printer/scanner. I know it works on GNU/Linux because I already printed with it with Ubuntu (can't remember which release, though, 't was the 12.xx or 13.xx maybe). The scanner worked fine too.

Now I've switched to Debian (Jessie in the initial version of this article, Stretch for the current edit), I can't remember what I did to make it work (if anything special).

So here are notes for my future self to make things easier (you're welcome, bro' )

Details :

In search of solutions, I've tried many different things which finally worked. But I can't tell whether just the final action was the solution, or a combination of actions. So here's everything I did.

Solution :

Jump to the solution.

  1. sane-find-scanner
    • on Jessie :
      # sane-find-scanner will now attempt to detect your scanner. If the
      # result is different from what you expected, first make sure your
      # scanner is powered up and properly connected to your computer.
      # No SCSI scanners found. If you expected something different, make sure that
      # you have loaded a kernel SCSI driver for your SCSI adapter.
      found USB scanner (vendor=0x03f0 [HP], product=0x7611 [Deskjet F2400 series]) at libusb:001:044
      # Your USB scanner was (probably) detected. It may or may not be supported by
      # SANE. Try scanimage -L and read the backend's manpage.
      # Not checking for parallel port scanners.
      # Most Scanners connected to the parallel port or other proprietary ports
      # can't be detected by this program.
    • on Stretch :
      found USB scanner (vendor=0x03f0 [HP], product=0x7611 [Deskjet F2400 series]) at libusb:001:007
  2. scanimage -L
    • on Jessie :
      No scanners were identified. If you were expecting something different,
      check that the scanner is plugged in, turned on and detected by the
      sane-find-scanner tool (if appropriate). Please read the documentation
      which came with this software (README, FAQ, manpages).
    • on Stretch :
      device `hpaio:/usb/Deskjet_F2400_series?serial=CN9AT172RV05BS' is a Hewlett-Packard Deskjet_F2400_series all-in-one
  3. apt install libsane-extras
  4. vim /etc/sane.d/dll.conf (source)
    (nothing found matching my scanner )
  5. lsusb
    Bus 001 Device 044: ID 03f0:7611 Hewlett-Packard DeskJet F2492 All-in-One
    ls -al /dev/bus/usb/001/044
    crw-rw-r-- 1 root lp 189, 43 Jan 11 20:21 /dev/bus/usb/001/044

    The device ID (here 044) is incremented each time a device is detected (unplug + replug or off + on counts as "new device detected")

  6. sudo adduser saned lp
  7. apt install --no-install-recommends hplip
  8. Do one of these :
    • reboot the computer (tested : it works )
    • turn off and on again the printer/scanner
    • unplug + replug the printer/scanner USB cord
    It should work now
Final note : Xsane now detects my scanner but looks WAY too complex for my VERY basics needs. Simple-scan is just fine.

How to get information on your system ?


Hardware detection utilities :
One-liner to get CPU and RAM from a list of servers via SSH :

serverList='server1 server2'; sshLogin='bob'; for server in $serverList; do echo "$server"; ssh "$sshLogin@$server" 'echo -en "Physical CPU\t: "; grep physical\ id /proc/cpuinfo | sort -u | wc -l; echo -en "CPU Cores\t: "; grep -c ^processor /proc/cpuinfo; echo -en "CPU Model\t: "; grep model\ name /proc/cpuinfo | sort -u; echo -en "RAM\t\t: "; grep 'MemTotal:' /proc/meminfo'; echo; done

Notice the use of \ to grep expressions containing a space character. This is to avoid using quotes, which are numerous here, nested, and getting complex

  • Model reference : dmidecode -t baseboard | grep "Base Board Information" -A13
  • SATA capabilities (bandwidth of SATA versions, I:1.5Gb/s, II:3Gb/s, III:6Gb/s) : dmesg | grep -i sata
  • lscpu
  • less /proc/cpuinfo (Differentiate multi-core / multi-socket / hyperthreading CPUs)
  • dmidecode -t processor (requires root privileges)
  • Number of physical processors : grep 'physical id' /proc/cpuinfo | sort -u | wc -l
  • Number of cores :
    • grep -Ec '^processor' /proc/cpuinfo
    • top + 1
    • nproc
  • Whether the processor is a 32/64 bits :
    • method 1 : arch
    • method 2 : This command checks whether the kernel is 32 or 64 bit (source) : getconf LONG_BIT
      • 64 / ia64 / x86_64 : 64-bit mode
      • 32 / i386 : 32-bit mode
    • method 3 : perl -e 'print ~123;'; echo
      • 4294967172 : 32 bits
      • 18446744073709551492 : 64 bits
  • less /proc/meminfo
  • Total installed RAM :
  • the shell command free
  • dmidecode -t memory (requires root privileges)
video card / GPU (source) :
    1. lspci | grep VGA
      00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
    2. lspci -v -s 00:02.0
      00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter (prog-if 00 [VGA controller])
      	Flags: fast devsel, IRQ 18
      	Memory at e0000000 (32-bit, prefetchable) [size=128M]
      	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
      	Kernel driver in use: vboxvideo
      	Kernel modules: vboxvideo
HDD and storage devices
  • List storage (aka block) devices : lsblk
  • Manufacturer, model number, S/N, firmware and A LOT more :
    • hdparm -I /dev/sdb
      For details on all installed drives : for letter in {a..z}; do device="/dev/sd$letter"; [ -b "$device" ] && hdparm -I "$device" | head -8; done
    • smartctl -a /dev/sdb (this comes with smartmontools, more from Wikipedia, more from Ubuntu documentation)
  • List available partitions :
    • fdisk -l
    • or less /proc/partitions
    • or mount | grep sd
    • or grep sd /etc/mtab
  • Get device / filesystem metadata (type, last mount point, status, FS creation/last mount/last write/last check/next check, mount count, ...)
  • Get partitions size, usage, available space : df -h
  • Get device / partition size :
    • fdisk -l | grep -E '^Disk /'
    • Using the /sys pseudo filesystem :
      in sectors in GiB (1 sector = 512 B)
      • cat /sys/block/sda/size
      • cat /sys/block/sda/sda1/size
      • echo "$(cat /sys/block/sda/size)*512/1024/1024/1024" | bc
      • echo "$(cat /sys/block/sda/sda1/size)*512/1024/1024/1024" | bc
  • Total storage :

    Both methods give slightly different numbers. I guess this is because the df method sums formatted sizes whereas the /sys method gets device size.

  • Sector size :
SATA drives speed (source) :
As root :

for disk in $(find /dev -type b -name '*sd?' | sort); do echo $disk; hdparm -I "$disk" | grep -i speed; for i in {1..3}; do hdparm -tT "$disk"; done; done

Remarks :

  • find will list /dev/sd* drives. Not all of them are SATA drives : they can be USB drives, hence no speed parameter
  • The hdparm -tT test is run several times to get meaningful values
  • To do the same for IDE drive, let find search for /dev/hd*

SWAP usage in MB
free -m | awk '/Swap/ {print $3}'
mii-tool (comes from net-tools) : (as root) show the media-independent interface status :
  • mii-tool
  • mii-tool -v
  • mii-tool eth0
PCI devices
  • less /proc/pci (when available)
  • lspci lists all detected PCI devices (in a tree-like diagram with -tv : tree + verbose) :
    00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control
    01:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5700 Series]
    01:00.1 Audio device: ATI Technologies Inc Juniper HDMI Audio [Radeon HD 5700 Series]
    For more details on device (source) : lspci -v -s 01:00.0
    01:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5700 Series] (prog-if 00 [VGA controller])
    Subsystem: PC Partner Limited Device 1482
    Flags: bus master, fast devsel, latency 0, IRQ 27
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
  • scanpci -vO (-v : verbose, -O : use the OS's specific mechanism to get information. details). The PCI bus 0x1 is the AGP port.
USB devices
lsusb lists all detected USB devices (in a tree-like diagram with -tv : tree + verbose)


  • all about the kernel (name, release, version, ...) : uname -a
    Linux hostname 4.18.0-0.bpo.1-amd64 #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) x86_64 GNU/Linux
    or : less /proc/version
    Linux version 4.18.0-0.bpo.1-amd64 ( (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13)
  • kernel release : uname -r
  • kernel version : uname -v
    #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13)
Install the kernel headers :

apt install linux-headers-$(uname -r)

Operating system
On Debianoids :
cat /etc/debian_version outputs 7.8
On Red Hatoids :
cat /etc/redhat-release outputs Red Hat Enterprise Linux Server release 6.2 (Santiago)
Common :
  • hostnamectl
     Static hostname: myPC
           Icon name: computer-laptop
    	 Chassis: laptop
          Machine ID: 9a2d7d69f5e741219fab104d8935fc41
    	 Boot ID: fd51500fbcef4dc1c431907d377ace13
    Operating System: Debian GNU/Linux 9 (stretch)
    	  Kernel: Linux 4.9.0-4-amd64
        Architecture: x86-64
  • cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
    NAME="Debian GNU/Linux"
    VERSION="9 (stretch)"
  • all of Linux Standard Base information : lsb_release -a
    Distributor ID:	Debian
    Description:	Debian GNU/Linux 7.8 (wheezy)
    Release:	7.8
    Codename:	wheezy
    Distributor ID:	RedHatEnterpriseServer
    Description:	Red Hat Enterprise Linux Server release 6.2 (Santiago)
    Release:	6.2
    Codename:	Santiago
    Consider the command flags to get single field information, in either long/short format ( for details)
  • cat /proc/version outputs :
    Linux version 2.6.32-042stab108.8 ( (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Jul 22 17:23:23 MSK 2015
  • cat /etc/issue outputs :
    Debian GNU/Linux 7 \n \l
    This can be customized and may not be up-to-date.
Operating system installation date (source)
  • as root : tune2fs -l $(mount | awk '/ \/ / {print $1}') | grep 'Filesystem created:'
    This hack assumes the operating system was installed the same day the / filesystem was created, which is true unless you've added a new disk, created a new / filesystem and moved files around.
  • on Debianoids : ll /var/log/installer/syslog
    This file (if still there) was created during install. This method is still approximate.
  • Find the oldest file in /etc :
    ls -lact --full-time /etc | tail
    Other commands (such as ls -lt /etc | tail) may return even older files, but this ignores ctime.
    On old Unices (AIX), try (source) :
    ls -l /var/adm/ras/bosinstlog
List daemons / services
Current shell
Environment variables
  • get the file type : file myFile
  • information on file times : stat myFile
  • information (type, dimension, colors) of image files : identify myFile


  • Investigate (cat / more / less) the /proc/ directory
  • dmesg | less displays the kernel messages.
  • Read logs :
    • /var/log/messages
    • /var/log/boot.log
    To read logs in real time : tail -f /var/log/messages
  • List the loaded kernel modules (details) : lsmod

Install and configure WiFi

Identify which controller you're using :

lspci | egrep -i "(lan|network|ethernet|wireless)"

Using a Broadcom BCM4306 (rev 03) controller

  1. By typing dmesg, you may notice a message such as b43-phy0 ERROR : Firmware file "B43/ucode5.fw" not found or load failed. This means the WiFi controller firmware is missing.
  2. So let's install it : apt install b43-fwcutter (source). The installer will ask whether to unpack it all : accept.
  3. unload and reload the kernel module : rmmod b43 && modprobe b43
  4. NB : the LEDs of the PCMCIA WiFi controller should light up once the module is loaded.

Using an Intel Pro Wireless 2200 B/G with WPA (source : see III-B)

  1. The 1st thing you'll need is the Intel firmware ipw2200-bss.fw (alternate source). This firmware is required during the system setup.
  2. Some packages to install :
    • wireless-tools
    • wpasupplicant
  3. Let's encrypt our WPA passphrase : wpa_passphrase mySsid myClearPassphrase, which outputs :
  4. Then, let's save this into /etc/network/interfaces
    • static version :
      # Static configuration
      auto wlan0
      iface wlan0 inet static
      wpa-conf managed
      wpa-ap-scan 1
      wpa-scan-ssid 1
      wpa-ssid mySsid
      wpa-key-mgmt WPA-PSK
      wpa-psk 600792632e29fc6c69f04e82d1290a28bf1bffff58294ca6ddaf48062c36f311
    • DHCP version :
      # DHCP configuration
      auto wlan0
      iface wlan0 inet dhcp
      wpa-conf managed
      wpa-ap-scan 1
      wpa-scan-ssid 1
      wpa-ssid mySsid
      wpa-key-mgmt WPA-PSK
      wpa-psk 600792632e29fc6c69f04e82d1290a28bf1bffff58294ca6ddaf48062c36f311
  5. Then, restart the network to load changes : /etc/init.d/networking restart

    In some circumstances, it may be required to allow broadcasting the SSID so that the wireless host can discover it. Once the wireless host has been registered to the access point, SSID broadcasting can be turned off.

    This may also be related to MAC addresses filtering : while SSID broadcasting was off, my own wireless network was invisible to scanning.

Using an Intel PRO/Wireless 3945ABG [Golan] with WEP :

  1. To "see" the system complain, run /etc/init.d/network-manager restart && dmesg. You may notice an output like :
    [109694.622325] firmware: requesting iwlwifi-3945-1.ucode
    [109694.631281] iwl3945: iwlwifi-3945-1.ucode firmware file req failed: Reason -2
    [109694.631281] iwl3945: Could not read microcode: -2
    We need the firmware file iwlwifi-3945-1.ucode.
  2. Let's get it from (alternate source)
  3. copy it into /lib/firmware/
  4. edit /etc/network/interfaces :
    auto wlan0
    iface wlan0 inet dhcp
    	wireless-essid myEssid
    	wireless-key myWepKey
  5. enable the interface with ifup wlan0

Tip to get the full data rate (Ubuntu 9.04 + Ralink RT2500)

  1. normal setup is done with : iwconfig wlan0 essid mySsid freq 2447000000 ap accessPointMacAddress rate 54M
  2. then, as root : iwconfig wlan0 rate 54M
  3. ... and it should work ! (source)

When dmesg complains : phy0 -> rt2500pci_set_device_state: Error - Device failed to enter state 1 (-16) (source)

Run (as root) : iwconfig wlan0 power off


Wireless interfaces are not listed by ifconfig when they are down. Use iwconfig instead.

Swap management and swappiness

Facts and definitions :

Linux has a parameter called swappiness which determines how much the kernel is likely to swap out runtime memory rather than dropping pages from the system cache (more details). It defaults to 60.

There's a popular belief saying that the swappiness is the RAM usage threshold beyond which some of the contents of the RAM is moved to the SWAP partition. Based on the 60 default value, it's said that, if the free RAM goes below 60%, the SWAP will be used.

This is sooo WRONG !!!

Myths about Swap (source) :
  1. Swap space does not inherently slow down your system. In fact, not having swap space doesn't mean you won't swap pages. It merely means that Linux has fewer choices about what RAM can be reused when a demand hits. Thus, it is possible for the throughput of a system that has no swap space to be lower than that of a system that has some.
  2. Swap space is used for modified anonymous pages only. Your programs, shared libraries and filesystem cache are never written there under any circumstances.
  3. Given items 1 and 2 above, the philosophy of "minimization of swap space" is really just a concern about wasted disk space.
For more details and definitions :

Change the threshold temporarily :

echo 10 > /proc/sys/vm/swappiness

This command will work fine (it will cause no error, no silenced warning will be generated) but it's mostly pointless unless PERFECTLY understanding how the swap works. Again, changing the swappiness value has NOTHING to do with any amount of used RAM after which swapping starts. Read links above.

Make a permanent change :

Add into /etc/sysctl.conf :
Then reboot (or sysctl -p) to apply changes.

Performance indicators (source) :

Am I swapping ?
  • Superb : no swap space even has been allocated (free shows 0 swap in use), and RAM usage is low. Unless you benefit from a huge filesystem cache, you may have spent too much on RAM. Run more stuff.
  • Great : swap space is allocated, but there is almost no I/O on the swap partition.
  • OK : swap space is allocated, and there is some I/O on the swap partition. System throughput is still OK. For example, the CPUs are busy, and most of that is in the User or Nice categories. If you see CPU Wait, it indicates a disk bottleneck (possibly on swapping), and system time could mean the OS is frantically looking for memory to reuse (page scanning).
  • Not OK (too much swapping) : lots of I/O on the swap partition. CPU is spending a lot of time in Sys or Wait, and swap disk service times exceed the average disk access times.
  • Not OK (too little swap space) : system is running very well, but new programs refuse to start due to lack of virtual memory.

Report swap usage per process (source) :

  • separator=','; for file in /proc/*/status; do grep -q 'VmSwap' $file && awk -v separator="$separator" '/Name/ {printf $2""separator} /VmSwap/ {print $2""separator""$3}' $file; done | sort -t "$separator" -k 2 -nr | head -20 | column -s "$separator" -t
  • for file in /proc/*/status; do awk '/VmSwap|Name/ { printf $2 " " $3 } END { print "" }' $file; done | sort -k 2 -nr | head -20
It is also possible to view swap usage per process with top.

How to setup a ramdisk ?

The good news is : you don't have to, since most distributions create one for you. It used to be available at /dev/shm (shared memory) but /run/shm should be used instead since Wheezy (source).

On Debianoids, /run/shm actually symlinks to /dev/shm.

Find yours : df -h /run/shm
Filesystem	Size	Used	Avail	Use%	Mounted on
tmpfs		2.0G	12K	2.0G	1%	/dev/shm
This space can be used for temporary data.

More on tmpfs (Debian documentation, Wikipedia, :

  • tmpfs volumes can be read/written like any other filesystem type, but they are on volatile memory instead of a persistent storage device : their contents is not reboot-proof.
  • The memory used by tmpfs grows and shrinks to accommodate the files it contains and can be swapped out to swap space. By default, swapping is triggered by data on the tmpfs volume using more than half of the physical RAM.
  • Depending on distributions, /tmp itself can be a tmpfs volume


Create a custom ramdisk (source) :
mount -t tmpfs -o size=512M tmpfs /mount/point
Create a custom ramdisk at boot time :
Add into /etc/fstab :
none	/mount/point	tmpfs	defaults,size=512M	0	0
To save a reboot and apply settings NOW! : mount -o remount /mount/point
Change ramdisk size :
mount -o remount,size=8G /dev/shm

How to setup dual-screen display ?

To do so, my 1st idea was to try using the ATI Catalyst Control Center (running /usr/bin/amdcccle as root), but this didn't work
After some research, the solution is xrandr.

List the detected monitors :

xrandr -q may output something like (this is actually what is output AFTER configuration) :

Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 8192 x 8192
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 337mm x 270mm
	1280x1024	75.02	60.02*
	1024x768	75.08	70.07	60.00
	800x600		75.00	60.32
	640x480		75.00	60.00	59.93
	720x400		70.08	70.08
DVI-1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
	1280x1024	60.02*+	75.02
	1152x864	75.00
	1024x768	75.08	70.07	60.00
	832x624		74.55
	800x600		72.19	75.00	60.32	56.25
	640x480		75.00	72.81	66.67	60.00	59.94
	720x400		70.08
Screen names are listed UPPERCASE, then their settings (details).

Configure both monitors :

  1. xrandr --auto --output DVI-0 --mode 1280x1024
  2. xrandr --auto --output DVI-1 --mode 1024x768 --pos 1280x300
  1. --pos declares the offset of the lower-left corner of DVI-1 relatively to the lower-left corner of DVI-0.
  2. Don't spend too much time trying to align windows on screens of different sizes/resolutions : pixels may not be the same height on both screens
  3. The device that is declared 1st becomes the primary screen. By default, Gnome displays the panel on this screen only (source).
Even simpler method :

xrandr --output DVI-1 --left-of DVI-0

More in the xrandr man page and on Wikipedia.
If xrandr complains xrandr: screen cannot be larger than widthxheight (source) :
  1. Open /etc/X11/xorg.conf (this was created with aticonfig --initial when installing ATI non-free driver)
  2. In the Screen | Display subsection, declare the size on the Virtual Display : Virtual 2304 1068
    Section "Screen"
    	Identifier		"aticonfig-Screen[0]-0"
    	Device			"aticonfig-Device[0]-0"
    	Monitor			"aticonfig-Monitor[0]-0"
    	DefaultDepth		24
    	SubSection		"Display"
    		Viewport	0 0
    		Depth		24
    		Virtual		2304 1068

Save settings (source) :

Simply write the command line above into ~/.xprofile.

(Re-)Apply settings after opening a graphical session :

How to disable the annoying PC speaker beep ?

Quick solution (not reboot-proof) :

As root : rmmod pcspkr

Definitive solution : Kernel Module Blacklisting (sources : 1 (for Debian Etch), 2) :

As root :
  1. echo blacklist pcspkr > /etc/modprobe.d/pcspkr.conf
  2. depmod -a
  3. update-initramfs -u
  4. reboot

Answers indicating to create a /etc/modprobe.d/blacklist.conf (or /etc/modprobe.d/blacklist) file containing blacklist pcspkr have no effect : naming modules there does not affect autoloading of modules by the kernel.

Fiddling with the MBR

With Linux, there is no "brute force" way to reinitialize the MBR like the MS-DOS fdisk /mbr. However, it is possible to save/restore it with dd.

Some preliminary details on the Master Boot Record (source) :

On hard disks (and many other mass storage media), the boot sector is called the Master Boot Record. It consists of 512 bytes at the first sector of the hard disk. It is important to note that it is not located inside any partition. The Master Boot Record precedes the first partition. Its layout is as follows :
  • First 446 bytes contain bootable code.
  • Next 64 bytes contain partition information for 4 partitions (16×4). That is why the hard disks can have only 4 primary partitions, as the MBR can store information for 4 partitions only. So if you need more than 4 partitions on the hard disk, one of the primary partition has to be made extended, and out of this extended partition, logical partitions are created.
  • Last 2 bytes are for MBR signature, also called magic number.
Thus total of 446 + 64 + 2 = 512 bytes :
| 446             | 16   | 16   | 16   | 16   | 2 |
The first 446 bytes of MBR contain the code that locates the partition to boot from. The rest of booting process takes place from that partition. This partition contains a software program for booting the system called the bootloader.

Now let's play with dd :

Save the MBR :
dd if=/dev/sda of=/path/to/file bs=446 count=1
Save the MBR + partition table :
dd if=/dev/sda of=/path/to/file bs=512 count=1
Restore one of those :
dd if=/path/to/file of=/dev/sda bs=446|512 count=1

How to monitor the CPU temperature ?

  1. apt install lm-sensors
  2. load the i2c-dev kernel module : modprobe i2c-dev
  3. then detect sensors and configure the tool :
    To load everything that is needed, add this to /etc/modules:
    #----cut here----
    # Chip drivers
    #----cut here----
  4. Then, once the chip kernel module is loaded, you can read sensor information : sensors
  5. To monitor CPU temperature easily in a terminal : watch -n 10 -d "sensors | grep 'Core'"

How to set the CPU frequency ?

  1. install the required packages : cpufrequtils, sysfsutils (is the latter useful ?)
  2. identify your CPU : grep model /proc/cpuinfo
  3. you can also get its current frequency : cpufreq-info
  4. now you need a kernel module to manage the frequency scaling :
    CPU family kernel module
    Pentium 4, Celeron D, Pentium D, Celeron M p4_clockmod
    Pentium M, Core Duo, Core 2 Duo speedstep_centrino
    AMD K6 powernow_k6
    AMD K7 (Athlon, Duron, Sempron 32) powernow_k7
    AMD K8 (Athlon 64, Turion 64, Sempron 64, Opteron 64) powernow_k8
    None of above acpi_cpufreq (with NO warranty that it works, whatsoever!)
    To list all available modules :
    • ls -l /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq/
    • ls -l /lib/modules/$(uname -r)/kernel/arch/i386/kernel/cpu/cpufreq/ ("i386" | "x86" in the path)
  5. load the chosen module : modprobe p4_clockmod
  6. now it's time to setup the policy governor (governors are listed in /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors) :
    governor usage module
    performance sets the frequency statically to the highest possible value within the configured MIN/MAX range cpufreq_performance
    powersave sets the frequency statically to the lowest possible value within the configured MIN/MAX range cpufreq_powersave
    userspace allows the users (or any application running as "root") to set the CPU frequency
    ondemand adjusts the CPU speed dynamically, depending on the usage cpufreq_ondemand
    conservative similar to ondemand, adjusts the frequency dynamically. It differs in behavior in that it gracefully increases and decreases the CPU speed rather than jumping to max speed upon CPU load. This is more suitable in a battery powered environment. cpufreq_conservative
  7. load the chosen module : modprobe cpufreq_powersave
  8. now, find the range of supported frequencies by your CPU :
    • min/max values only : cpufreq-info -l
    • list of all supported values : cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
      3200000 2500000 2100000 800000
  9. edit /etc/init.d/cpufrequtils and set values for GOVERNOR, MAX_SPEED and MIN_SPEED :
    The CPU frequency can be chosen only from the values listed above. Using another value for MAX_SPEED will cause no error, but the CPU won't be able to go faster than the nearest smaller accepted value.
  10. restart cpufrequtils : /etc/init.d/cpufrequtils restart
  11. make sure it works :
    • min max governor : cpufreq-info -p
    • verbose : cpufreq-info
    • cpufreq-info | grep "fréquence actuelle"
  12. load the CPU and governor modules at startup :
    1. echo p4_clockmod >> /etc/modules
    2. echo cpufreq_powersave >> /etc/modules
  13. [for fun] load you CPU at 100% : while [ 1 -eq 1 ]; do echo 1>/dev/null; done
  14. Enjoy !

Linux and USB 2.0

New Logos :

Logo USB version Bandwidth
USB 2.0
(high speed version, with red stripe)
480 Mbits/s (theoretical)
60-80 Mbits/s (practical)
USB 1.1 12 Mbits/s (theoretical)
2 Mbits/s (practical)


How to connect a FireWire (IEEE1394) hard drive?

IEEE 1394 is the "real" name of that technology, also known as FireWire and iLink (Sony).
Actually, the connection method is quite similar to connecting a USB digital camera. Here is the procedure I use :

To connect the HDD :

  1. physically connect the HDD
  2. modprobe ohci1394
  3. modprobe sbp2
  4. mount /dev/sdxx mountPoint

To disconnect this HDD :

  1. Unloading ohci1394 from the 2.4.10-12a kernel results in a DEADLOCK condition that requires a reboot. So never unload ohci1394 and don't use /etc/modules.conf to associate sbp2 with ohci1394 because if you do, then unloading sbp2 will cause ohci1394 to unload
  2. simply unload the sbp2 module :
    modprobe -r sbp2
  3. physically disconnect the HDD

To reconnect the HDD :

  1. physically connect the HDD
  2. To gain access to the drive, both ohci1394 and sbp2 must be loaded:
    • ohci1394 is still loaded since we can't unload it without messing things up.
    • sbp2 must be loaded / unloaded each time the drive is attached / removed. It is currently unloaded, so load it :
      modprobe sbp2