Page not found – ShopingServer Wiki https://wiki.shopingserver.com Tutorials and Articles About Technology and Gadgets Wed, 02 Sep 2020 02:23:44 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.14 https://wiki.shopingserver.com/wp-content/uploads/2018/07/cropped-favicon-150x150.png Page not found – ShopingServer Wiki https://wiki.shopingserver.com 32 32 FreeBSD 9.1: HowTo Load a Kernel Module https://wiki.shopingserver.com/freebsd-9-1-howto-load-kernel-module/ https://wiki.shopingserver.com/freebsd-9-1-howto-load-kernel-module/#respond Sat, 06 Jan 2018 10:03:43 +0000 http://wiki.shopingserver.com/?p=18575 I am a new FreeBSD Unix users. I am using FreeBSD version 9.1 and how do I load a kernel module called drm using command line option?

 

You need to use the kldload command. It loads file.ko (kernel module or device drive) into the kernel using the kernel linker. The syntax is:

kldload module-name

OR

kldload module-name-1 module-name-2

OR

kldload [option] module-name

Please note that if multiple modules are specified then an attempt will be made to load them all, even if some fail. The .ko extension name is not mandatory when loading a given module using kldload. It does not hurt to specify it though.

/boot/kernel directory

/boot/kernel# ls -l /boot/kernel/

# ls -l /boot/kernel/ | more

Examples

Open a terminal or login using ssh. You must login as root user:

# kldload foo

# kldload drm

 

To load by file name within the module path:

# kldload drm.ko

 

To load by relative path in the current dir:

# kldload ./name.ko

 

To load by full path:

# kldload /boot/kernel/drm.ko

 

To see all loaded modules, enter:

# kldstat

 

To remove or unload module, enter:

# kldunload drm

 

 

]]>
https://wiki.shopingserver.com/freebsd-9-1-howto-load-kernel-module/feed/ 0
Mac OS X: Force Quit An Unresponsive Full Screen Application Shortcut Key https://wiki.shopingserver.com/mac-os-x-force-quit-unresponsive-full-screen-application-shortcut-key/ https://wiki.shopingserver.com/mac-os-x-force-quit-unresponsive-full-screen-application-shortcut-key/#respond Sat, 06 Jan 2018 08:03:00 +0000 http://wiki.shopingserver.com/?p=18431 S

ometime my VLC application gets crashed on a Mac OS X system. The screen goes blank and VLC stays hang running on my desktop or MacBook. How can I solve this issue and quit an unresponsive VLC application on a Mac OS X without a hard reboot?

 

OS X has a feature called Force Quit to quit both responsive and an unresponsive application on a Mac OS X system. The Force Quit displays list of apps on screen and can be activated using keyboard shortcuts.

Option #1: Press Command-Option-Esc keys to force quit full screen app

To open “Force Quit Applications” on a Mac OS X press Command-Option-Escape:

Fig.01: Force Quit App

Select an app (say VLC) and press “Force Quit” button. You may be prompted as follows:

Fig.02: Confirmation dialog box

Option #2: If you cannot switch from the unresponsive app…

If you cannot switch from the unresponsive VLC app, press Command-Option-Shift-Esc for three seconds to force it to quit. This key combination tells OS X to force quit the frontmost app.

Option #3: Bash Terminal killall command option

Open the Terminal application and type the following killall command to kill the VLC app:

killall -9 {app-name}

killall -9 VLC

If you do not know the exact name of app, use ps command as follows:

ps aux

ps aux | grep -i vlc

ps -xu username

ps -xu vivek | grep -i vlc

References

OS X keyboard shortcuts

 

 

]]>
https://wiki.shopingserver.com/mac-os-x-force-quit-unresponsive-full-screen-application-shortcut-key/feed/ 0
Fedora Linux 20: Install Broadcom-wl STA BCM43228 Wireless Driver https://wiki.shopingserver.com/fedora-linux-20-install-broadcom-wl-sta-bcm43228-wireless-driver/ https://wiki.shopingserver.com/fedora-linux-20-install-broadcom-wl-sta-bcm43228-wireless-driver/#respond Sat, 06 Jan 2018 07:50:36 +0000 http://wiki.shopingserver.com/?p=18413 I

‘m using Dell / Lenovo laptop with Broadcom’s IEEE 802.11a/b/g/n based wireless card. How can I install Broadcom-wl STA BCM4322 Wireless driver on a Fedora Linux version 20?

 

Broadcom’s IEEE 802.11a/b/g/n driver can be installed on any Linux disruption including Fedora Linux version 20. The driver (broadcom-wl and kmod-wl) works with the following Wireless chipsets only:

BCM4311

BCM4312

BCM4313

BCM4321

BCM4322

BCM43224

BCM43225

BCM43227

BCM43228

Finding out your chipset / wireless card name on a Fedora Linux

Open the Terminal app and type the following shell command:

$ lspci

$ lspci | grep -i broadcom

 

Sample outputs:

Fig.01: Fedora Linux Find Supported Broadcom Wireless Devices Name/Chipset

How do I use Broadcom wireless cards in Fedora version 19/20?

Fedora Linux provides a version of this driver via rpmfusion repo. All you’ve to do is configure rpmfusion repo and install the driver.

Step #1: Enable rpmfusion repo

Open the Terminal app and type the following command:

# yum localinstall –nogpgcheck \

http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \

yum localinstall –nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

 

Sample outputs:

Loaded plugins: langpacks, refresh-packagekit

rpmfusion-free-release-20.noarch.rpm                   |  15 kB     00:00

Examining /var/tmp/yum-root-Gh9BLR/rpmfusion-free-release-20.noarch.rpm: rpmfusion-free-release-20-1.noarch

Marking /var/tmp/yum-root-Gh9BLR/rpmfusion-free-release-20.noarch.rpm to be installed

Skipping: yum, filename does not end in .rpm.

Skipping: localinstall, filename does not end in .rpm.

rpmfusion-nonfree-release-20.noarch.rpm                |  15 kB     00:00

Examining /var/tmp/yum-root-Gh9BLR/rpmfusion-nonfree-release-20.noarch.rpm: rpmfusion-nonfree-release-20-1.noarch

Marking /var/tmp/yum-root-Gh9BLR/rpmfusion-nonfree-release-20.noarch.rpm to be installed

Resolving Dependencies

–> Running transaction check

—> Package rpmfusion-free-release.noarch 0:20-1 will be installed

—> Package rpmfusion-nonfree-release.noarch 0:20-1 will be installed

–> Finished Dependency Resolution

 

Dependencies Resolved

 

==============================================================================

Package               Arch   Version

Repository                            Size

==============================================================================

Installing:

rpmfusion-free-release

noarch 20-1 /rpmfusion-free-release-20.noarch    9.7 k

rpmfusion-nonfree-release

noarch 20-1 /rpmfusion-nonfree-release-20.noarch 9.9 k

 

Transaction Summary

==============================================================================

Install  2 Packages

 

Total size: 20 k

Installed size: 20 k

Is this ok [y/d/N]: y

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Warning: RPMDB altered outside of yum.

Installing : rpmfusion-free-release-20-1.noarch                         1/2

Installing : rpmfusion-nonfree-release-20-1.noarch                      2/2

Verifying  : rpmfusion-free-release-20-1.noarch                         1/2

Verifying  : rpmfusion-nonfree-release-20-1.noarch                      2/2

 

Installed:

rpmfusion-free-release.noarch 0:20-1

rpmfusion-nonfree-release.noarch 0:20-1

 

Complete!

Step #2: Install Broadcom Wireless Drivers on Linux Fedora 20

Type the following yum command:

# yum search kmod-wl

*** COMMENT: update the system *** ##

# yum update

