How to turn off laptop display in linux ?

Today, one of my friends gave me this tip, so sharing with my friends… To turn off laptop display you can execute below command  [root@node] sleep 1; xset dpms force off Above would turn off the laptop display so that you can save power and keep jobs running in the bg. Any key press or …

Read more

Validate hypervisor driver capabilities using virt-host-validate in fedora

libvirt-client package provides a binary called ‘virt-host-validate’. This tool validates that the host is configured in a suitable way to run libvirt hypervisor drivers. If invoked without any arguments it will check support for all hypervisor drivers it is aware of. Optionally it can be given a particular   hypervisor type (‘qemu’ or ‘lxc’) to restrict …

Read more

Linux command cheat sheet

Below Linux commands will be handy when you work on a Linux system. [pdf id=5408] Hope it helped, I am not sure how it landed to me though :).

ext4 partition size / free space discrepancies

Let me explain the issue first: I was not able to ‘save’ a file in my ‘home’ directory and it was complaining that, there is NO SPACE, So, I checked “df” output [root@humbles-lap home]# df -kh Filesystem                     Size  Used Avail Use% Mounted on rootfs                          50G   42G  5.6G  89% / devtmpfs                       3.9G     0  3.9G   0% /dev …

Read more

‘lscpu’ command to check ‘virtualization’ support of CPU/processor

Somebody was asking me, how to know whether the cpu support ‘virtualization’ or not.  Till now I was answering , ‘look at ‘svm or vmx’ flag in /proc/cpuinfo. For Intel, it should show ‘vmx’ and for AMD it should show ‘svm’. But recently I have noticed a command called ‘lscpu’ which will list the specifications …

Read more

How to get BIOS, Motherboard, Processor..etc informaion in a linux system ?

Specifically for BIOS information below commands can be used

#biosdecode

[root@humbles-lap Desktop]# biosdecode
# biosdecode 2.11
ACPI 2.0 present.
OEM Identifier: Sony
RSD Table 32-bit Address: 0xDEF1CF18
XSD Table 64-bit Address: 0x00000000DEF1CE18
SMBIOS 2.6 present.
Structure Table Length: 731 bytes
Structure Table Address: 0x000EBCA0
Number Of Structures: 17
Maximum Structure Size: 113 bytes
PNP BIOS 1.0 present.
Event Notification: Not Supported
Real Mode 16-bit Code Address: F000:BA66
Real Mode 16-bit Data Address: F000:0000
16-bit Protected Mode Code Address: 0x000FBA8E
16-bit Protected Mode Data Address: 0x000F0000
PCI Interrupt Routing 1.0 present.
Router ID: 00:1f.0
Exclusive IRQs: None
Compatible Router: 8086:2912
Slot Entry 1: ID 00:1f, on-board
Slot Entry 2: ID 00:1d, on-board
Slot Entry 3: ID 00:1a, on-board
Slot Entry 4: ID 00:1b, on-board
Slot Entry 5: ID 00:1c, on-board
Slot Entry 6: ID 02:00, slot number 33
Slot Entry 7: ID 00:16, on-board
Slot Entry 8: ID 03:00, slot number 255
Slot Entry 9: ID 00:02, on-board
Slot Entry 10: ID 04:00, slot number 8
Slot Entry 11: ID 05:00, slot number 16
Slot Entry 12: ID 00:01, on-board
Slot Entry 13: ID 01:00, slot number 16
Slot Entry 14: ID 00:03, on-board
[root@humbles-lap Desktop]#

Then comes “dmidecode” with specific options.. The interesting switch of “dmidecode” is “-t” here.. You can use the same option with specifying a “TYPE” value with it..

Below are the different “TYPES” which can be used with “-t” option..

Type   Information
────────────────────────────────────────
0   BIOS
1   System
2   Base Board
3   Chassis
4   Processor
5   Memory Controller
6   Memory Module
7   Cache
8   Port Connector
9   System Slots
10   On Board Devices
11   OEM Strings
12   System Configuration Options
13   BIOS Language
14   Group Associations
15   System Event Log

********** Truncated.. Refer #man dmidecode for more information..

For ex: To get Processor information..

[root@humbles-lap Desktop]# dmidecode -t 4
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: N/A
Type: Central Processor
Family: Core i5
Manufacturer: GenuineIntel
ID: 52 06 02 00 FF FB EB BF
Signature: Type 0, Family 6, Model 37, Stepping 2
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)

***********

Thats it…

What are Logical block size and Physical block size and How to find it ?

In simple words, logical block size is the unit used by the  ‘kernel’ for read/write operations.. Physical block sizes are the ones which ‘disk controllers’ use for read/write operations.

Is there any way to display logical/ physical block sizes in your system?

Yep, there are:

1) Fetch this information from the ‘sysfs’:

‘sda’ is the example device

[terminal]
[root@humbles-lap ]# cat /sys/block/sda/queue/logical_block_size
512
[root@humbles-lap ]# cat /sys/block/sda/queue/physical_block_size
512
[root@humbles-lap ]#

[/terminal]

2) Use ‘blockdev’ command to display the same information.

[terminal]
[root@humbles-lap ]# rpm -qf `which blockdev`
util-linux-XXXX
[root@humbles-lap ]#

–getss get logical block (sector) size
–getpbsz get physical block (sector) size

[root@humbles-lap ]# blockdev –getss /dev/sda
512
[root@humbles-lap ]# blockdev –getpbsz /dev/sda
512
[root@humbles-lap ]#

[/terminal]