*** COMMENT: if a new kernel was installed reboot the system, before installing kmod-wl using following command i.e. reboot and issue the following command *** ##

# yum install kmod-wl

 

Sample outputs:

Loaded plugins: langpacks, refresh-packagekit

Resolving Dependencies

–> Running transaction check

—> Package kmod-wl.x86_64 0:6.30.223.141-5.fc20.22 will be installed

–> Processing Dependency: kmod-wl-3.14.4-200.fc20.x86_64 >= 6.30.223.141-5.fc20.22 for package: kmod-wl-6.30.223.141-5.fc20.22.x86_64

–> Running transaction check

—> Package kmod-wl-3.14.4-200.fc20.x86_64.x86_64 0:6.30.223.141-5.fc20.22 will be installed

–> Processing Dependency: wl-kmod-common >= 6.30.223.141 for package: kmod-wl-3.14.4-200.fc20.x86_64-6.30.223.141-5.fc20.22.x86_64

–> Running transaction check

—> Package broadcom-wl.noarch 0:6.30.223.141-2.fc20 will be installed

–> Finished Dependency Resolution

 

Dependencies Resolved

 

===========================================================================================

Package                     Arch   Version                Repository                 Size

===========================================================================================

Installing:

kmod-wl                     x86_64 6.30.223.141-5.fc20.22 rpmfusion-nonfree-updates  14 k

Installing for dependencies:

broadcom-wl                 noarch 6.30.223.141-2.fc20    rpmfusion-nonfree          19 k

kmod-wl-3.14.4-200.fc20.x86_64

x86_64 6.30.223.141-5.fc20.22 rpmfusion-nonfree-updates 1.1 M

 

Transaction Summary

===========================================================================================

Install  1 Package (+2 Dependent packages)

 

Total download size: 1.2 M

Installed size: 5.1 M

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/20/rpmfusion-nonfree/packages/broadcom-wl-6.30.223.141-2.fc20.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID b5f29883: NOKEY

Public key for broadcom-wl-6.30.223.141-2.fc20.noarch.rpm is not installed

(1/3): broadcom-wl-6.30.223.141-2.fc20.noarch.rpm                   |  19 kB  00:00:01

Public key for kmod-wl-6.30.223.141-5.fc20.22.x86_64.rpm is not installed

(2/3): kmod-wl-6.30.223.141-5.fc20.22.x86_64.rpm                    |  14 kB  00:00:01

(3/3): kmod-wl-3.14.4-200.fc20.x86_64-6.30.223.141-5.fc20.22.x86_64 | 1.1 MB  00:00:04


Total                                                      250 kB/s | 1.2 MB  00:00:04

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-20

Importing GPG key 0xB5F29883:

Userid     :  RPM Fusion nonfree repository for Fedora (20) <rpmfusion-buildsys@lists.rpmfusion.org>

Fingerprint: a84d cf58 46cb 10b6 5c47 6c35 63c0 de8c b5f2 9883

Package    : rpmfusion-nonfree-release-20-1.noarch (@/rpmfusion-nonfree-release-20.noarch)

From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-20

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Installing : kmod-wl-3.14.4-200.fc20.x86_64-6.30.223.141-5.fc20.22.x86_64            1/3

Installing : broadcom-wl-6.30.223.141-2.fc20.noarch                                  2/3

Installing : kmod-wl-6.30.223.141-5.fc20.22.x86_64                                   3/3

Verifying  : broadcom-wl-6.30.223.141-2.fc20.noarch                                  1/3

Verifying  : kmod-wl-3.14.4-200.fc20.x86_64-6.30.223.141-5.fc20.22.x86_64            2/3

Verifying  : kmod-wl-6.30.223.141-5.fc20.22.x86_64                                   3/3

 

Installed:

kmod-wl.x86_64 0:6.30.223.141-5.fc20.22

 

Dependency Installed:

broadcom-wl.noarch 0:6.30.223.141-2.fc20

kmod-wl-3.14.4-200.fc20.x86_64.x86_64 0:6.30.223.141-5.fc20.22

 

Complete!

Step #3: Reboot the system

Type the following reboot command to reboot the Linux based system:

# reboot

Step #4: Verify and connect to the Wireless network

Type the following command to verify that wireless interface is up and running:

$ ifconfig

$ iwconfig

 

Sample outputs:

wlp1s0    IEEE 802.11abg  ESSID:off/any

Mode:Managed  Access Point: Not-Associated   Tx-Power=200 dBm

Retry short limit:7   RTS thr:off   Fragment thr:off

Encryption key:off

Power Management:off

 

lo        no wireless extensions.

 

p1p1      no wireless extensions.

You can now connect to your wireless network using Network Manager (top right side) > Select Wi-Fi > Select Network > Select a network > Connect > Enter password for wireless network:

Fig.02: Fedora Linux Wireless Connection

References

Brodcom 802.11 Linux STA driver source code.

b43 and b43legacy are drivers for the 802.11b/g/n family of wireless chips that Broadcom produces.

 

 

]]>
https://wiki.shopingserver.com/fedora-linux-20-install-broadcom-wl-sta-bcm43228-wireless-driver/feed/ 0
FreeBSD 10: Apply Binary Updates To Keep Base System Up To Date https://wiki.shopingserver.com/freebsd-10-apply-binary-updates-keep-base-system-date/ https://wiki.shopingserver.com/freebsd-10-apply-binary-updates-keep-base-system-date/#respond Sat, 06 Jan 2018 07:42:12 +0000 http://wiki.shopingserver.com/?p=18405 I

know keeping a FreeBSD server up to date is a very important. How can I apply binary system patches and updates to a new installation of FreeBSD 10 server?

 

You need to use the freebsd-update tool. It is used to fetch, install, and rollback binary updates to the FreeBSD base system.

Find out current FreeBSD release

Type the following command:

uname -mrs

OR

uname -a

Sample outputs:

FreeBSD netbook02 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

FreeBSD install security updates and patch the server

Type the following command on a newly installed FreeBSD server:

# freebsd-update fetch install

 

Sample outputs:

freebsd-update fetch install

Looking up update.FreeBSD.org mirrors… 5 mirrors found.

Fetching metadata signature for 10.0-RELEASE from update4.freebsd.org… done.

Fetching metadata index… done.

Inspecting system… done.

Preparing to download files… done.

 

The following files will be updated as part of updating to 10.0-RELEASE-p5:

/bin/freebsd-version

/boot/kernel/ciss.ko

/boot/kernel/ciss.ko.symbols

/boot/kernel/kernel

/boot/kernel/kernel.symbols

/boot/kernel/nfsd.ko

/boot/kernel/nfsd.ko.symbols

/etc/defaults/rc.conf

/lib/libcrypto.so.7

/rescue/[

/rescue/atmconfig

/rescue/badsect

….

..

/usr/src/etc/defaults/rc.conf

/usr/src/sys/conf/newvers.sh

/usr/src/sys/dev/ciss/ciss.c

/usr/src/sys/fs/nfsserver/nfs_nfsdserv.c

/usr/src/sys/kern/kern_exec.c

/usr/src/sys/netinet/tcp_reass.c

/usr/src/sys/sys/proc.h

/usr/src/sys/vm/vm_map.c

/var/db/mergemaster.mtree

Installing updates… done.

Reboot the FreeBSD server

Type the following command:

# reboot

Verify new system

Type the following command:

# uname -mrs

 

OR

# uname -a

 

Sample outputs:

Fig. 01: Newly updated FreeBSD 10 server

See also

FreeBSD apply security updates for installed ports/applications

 

 

]]>
https://wiki.shopingserver.com/freebsd-10-apply-binary-updates-keep-base-system-date/feed/ 0
How To Stress Test CPU and Memory (VM) On a Linux and Unix With Stress-ng https://wiki.shopingserver.com/stress-test-cpu-memory-vm-linux-unix-stress-ng/ https://wiki.shopingserver.com/stress-test-cpu-memory-vm-linux-unix-stress-ng/#respond Fri, 05 Jan 2018 15:52:44 +0000 http://wiki.shopingserver.com/?p=18355 I

want test my Linux, OpenBSD, FreeBSD and Unix-like server entirely for high load and monitoring the health under stress. How can I stress out my CPU, memory, I/O, and disk stress and more with stress test tool on a Linux or Unix-like systems?

 

A sysadmin can try out any one of the following tool to put given subsytems under a specified load. Instances in which this is useful include those in which a system administrator wishes to perform tuning activities, a kernel or libc programmer wishes to evaluate denial of service possibilities, test your systems entirely on high load and monitoring the health, etc. This is also useful for sysadmin, system builders, and overclockers who want to test their hardware under high load and monitor stability and thermal environment.

stress : It is a simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system. It is written in C, and is free software licensed under the GPLv2. It is not a benchmark, but is rather a tool designed

stress-ng : It is an updated version of stress tool and it will stress test a server for the following features:

CPU compute

Cache thrashing

Drive stress

I/O syncs

VM stress

Socket stressing

Context switching

Process creation and termination

It includes over 60 different stress tests, over 50 CPU specific stress tests that exercise floating point, integer, bit manipulation and control flow, over 20 virtual memory stress tests.

Warning: Running the following tools with root privileges is recommended to avoid out of memory and other errors. Also, note that tools will stress out your server resources quickly so use the following command judiciously.

Tool#1: Getting started with stress tool

This program is supposed to be easy to use and recommended for new sysadmins. The tool is known to work on x86 Linux and FreeBSD/OpenBSD, powerpc AIX and Linux, SPARC Solaris, Compaq Alpha Tru64 UNIX, and many others.

Install stress package

You can install stress as part of the distribution.

INSTALL STRESS ON A CENTOS, RHEL, AND FEDORA LINUX

First, turn on EPEL repo and then type the following yum command to install the same:

sudo yum install stress

Sample outputs:

Fig.01: Installing stress on a RHEL/CentOS/Fedora Linux

INSTALL STRESS ON A DEBIAN AND UBUNTU LINUX

Type the following apt-get command to install the same:

apt-get install stress

Sample outputs:

Fig.02: Install stress tool on a Debian/Ubuntu Linux

INSTALL STRESS ON A FREEBSD

Type the following pkg command to install the stress tool using binary method:

pkg install stress

OR ##

pkg install sysutils/stress

Sample outputs:

Fig.03: FreeBSD installing stress tool

INSTALL STRESS ON A OPENBSD

Type the following pkg_add command to install the stress tool using binary method:

export PKG_PATH=http://ftp.usa.openbsd.org/pub/OpenBSD/uname -r/packages/arch -s

pkg_add stress

How do I use stress tool?

First, note down the current system load averages by typing the following command:

# uptime

 

Next, run any one of the following command to see load on screen:

# watch uptime

 

OR use tload command:

# tload

 

The syntax is as follows:

stress [OPTION]

Stress using CPU-bound task

stress -c 4

Stress using IO-bound task

stress -i 2

For example, a load average of four is imposed on the system by specifying two CPU-bound processes, one I/O-bound process, and one memory allocator process as follows:

# uptime

# stress -c 2 -i 1 -m 1 –vm-bytes 128M -t 10s

# uptime

 

Sample outputs:

Fig.04: A load average of four is imposed on the system

 

Where,

-c 2 : Spawn two workers spinning on sqrt()

-i 1 : Spawn one worker spinning on sync()

-m 1 : Spawn one worker spinning on malloc()/free()

–vm-bytes 128M : Malloc 128MB per vm worker (default is 256MB)

-t 10s : Timeout after ten seconds

-v : Be verbose

Tool #2: Getting started with stress-ng

The stress-ng tool will stress test a computer system in various selectable ways.

Install stress-ng on a Linux or Unix-like systems

Type the following command to download stress-ng tarball using the wget command:

$ cd /tmp

$ wget http://kernel.ubuntu.com/~cking/tarballs/stress-ng/stress-ng-0.03.11.tar.gz

 

Untar tar ball, enter:

$ tar zxvf stress-ng-0.03.11.tar.gz

 

Compile stress-ng, run:

$ cd stress-ng-0.03.11

$ make

 

Sample outputs:

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-affinity.o stress-affinity.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-aio.o stress-aio.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-bigheap.o stress-bigheap.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-brk.o stress-brk.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-bsearch.o stress-bsearch.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-cache.o stress-cache.c

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-chmod.o stress-chmod.c

….

..

cc -Wall -Wextra -DVERSION=  0.03.11   -O2 -c -o stress-ng.o stress-ng.c

cc  -Wall -Wextra -DVERSION=  0.03.11   -O2 stress-affinity.o stress-aio.o stress-bigheap.o stress-brk.o stress-bsearch.o stress-cache.o stress-chmod.o stress-clock.o stress-cpu.o stress-dentry.o stress-dir.o stress-dup.o stress-epoll.o stress-eventfd.o stress-fallocate.o stress-fault.o stress-fifo.o stress-flock.o stress-fork.o stress-fstat.o stress-futex.o stress-get.o stress-hdd.o stress-hsearch.o stress-inotify.o stress-iosync.o stress-kill.o stress-lease.o stress-lsearch.o stress-link.o stress-lockf.o stress-memcpy.o stress-mincore.o stress-mmap.o stress-msg.o stress-mq.o stress-nice.o stress-noop.o stress-null.o stress-open.o stress-pipe.o stress-poll.o stress-procfs.o stress-pthread.o stress-qsort.o stress-rdrand.o stress-rename.o stress-seek.o stress-sem.o stress-sendfile.o stress-sigfd.o stress-sigfpe.o stress-sigsegv.o stress-sigq.o stress-socket.o stress-stack.o stress-switch.o stress-sysinfo.o stress-timer.o stress-tsearch.o stress-urandom.o stress-utime.o stress-vm.o stress-wait.o stress-yield.o stress-zero.o coredump.o helper.o io-priority.o lock-mem.o log.o madvise.o mincore.o mounts.o mwc.o out-of-memory.o parse-opts.o proc-name.o sched.o time.o stress-ng.o -lm -lpthread -lrt -o stress-ng

How do I use the stress-ng tool?

The syntax is:

stress-ng [options]

stress-ng -c 2

stress-ng -c 4 -t 10 -v

stress-ng -c 4 –metrics-brief

EXAMPLES

To run for 60 seconds with 4 cpu stressors, 2 io stressors and 1 vm stressor using 1GB of virtual memory, enter:

stress-ng –cpu 4 –io 2 –vm 1 –vm-bytes 1G –timeout 60s –metrics-brief

Sample outputs:

Fig.05: stress-ng in action

 

In this example, run 16 cpu stressors and stops after 900000 bogo operations:

stress-ng –cpu 16 –cpu-ops 900000

To run 4 simultaneous instances of all the stressors sequentially one by one, each for 6 minutes and summaries with performance metrics at the end:

stress-ng –sequential 4 –timeout 6m –metrics

To run 2 FFT cpu stressors, stop after 5000 bogo operations and produce a summary just for the FFT results:

stress-ng –cpu 2 –cpu-method fft –cpu-ops 5000 –metrics−brief

To run cpu stressors on all online CPUs working through all the available CPU stressors for 2 hour:

stress−ng –cpu 0 –cpu-method all -t 2h

To run 2 instances of all the stressors for 10 minutes:

stress-ng –all 2 –timeout 10m

To run 128 stressors that are randomly chosen from all the available stressors:

stress-ng –random 128

To run 64 instances of all the different cpu stressors and verify that the computations are correct for 5 minutes with a bogo operations summary at the end:

stress-ng –cpu 64 –cpu−method all –verify -t 5m –metrics−brief

To run all the stressors one by one for 5 minutes, with the number of instances of each stressor matching the number of online CPUs:

stress-ng –sequential 0 -t 5m

To run all the stressors in the io class one by one for 1 minutes each, with 8 instances of each stressor running concurrently and show overall time utilisation statistics at the end of the run:

stress-ng –sequential 8 –class io -t 1m –times

References

stress home page – Download source code and docs.

stress-ng home page– Download source code and docs.

 

 

]]>
https://wiki.shopingserver.com/stress-test-cpu-memory-vm-linux-unix-stress-ng/feed/ 0
Linux and Unix Test Disk I/O Performance With dd Command https://wiki.shopingserver.com/linux-unix-test-disk-o-performance-dd-command/ https://wiki.shopingserver.com/linux-unix-test-disk-o-performance-dd-command/#respond Fri, 05 Jan 2018 14:50:39 +0000 http://wiki.shopingserver.com/?p=18276 H

ow can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?

 

You can use the following commands on a Linux or Unix-like systems for simple I/O performance test:

dd command : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system.

hdparm command : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system.

In this tutorial you will learn how to use the dd command to test disk I/O performance.

Use dd command to monitor the reading and writing performance of a disk device:

Open a shell prompt.

Or login to a remote server via ssh.

Use the dd command to measure server throughput (write speed) dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

Use the dd command to measure server latency dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

The dd command is useful to find out simple sequential I/O performance.

Understanding dd command options

In this example, I’m using RAID-10 (Adaptec 5405Z with SAS SSD) array running on a Ubuntu Linux 14.04 LTS server. The basic syntax is as follows to find out server throughput:

dd if=/dev/input.file  of=/path/to/output.file  bs=block-size  count=number-of-blocks  oflag=dsync

## GNU dd syntax ##

##########################################################

##***[Adjust bs and count as per your needs and setup]**##

##########################################################

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

dd if=/dev/zero of=/tmp/test2.img bs=64M count=1 oflag=dsync

dd if=/dev/zero of=/tmp/test3.img bs=1M count=256 conv=fdatasync

dd if=/dev/zero of=/tmp/test4.img bs=8k count=10k

dd if=/dev/zero of=/tmp/test4.img bs=512 count=1000 oflag=dsync

## OR alternate syntax for GNU/dd ##

dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync

Sample outputs:

Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd

 

Please note that one gigabyte was written for the test and 135 MB/s was server throughput for this test. Where,

if=/dev/zero (if=/dev/input.file) : The name of the input file you want dd the read from.

of=/tmp/test1.img (of=/path/to/output.file) : The name of the output file you want dd write the input.file to.

bs=1G (bs=block-size) : Set the size of the block you want dd to use. 1 gigabyte was written for the test. Please note that Linux will need 1GB of free space in RAM. If your test system does not have sufficient RAM available, use a smaller parameter for bs (such as 128MB or 64MB and so on).

count=1 (count=number-of-blocks): The number of blocks you want dd to read.

oflag=dsync (oflag=dsync) : Use synchronized I/O for data. Do not skip this option. This option get rid of caching and gives you good and accurate results

conv=fdatasyn: Again, this tells dd to require a complete “sync” once, right before it exits. This option is equivalent to oflag=dsync.

Finding server latency time

In this example, 512 bytes were written one thousand times to get RAID10 server latency time:

dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

Sample outputs:

1000+0 records in

1000+0 records out

512000 bytes (512 kB) copied, 0.60362 s, 848 kB/s

Please note that server throughput and latency time depends upon server/application load too. So I recommend that you run these tests on a newly rebooted server as well as peak time to get better idea about your workload. You can now compare these numbers with all your devices.

But why the server throughput and latency time are so low?

Low values does not mean you are using slow hardware. The value can be low because of the HARDWARE RAID10 controller’s cache.

Use hdparm command to see buffered and cached disk read speed

I suggest you run the following commands 2 or 3 times Perform timings of device reads for benchmark and comparison purposes:

Buffered disk read test for /dev/sda ##

hdparm -t /dev/sda1

OR ##

hdparm -t /dev/sda

To perform timings of cache reads for benchmark and comparison purposes again run the following command 2-3 times (note the -T option):

Cache read benchmark for /dev/sda ###

hdparm -T /dev/sda1

OR ##

hdparm -T /dev/sda

OR combine both tests:

hdparm -Tt /dev/sda

Sample outputs:

Fig.02: Linux hdparm command to test reading and caching disk performance

 

Again note that due to filesystems caching on file operations, you will always see high read rates.

Use dd command on Linux to test read speed

To get accurate read test data, first discard caches before testing by running the following commands:

flush

echo 3 | sudo tee /proc/sys/vm/drop_caches

time dd if=/path/to/bigfile of=/dev/null bs=8k

Linux Laptop example

Run the following command:

Debian Laptop Throughput With Cache ##

dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct

 

Deactivate the cache ###

hdparm -W0 /dev/sda

 

Debian Laptop Throughput Without Cache ##

dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct

Apple OS X Unix (Macbook pro) example

GNU dd has many more options but OS X/BSD and Unix-like dd command need to run as follows to test real disk I/O and not memory add sync option as follows:

Run command 2-3 times to get good results ###

time sh -c  dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync

Sample outputs:

1024+0 records in

1024+0 records out

104857600 bytes transferred in 0.165040 secs (635346520 bytes/sec)

 

real 0m0.241s

user 0m0.004s

sys 0m0.113s

So I’m getting 635346520 bytes (635.347 MB/s) write speed on my MBP.

Not a fan of command line…?

You can use disk utility (gnome-disk-utility) on a Linux or Unix based system to get the same information. The following screenshot is taken from my Fedora Linux v22 VM.

Graphical method

Click on the “Activities” or press the “Super” key to switch between the Activities overview and desktop. Type “Disks”

Fig.03: Start the Gnome disk utility

 

Select your hard disk at left pane and click on configure button and click on “Benchmark partition”:

Fig.04: Benchmark disk/partition

 

Finally, click on the “Start Benchmark…” button (you may be promoted for the admin username and password):

Fig.05: Final benchmark result

Which method and command do you recommend to use?

I recommend dd command on all Unix-like systems (time sh -c  dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync

If you are using GNU/Linux use the dd command (dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync)

Make sure you adjust count and bs arguments as per your setup to get a good set of result.

The GUI method is recommended only for Linux/Unix laptop users running Gnome2 or 3 desktop.

See also: HowTo: Linux Check IDE / SATA Hard Disk Transfer Speed and man pages: dd(1),hdparm(1)

 

 

]]>
https://wiki.shopingserver.com/linux-unix-test-disk-o-performance-dd-command/feed/ 0
How To Find Out HP Network Printer Serial Number Remotely Using Bash Shell On Linux or Unix https://wiki.shopingserver.com/find-hp-network-printer-serial-number-remotely-using-bash-shell-linux-unix/ https://wiki.shopingserver.com/find-hp-network-printer-serial-number-remotely-using-bash-shell-linux-unix/#respond Fri, 05 Jan 2018 14:19:33 +0000 http://wiki.shopingserver.com/?p=18238 I

manage a small network including couple of HP printers. Is there an easy way to access HP printer serial number in the terminal on Linux or Unix-like system? How do I find the model, product, and serial number on my HP printer using bash command line options?

 

There are many ways to get this information:

curl command – Standard tool to transfer data from or to a server.

hp-info command – Part of hp-toolbox software.

Printer Management Language to get information from the printer.

Use curl command to query HP printer for serial number

Most HP printers comes with an embedded web-server called HP HTTP Server. The web-server exposes the following info:

Printer name and model

Printer Firmware number

Printer serial number

Examples

The curl command is available on Linux, Apple OS X, FreeBSD, OpenBSD, and Unix-like operating system. Let us say your printer IP address is 192.168.1.100, enter:

curl -k -I https://192.168.1.100

 

OR

curl -I http://192.168.1.100

 

Sample outputs:

Fig.01: Query printer for serial number

 

In this sample outputs my printer details are as follows:

Printer name: HP Officejet Pro 8600

Printer model number: CM750A

Printer serial number: CN276BKXYZZZZYY

Printer firmware number: CLP1CN1516AR

hp-info command example

The hp-info command query a printer for static model information, dynamic status informtion, and CUPS printer queue settings. This is part of HPLIP (Hewlett-Packard Linux Imaging and Printing). Itt is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.

$ hp-info

 

Sample outputs:

Fig.02: hp-info command in action

 

$ hp-query -n -d  hp_device_name_here

 

Sample outputs:

Fig.03: hp-query command in action

 

 

]]>
https://wiki.shopingserver.com/find-hp-network-printer-serial-number-remotely-using-bash-shell-linux-unix/feed/ 0
How To FreeNAS Install And Configure APC UPS For Power Management https://wiki.shopingserver.com/freenas-install-configure-apc-ups-power-management/ https://wiki.shopingserver.com/freenas-install-configure-apc-ups-power-management/#respond Fri, 05 Jan 2018 14:18:17 +0000 http://wiki.shopingserver.com/?p=18236 I

have an APC SUA1500i smart ups, and want to configure power option from my FreeNAS using this ups. How can I install an appropriate APC UPS USB driver on my FreeNAS server, and use it to control power options?

 

FreeNAS is nothing but a FOSS network-attached storage (NAS) system based on FreeBSD Unix and the OpenZFS file system. It comes with a dedicated management web interface for managing and configuring your NAS box. In this tutorial you will learn how to configure the APC (or any other supported brand) UPS service then start it in FreeNAS to protect your server from power failures. This tutorial shows how to configure and use UPS on a FreeNAS based server.

UPS monitoring on FreeNAS

An uninterruptible power supply/uninterruptible power source (UPS) is an electrical apparatus that provides emergency power to a load when the input power source, typically mains power, fails. A UPS is useful start a standby power source such as generator or properly shut down the FreeNAS box.

FreeNAS and NUT

FreeNAS comes with NUT (Network UPS Tools) software to provide support for Power Devices such as UPS.

Configuration

First connect the APC ups to your FreeNAS based server using the serial or USB port the UPS is plugged into.

Finding out the APC USB port name

Login to your FreeNAS server using ssh and type the following command:

dmesg | grep -i –color  american power conversion

 

Or

dmesg | grep -i usbus | grep -i –color  american power conversion

 

Sample outputs:

Fig.01: FreeNAS/FreeBSD Find Out APC UPS USB Device Name

How do I configure UPS monitoring service on FreeNAS server?

To configure the UPS service login to your FreeNAS web-gui. Navigate as follows:

Services > Control Services

Fig.02: FreeNAS UPS service

 

You need to set the following options:

Fig.03 FreeNAS UPS service configuration options

Set UPS Mode to Master.

Set Identifier to ups.

Set Driver as per your USP model. In this example, I set it to “APC ups 2 Back-UPS USB USB (usbhid-ups)“.

Set Port to /dev/ugen0.3 (again set this as per your setup).

Set Shutdown mode to “UPS reaches low battery“.

Set Monitor password “passwordHere” (again replace passwordHere with actual password).

Set email to “you@nixcraft.com” (replace you@nixcraft.com with actual email id).

Finally click on “Ok” button to save changes.

Next make sure you start UPS service on boot by clicking “Start on boot” and Start Now button from Services right panel:

Fig.04: Starting UPS service on FreeNAS

How do I test UPS connectivity and configuration on FreeNAS?

Login using ssh and simply type the following command to poll the status of a UPS server on FreeNAS:

upsc ups@localhost

Sample outputs:

Gif.01: upsc demo on FreeNAS

And, there you have it, the APC ups installed and working correctly on the latest version of FreeNAS.

References

FreeNAS project

Network UPS Tools project.

 

 

]]>
https://wiki.shopingserver.com/freenas-install-configure-apc-ups-power-management/feed/ 0
How To Find Hard Disk SATA Link Speed On FreeBSD https://wiki.shopingserver.com/find-hard-disk-sata-link-speed-freebsd/ https://wiki.shopingserver.com/find-hard-disk-sata-link-speed-freebsd/#respond Fri, 05 Jan 2018 14:16:52 +0000 http://wiki.shopingserver.com/?p=18234 I

know how to find out my SATA link speed such as 3.0 or 6.0 Gbps on Linux operating system. How do I find out my SATA link speed on FreeBSD Unix operating system? How do I make sure my sata hard disk is working at 6Gbps speed and how do I verify this on a FreeBSD server hardware?

 

Most common SATA speed revision are as follows:

SATA revision 2.0 : 3 Gbit/s, 300 MB/s

SATA revision 3.0 : 6 Gbit/s, 600 MB/s

You need to use the dmesg command to displays the contents of the FreeBSD system or view/search /var/run/dmesg.boot. It is a snapshot of the buffer contents taken soon after file systems are mounted at startup time.

dmesg command examples

Open the terminal application or login to the remote FreeBSD box using ssh client and type the following command:

# dmesg | grep -i SATA

 

OR

# dmesg | grep -i transfers

 

Sample outputs:

Fig.01: dmesg command in action

 

Or, you can directly query the log file:

# grep -i –color transfers /var/log/dmesg.today

 

OR

# grep -i –color transfers /var/run/dmesg.boot

 

Sample outputs:

ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

ada1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

ada2: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)

ada3: 600.000MB/s transfers (SATA 3.x, UDMA5, PIO 512bytes)

ada4: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)

ada5: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

ada6: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

camcontrol command example

You can use the camcontrol command as follows:

# camcontrol identify {diskNameHere}

# camcontrol identify ada0 | more

# camcontrol identify ada0 | grep -i sata

 

Sample outputs:

pass0:  ATA-9 SATA 3.x device

pass0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-9 SATA 3.x

Here is a shell loop to generate list of all disks and their sata speed on FreeBSD based system:

for i in $(sysctl -n kern.disks)

do

camcontrol identify  $i  | grep -i sata; echo  —

done

Sample outputs:

pass7: <WDC WD60EFRX-68MYMN1 82.00A82> ATA-9 SATA 3.x device

pass7: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-9 SATA 3.x


pass6: <WDC WD60EFRX-68MYMN1 82.00A82> ATA-9 SATA 3.x device

pass6: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-9 SATA 3.x


pass4: <SanDisk SDSSDHII120G X31200RL> ATA-9 SATA 3.x device

pass4: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)

protocol              ATA/ATAPI-9 SATA 3.x


pass3: <16GB SATA Flash Drive SFDE001A> ATA-9 SATA 3.x device

pass3: 600.000MB/s transfers (SATA 3.x, UDMA5, PIO 512bytes)

protocol              ATA/ATAPI-9 SATA 3.x

device model          16GB SATA Flash Drive


pass2: <SanDisk SD6SB1M064G1022I X231600> ATA-8 SATA 3.x device

pass2: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)

protocol              ATA/ATAPI-8 SATA 3.x


pass1: <WDC WD60EFRX-68MYMN1 82.00A82> ATA-9 SATA 3.x device

pass1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-9 SATA 3.x


pass0: <WDC WD60EFRX-68MYMN1 82.00A82> ATA-9 SATA 3.x device

pass0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-9 SATA 3.x


smartctl command examples

Type the following command:

# smartctl -a /dev/ada0 | more

# smartctl -a /dev/ada0 | grep  ^SATA

# smartctl -a /dev/ada0

smartctl 6.3 2014-07-26 r3976 [FreeBSD 9.3-RELEASE-p26 amd64] (local build)

Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

 

=== START OF INFORMATION SECTION ===

Model Family:     Western Digital Red

Device Model:     WDC WD60EFRX-68MYMN1

Serial Number:    WD-WX31D55A4CLC

LU WWN Device Id: 5 0014ee 26195240d

Firmware Version: 82.00A82

User Capacity:    6,001,175,126,016 bytes [6.00 TB]

Sector Sizes:     512 bytes logical, 4096 bytes physical

Rotation Rate:    5700 rpm

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b

SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)

Local Time is:    Tue Oct 13 22:43:51 2015 IST

SMART support is: Available – device has SMART capability.

SMART support is: Enabled

 

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

 

General SMART Values:

Offline data collection status:  (0x00) Offline data collection activity

was never started.

Auto Offline Data Collection: Disabled.

Self-test execution status:      (   0) The previous self-test routine completed

without error or no self-test has ever

been run.

Total time to complete Offline

data collection:                ( 3824) seconds.

Offline data collection

capabilities:                    (0x7b) SMART execute Offline immediate.

Auto Offline data collection on/off support.

Suspend Offline collection upon new

command.

Offline surface scan supported.

Self-test supported.

Conveyance Self-test supported.

Selective Self-test supported.

 

 

]]>
https://wiki.shopingserver.com/find-hard-disk-sata-link-speed-freebsd/feed/ 0
How To Read CPUID Instruction For Each CPU on Linux With x86info and cpuid Commands https://wiki.shopingserver.com/read-cpuid-instruction-cpu-linux-x86info-cpuid-commands/ https://wiki.shopingserver.com/read-cpuid-instruction-cpu-linux-x86info-cpuid-commands/#respond Fri, 05 Jan 2018 13:48:17 +0000 http://wiki.shopingserver.com/?p=18202 Is there a CPU-Z like a freeware/open source software that detects the central processing unit (CPU) of a modern personal computer in Linux operating system?

How can I get detailed information about the CPU(s) gathered from the CPUID instruction, including the exact model of CPU(s) on Linux operating system?

 

There are three programs on Linux operating system that can provide CPUID information and these tools are useful to find out if specific advanced features such as virtualization, extended page tables, encryption and more:

lscpu command – Show information on CPU architecture.

x86info command – Show x86 CPU diagnostics.

cpuid command – Dump CPUID information for each CPU. This is the closet tool to CPU-Z app on Linux.

x86info

x86info is a program which displays a range of information about the CPUs present in an x86 system.

Install x86info on Debian / Ubuntu Linux

$ sudo apt-get install x86info

Install x86info on Fedora Linux

$ sudo dnf install x86info

Install x86info on RHEL/SL/CentOS Linux

$ sudo yum install x86info

Examples

Simply type the following command:

# x86info

 

Sample outputs:

Fig.01: Linux x86info Command To Display-x86 CPU Diagnostics Info On Linux

SEE TLB, CACHE SIZES AND CACHE ASSOCIATIVITY

# x86info -c

 

Sample outputs:

x86info v1.30.  Dave Jones 2001-2011

Feedback to <davej@redhat.com>.

 

Found 4 identical CPUs

Extended Family: 0 Extended Model: 1 Family: 6 Model: 28 Stepping: 10

Type: 0 (Original OEM)

CPU Model (x86info s best guess): Atom D510

Processor name string (BIOS programmed): Intel(R) Atom(TM) CPU D510   @ 1.66GHz

 

Cache info

L1 Instruction cache: 32KB, 8-way associative. 64 byte line size.

L1 Data cache: 24KB, 6-way associative. 64 byte line size. ECC.

L2 cache: 512KB, 8-way associative. 64 byte line size.

TLB info

Found unknown cache descriptors: 4f 59 ba c0

Total processor threads: 4

This system has 1 dual-core processor with hyper-threading (2 threads per core) running at an estimated 1.65GHz

SEE CPU FEATURE FLAGS LIKE AES/FPU/SSE AND MORE

# x86info -f

 

Sample outputs:

x86info v1.30.  Dave Jones 2001-2011

Feedback to <davej@redhat.com>.

 

Found 4 identical CPUs

Extended Family: 0 Extended Model: 1 Family: 6 Model: 28 Stepping: 10

Type: 0 (Original OEM)

CPU Model (x86info s best guess): Atom D510

Processor name string (BIOS programmed): Intel(R) Atom(TM) CPU D510   @ 1.66GHz

 

Feature flags:

fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflsh ds acpi mmx fxsr sse sse2 ss ht tm pbe sse3 dtes64 monitor ds-cpl tm2 ssse3 cx16 xTPR pdcm movbe

Extended feature flags:

SYSCALL xd em64t lahf_lm dts

Long NOPs supported: yes

 

Total processor threads: 4

This system has 1 dual-core processor with hyper-threading (2 threads per core) running at an estimated 1.65GHz

SEE MP TABLE SHOWING CPUS BIOS KNOWS ABOUT

# x86info -mp

 

Sample outputs:

x86info v1.30.  Dave Jones 2001-2011

Feedback to <davej@redhat.com>.

 

MP Table:

# APIC ID Version State  Family Model Step Flags

#  0  0x14  BSP, usable  6  12  10  0xbfebfbff

#  2  0x14  AP, usable  6  12  10  0xbfebfbff

…..

..

SHOW REGISTER VALUES FROM ALL POSSIBLE CPUID CALLS

# x86info -r

….

..

eax in: 0x00000000, eax = 0000000a ebx = 756e6547 ecx = 6c65746e edx = 49656e69

eax in: 0x00000001, eax = 000106ca ebx = 00040800 ecx = 0040e31d edx = bfebfbff

eax in: 0x00000002, eax = 4fba5901 ebx = 0e3080c0 ecx = 00000000 edx = 00000000

eax in: 0x00000003, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x00000004, eax = 04004121 ebx = 0140003f ecx = 0000003f edx = 00000001

eax in: 0x00000005, eax = 00000040 ebx = 00000040 ecx = 00000003 edx = 00000010

eax in: 0x00000006, eax = 00000001 ebx = 00000002 ecx = 00000001 edx = 00000000

eax in: 0x00000007, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x00000008, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x00000009, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x0000000a, eax = 07280203 ebx = 00000000 ecx = 00000000 edx = 00000503

 

eax in: 0x80000000, eax = 80000008 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x80000001, eax = 00000000 ebx = 00000000 ecx = 00000001 edx = 20100800

eax in: 0x80000002, eax = 20202020 ebx = 20202020 ecx = 746e4920 edx = 52286c65

eax in: 0x80000003, eax = 74412029 ebx = 54286d6f ecx = 4320294d edx = 44205550

eax in: 0x80000004, eax = 20303135 ebx = 20402020 ecx = 36362e31 edx = 007a4847

eax in: 0x80000005, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x80000006, eax = 00000000 ebx = 00000000 ecx = 02006040 edx = 00000000

eax in: 0x80000007, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000

eax in: 0x80000008, eax = 00003024 ebx = 00000000 ecx = 00000000 edx = 00000000

….

..

To see all information, type:

# x86info -a

cpuid

cpuid dumps detailed information about the CPU(s) gathered from the CPUID instruction, and also determines the exact model of CPU(s) from that information. It dumps all information available from the CPUID instruction. The exact collection of information available varies between manufacturers and processors. The following information is available consistently on all modern CPUs:

vendor_id

version information (1/eax)

miscellaneous (1/ebx)

feature information (1/ecx)

Install cpuid on Debian / Ubuntu Linux

$ sudo apt-get install cpuid

Install cpuid on Fedora Linux

$ sudo dnf install cpuid

Install cpuid on RHEL/SL/CentOS Linux

$ sudo yum install cpuid

Examples

Simply type the following command (this command provides lots of useful information including list of all features in human readable format):

# cpuid

# cpuid | less

# cpuid | grep  something

 

Sample outputs:

Fig.02: Linux cpuid Command To Dump CPUID information

DISPLAY INFORMATION ONLY FOR THE FIRST CPU

# cpuinfo -1

USE THE CPUID INSTRUCTION (DEFAULT AND VERY RELIABLE)

# cpuinfo -i

USE THE CPUID KERNEL MODULE (NOT SEEMS TO BE RELIABLE ON ALL COMBINATIONS OF CPU TYPE AND KERNEL VERSION)

# cpuinfo -k

SEARCH FOR SPECIFIC CPU FEATURE

Is virtualization supported (see below for flags)? ##

# cpuid -1 | egrep –color -iw  vmx|svm|ept|vpid|npt|tpr_shadow|vnmi|flexpriority

VMX: virtual machine extensions = true

Is advanced encryption supported? ##

# cpuid -1 | egrep –color -i  aes|aes-ni

AES instruction = true

 

Some important flags for sysadmins on Linux based system:

vmx – Intel VT-x, basic virtualization.

svm – AMD SVM, basic virtualization.

ept – Extended Page Tables, an Intel feature to make emulation of guest page tables faster.

vpid – VPID, an Intel feature to make expensive TLB flushes unnecessary when context switching between guests.

npt – AMD Nested Page Tables, similar to EPT.

tpr_shadow and flexpriority – Intel feature that reduces calls into the hypervisor when accessing the Task Priority Register, which helps when running certain types of SMP guests.

vnmi – Intel Virtual NMI feature which helps with certain sorts of interrupt events in guests.

DISPLAY INFORMATION ONLY FOR THE FIRST CPU

# cpuinfo -1

 

Here is complete information about one of cpu:

CPU:

vendor_id =  GenuineIntel

version information (1/eax):

processor type  = primary processor (0)

family          = Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom, AMD Athlon/Duron, Cyrix M2, VIA C3 (6)

model           = 0xd (13)

stepping id     = 0x7 (7)

extended family = 0x0 (0)

extended model  = 0x2 (2)

(simple synth)  = Intel Core i7-3800/3900 (Sandy Bridge-E C2) / Xeon E5-1600/2600 (Sandy Bridge-E C2/M1), 32nm

miscellaneous (1/ebx):

process local APIC physical ID = 0x3 (3)

cpu count                      = 0x20 (32)

CLFLUSH line size              = 0x8 (8)

brand index                    = 0x0 (0)

brand id = 0x00 (0): unknown

feature information (1/edx):

x87 FPU on chip                        = true

virtual-8086 mode enhancement          = true

debugging extensions                   = true

page size extensions                   = true

time stamp counter                     = true

RDMSR and WRMSR support                = true

physical address extensions            = true

machine check exception                = true

CMPXCHG8B inst.                        = true

APIC on chip                           = true

SYSENTER and SYSEXIT                   = true

memory type range registers            = true

PTE global bit                         = true

machine check architecture             = true

conditional move/compare instruction   = true

page attribute table                   = true

page size extension                    = true

processor serial number                = false

CLFLUSH instruction                    = true

debug store                            = true

thermal monitor and clock ctrl         = true

MMX Technology                         = true

FXSAVE/FXRSTOR                         = true

SSE extensions                         = true

SSE2 extensions                        = true

self snoop                             = true

hyper-threading / multi-core supported = true

therm. monitor                         = true

IA64                                   = false

pending break event                    = true

feature information (1/ecx):

PNI/SSE3: Prescott New Instructions     = true

PCLMULDQ instruction                    = true

64-bit debug store                      = true

MONITOR/MWAIT                           = true

CPL-qualified debug store               = true

VMX: virtual machine extensions         = true

SMX: safer mode extensions              = true

Enhanced Intel SpeedStep Technology     = true

thermal monitor 2                       = true

SSSE3 extensions                        = true

context ID: adaptive or shared L1 data  = false

FMA instruction                         = false

CMPXCHG16B instruction                  = true

xTPR disable                            = true

perfmon and debug                       = true

process context identifiers             = true

direct cache access                     = true

SSE4.1 extensions                       = true

SSE4.2 extensions                       = true

extended xAPIC support                  = true

MOVBE instruction                       = false

POPCNT instruction                      = true

time stamp counter deadline             = true

AES instruction                         = true

XSAVE/XSTOR states                      = true

OS-enabled XSAVE/XSTOR                  = true

AVX: advanced vector extensions         = true

F16C half-precision convert instruction = false

RDRAND instruction                      = false

hypervisor guest status                 = false

cache and TLB information (2):

0x5a: data TLB: 2M/4M pages, 4-way, 32 entries

0x03: data TLB: 4K pages, 4-way, 64 entries

0x76: instruction TLB: 2M/4M pages, fully, 8 entries

0xff: cache data is in CPUID 4

0xb2: instruction TLB: 4K, 4-way, 64 entries

0xf0: 64 byte prefetching

0xca: L2 TLB: 4K, 4-way, 512 entries

processor serial number: 0002-06D7-0000-0000-0000-0000

deterministic cache parameters (4):

— cache 0 —

cache type                           = data cache (1)

cache level                          = 0x1 (1)

self-initializing cache level        = true

fully associative cache              = false

extra threads sharing this cache     = 0x1 (1)

extra processor cores on this die    = 0xf (15)

system coherency line size           = 0x3f (63)

physical line partitions             = 0x0 (0)

ways of associativity                = 0x7 (7)

WBINVD/INVD behavior on lower caches = false

inclusive to lower caches            = false

complex cache indexing               = false

number of sets – 1 (s)               = 63

— cache 1 —

cache type                           = instruction cache (2)

cache level                          = 0x1 (1)

self-initializing cache level        = true

fully associative cache              = false

extra threads sharing this cache     = 0x1 (1)

extra processor cores on this die    = 0xf (15)

system coherency line size           = 0x3f (63)

physical line partitions             = 0x0 (0)

ways of associativity                = 0x7 (7)

WBINVD/INVD behavior on lower caches = false

inclusive to lower caches            = false

complex cache indexing               = false

number of sets – 1 (s)               = 63

— cache 2 —

cache type                           = unified cache (3)

cache level                          = 0x2 (2)

self-initializing cache level        = true

fully associative cache              = false

extra threads sharing this cache     = 0x1 (1)

extra processor cores on this die    = 0xf (15)

system coherency line size           = 0x3f (63)

physical line partitions             = 0x0 (0)

ways of associativity                = 0x7 (7)

WBINVD/INVD behavior on lower caches = false

inclusive to lower caches            = false

complex cache indexing               = false

number of sets – 1 (s)               = 511

— cache 3 —

cache type                           = unified cache (3)

cache level                          = 0x3 (3)

self-initializing cache level        = true

fully associative cache              = false

extra threads sharing this cache     = 0x1f (31)

extra processor cores on this die    = 0xf (15)

system coherency line size           = 0x3f (63)

physical line partitions             = 0x0 (0)

ways of associativity                = 0x13 (19)

WBINVD/INVD behavior on lower caches = false

inclusive to lower caches            = true

complex cache indexing               = true

number of sets – 1 (s)               = 16383

MONITOR/MWAIT (5):

smallest monitor-line size (bytes)       = 0x40 (64)

largest monitor-line size (bytes)        = 0x40 (64)

enum of Monitor-MWAIT exts supported     = true

supports intrs as break-event for MWAIT  = true

 

 

 

 

 

 

 

 

 

Thermal and Power Management Features (6):

digital thermometer                     = true

Intel Turbo Boost Technology            = false

ARAT always running APIC timer          = true

PLN power limit notification            = true

ECMD extended clock modulation duty     = true

PTM package thermal management          = true

digital thermometer thresholds          = 0x2 (2)

ACNT/MCNT supported performance measure = true

ACNT2 available                         = false

performance-energy bias capability      = true

extended feature flags (7):

FSGSBASE instructions                    = false

IA32_TSC_ADJUST MSR supported            = false

BMI instruction                          = false

HLE hardware lock elision                = false

AVX2: advanced vector extensions 2       = false

SMEP supervisor mode exec protection     = false

BMI2 instructions                        = false

enhanced REP MOVSB/STOSB                 = false

INVPCID instruction                      = false

RTM: restricted transactional memory     = false

QM: quality of service monitoring        = false

deprecated FPU CS/DS                     = false

intel memory protection extensions       = false

AVX512F: AVX-512 foundation instructions = false

RDSEED instruction                       = false

ADX instructions                         = false

SMAP: supervisor mode access prevention  = false

Intel processor trace                    = false

AVX512PF: prefetch instructions          = false

AVX512ER: exponent & reciprocal instrs   = false

AVX512CD: conflict detection instrs      = false

SHA instructions                         = false

PREFETCHWT1                              = false

Direct Cache Access Parameters (9):

PLATFORM_DCA_CAP MSR bits = 1

Architecture Performance Monitoring Features (0xa/eax):

version ID                               = 0x3 (3)

number of counters per logical processor = 0x4 (4)

bit width of counter                     = 0x30 (48)

length of EBX bit vector                 = 0x7 (7)

Architecture Performance Monitoring Features (0xa/ebx):

core cycle event not available           = false

instruction retired event not available  = false

reference cycles event not available     = false

last-level cache ref event not available = false

last-level cache miss event not avail    = false

branch inst retired event not available  = false

branch mispred retired event not avail   = false

Architecture Performance Monitoring Features (0xa/edx):

number of fixed counters    = 0x3 (3)

bit width of fixed counters = 0x30 (48)

x2APIC features / processor topology (0xb):

— level 0 (thread) —

bits to shift APIC ID to get next = 0x1 (1)

logical processors at this level  = 0x2 (2)

level number                      = 0x0 (0)

level type                        = thread (1)

extended APIC ID                  = 3

— level 1 (core) —

bits to shift APIC ID to get next = 0x5 (5)

logical processors at this level  = 0x10 (16)

level number                      = 0x1 (1)

level type                        = core (2)

extended APIC ID                  = 3

XSAVE features (0xd/0):

XCR0 lower 32 bits valid bit field mask = 0x00000007

bytes required by fields in XCR0        = 0x00000340 (832)

bytes required by XSAVE/XRSTOR area     = 0x00000340 (832)

XCR0 upper 32 bits valid bit field mask = 0x00000000

YMM features (0xd/2):

YMM save state byte size                = 0x00000100 (256)

The YMM save state byte offset              = 0x00000240 (576)

LWP features (0xd/0x3e):

LWP save state byte size                = 0x00000000 (0)

The LWP save state byte offset              = 0x00000000 (0)

extended feature flags (0x80000001/edx):

SYSCALL and SYSRET instructions        = true

execution disable                      = true

1-GB large page support                = true

RDTSCP                                 = true

64-bit extensions technology available = true

Intel feature flags (0x80000001/ecx):

LAHF/SAHF supported in 64-bit mode     = true

LZCNT advanced bit manipulation        = false

3DNow! PREFETCH/PREFETCHW instructions = false

brand =         Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz

L1 TLB/cache information: 2M/4M pages & L1 TLB (0x80000005/eax):

instruction # entries     = 0x0 (0)

instruction associativity = 0x0 (0)

data # entries            = 0x0 (0)

data associativity        = 0x0 (0)

L1 TLB/cache information: 4K pages & L1 TLB (0x80000005/ebx):

instruction # entries     = 0x0 (0)

instruction associativity = 0x0 (0)

data # entries            = 0x0 (0)

data associativity        = 0x0 (0)

L1 data cache information (0x80000005/ecx):

line size (bytes) = 0x0 (0)

lines per tag     = 0x0 (0)

associativity     = 0x0 (0)

size (Kb)         = 0x0 (0)

L1 instruction cache information (0x80000005/edx):

line size (bytes) = 0x0 (0)

lines per tag     = 0x0 (0)

associativity     = 0x0 (0)

size (Kb)         = 0x0 (0)

L2 TLB/cache information: 2M/4M pages & L2 TLB (0x80000006/eax):

instruction # entries     = 0x0 (0)

instruction associativity = L2 off (0)

data # entries            = 0x0 (0)

data associativity        = L2 off (0)

L2 TLB/cache information: 4K pages & L2 TLB (0x80000006/ebx):

instruction # entries     = 0x0 (0)

instruction associativity = L2 off (0)

data # entries            = 0x0 (0)

data associativity        = L2 off (0)

L2 unified cache information (0x80000006/ecx):

line size (bytes) = 0x40 (64)

lines per tag     = 0x0 (0)

associativity     = 8-way (6)

size (Kb)         = 0x100 (256)

L3 cache information (0x80000006/edx):

line size (bytes)     = 0x0 (0)

lines per tag         = 0x0 (0)

associativity         = L2 off (0)

size (in 512Kb units) = 0x0 (0)

Advanced Power Management Features (0x80000007/edx):

temperature sensing diode      = false

frequency ID (FID) control     = false

voltage ID (VID) control       = false

thermal trip (TTP)             = false

thermal monitor (TM)           = false

software thermal control (STC) = false

100 MHz multiplier control     = false

hardware P-State control       = false

TscInvariant                   = true

Physical Address and Linear Address Size (0x80000008/eax):

maximum physical address bits         = 0x2e (46)

maximum linear (virtual) address bits = 0x30 (48)

The maximum guest physical address bits   = 0x0 (0)

Logical CPU cores (0x80000008/ecx):

number of CPU cores – 1 = 0x0 (0)

ApicIdCoreIdSize        = 0x0 (0)

(multi-processing synth): multi-core (c=8), hyper-threaded (t=2)

(multi-processing method): Intel leaf 0xb

(APIC widths synth): CORE_width=5 SMT_width=1

(APIC synth): PKG_ID=0 CORE_ID=1 SMT_ID=1

(synth) = Intel Xeon E5-1600/2600 (Sandy Bridge-E C2/M1), 32nm

lscpu command example

You will get information about your CPU Architecture on Linux:

$ lscpu

 

Sample outputs:

Architecture:          x86_64

CPU op-mode(s):        32-bit, 64-bit

Byte Order:            Little Endian

CPU(s):                32

On-line CPU(s) list:   0-31

Thread(s) per core:    2

Core(s) per socket:    8

Socket(s):             2

NUMA node(s):          2

Vendor ID:             GenuineIntel

CPU family:            6

Model:                 45

Stepping:              7

CPU MHz:               2000.063

BogoMIPS:              4001.39

Virtualization:        VT-x

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              20480K

NUMA node0 CPU(s):     0-7,16-23

NUMA node1 CPU(s):     8-15,24-31

Of course you can also extract information from /proc/cpuinfo and /dev/cpu/* files:

$ less /proc/cpuinfo

 

 

]]>
https://wiki.shopingserver.com/read-cpuid-instruction-cpu-linux-x86info-cpuid-commands/feed/ 0