Skip to main content

How to Check Hardware Details on Linux:

 Whether you're troubleshooting hardware issues, planning an upgrade, or just curious about your system’s specifications, Linux provides a variety of commands to gather comprehensive hardware information. Here are some essential commands:

1.  Use lscpu to get detailed information about the CPU, including architecture, cores, threads, and CPU speeds.

# lscpu                                             

2. The lshw command provides a complete overview of hardware configuration, including CPU, memory, storage, and network. You’ll likely need superuser privileges to run it.
# sudo lshw
                                                                                                                                  
3. For a clear overview of block devices, partitions, and mounted filesystems, lsblk is a helpful command.
# lsblk
                                                                                                                                         
4. The dmidecode command extracts information from the system's DMI (Desktop Management Interface) table, displaying BIOS, processor, memory, and other hardware details.
# sudo dmidecode
                                                                                                                      

   The dmidecode command provides detailed information about your system's hardware components by reading the DMI (Desktop Management Interface) tables. Here's what you can typically view using dmidecode:
# sudo dmidecode -t bios #BIOS Information # sudo dmidecode -t system #System Information # sudo dmidecode -t baseboard #Baseboard (Motherboard) Information # sudo dmidecode -t processor #Processor Information # sudo dmidecode -t memory #Memory Information # sudo dmidecode -t cache #Cache Information # sudo dmidecode -t chassis #Chassis Information # sudo dmidecode -t connector #Connector and Port Information # sudo dmidecode -t battery #Battery Information (for laptops).

5. To view information about PCI devices, such as graphics cards and network interfaces, use lspci.
# lspci
                                                                                                                                         
6. Use lsusb to list details of all USB devices connected to the system, such as keyboards, mice, and external drives.
# lsusb
                                                                                                                                        
7. The free command shows memory usage details, while the -h option provides the output in a human-readable format.
# free -h
                                                                                                                                     
8. To view filesystem disk space usage, df with the -h flag will display disk usage in a readable format.
# df -h
                                                                                                                                      
9. If you prefer a more visual output, inxi provides a nice summary of CPU, graphics, audio, and network details. You might need to install it first:
# sudo apt install inxi # For Debian/Ubuntu-based systems # inxi -Fxz
                                                                                                                             
IPMI (Intelligent Platform Management Interface) commands are used for managing and monitoring server hardware. These commands can be issued with the ipmitool utility, which communicates with the BMC (Baseboard Management Controller) on the server. Below are some commonly used IPMI commands for various hardware management tasks:

1. Get System Information:
    Check BMC status: 
# ipmitool chassis status
    Show firmware versions: 
# ipmitool mc info
    Display all system information: 
# ipmitool sdr list all

2. Power Management Commands:
    Power on the server: 
# ipmitool chassis power on
    Power off the server:
# ipmitool chassis power off
    Power cycle (reboot) the server: 
# ipmitool chassis power cycle
    Check current power status: 
# ipmitool chassis power status

3. Monitor Hardware Health:
    Get sensor readings (temperature, fan speed, etc.): 
# ipmitool sensor list
    Check individual sensor data:
# ipmitool sensor get <sensor_name>
    Display all sensor data in real-time: 
# watch ipmitool sensor

4. View Event Log:    
     
Show event log entries:
# ipmitool sel list
     Clear the event log: 
# ipmitool sel clear
     Show the last N entries from the log: 
# ipmitool sel list | tail -n <N>

5. Network Configuration for BMC:  
     
Show the BMC network configuration: 
# ipmitool lan print 1
     Set a static IP for the BMC:
# ipmitool lan set 1 ipsrc static # ipmitool lan set 1 ipaddr <IP_ADDRESS> # ipmitool lan set 1 netmask <NETMASK> # ipmitool lan set 1 defgw ipaddr <GATEWAY>

6. User Management:   
     List existing IPMI users: 
# ipmitool user list 1
     Add a new user:
# ipmitool user set name <user_id> <username> # ipmitool user set password <user_id> <password> # ipmitool user enable <user_id>
     Set user privileges: 
# ipmitool user priv <user_id> <privilege_level> 1

7. Remote Console Access (SOL): 
    Enable SOL (Serial Over LAN): 
# ipmitool sol activate
    Deactivate SOL session:  
# ipmitool sol deactivate
    
8. FRU Information (Field Replaceable Units):    
     
Display FRU (Field Replaceable Unit) details: 
# ipmitool fru

9. Network configuration details for the BMC:
   
To display network configuration details for the BMC (Baseboard Management Controller) on a server: 
# ipmitool lan print

These commands will help you manage and monitor your servers, providing important information on their health and status. If you don’t have ipmitool installed, you can usually install it with the following:
           # On CentOS/RHEL
# sudo yum install -y ipmitool
           # On Ubuntu/Debian
# sudo apt-get install -y ipmitool

Each of these commands provides specific insights into the various components of your system. Combining them will give you a comprehensive understanding of your Linux hardware setup!

Comments

Popular posts from this blog

temp-1

  πŸ”§ vast_id Configuration Key: vast_id Description This section defines the VAST ID , a unique numeric identifier used by internal systems for asset tracking, automation, or integration with enterprise management platforms. It helps associate the server with inventory records, monitoring tools, or deployment workflows. ✅ Used during provisioning to register the system in centralized databases or orchestration systems. JSON Format json 1 "vast_id" : 12194 ✅ Can also be provided as a string: json 1 "vast_id" : "12194" Field Reference vast_id String or Integer Unique identifier for the system in VAST (Verizon Asset Systems Tracker) 12194 ✅ Must be non-empty and numeric — leading zeros may be stripped depending on system. Validations Enforced vast_id  is required and must be a non-empty string or integer Ensures the field is present and contains usable data If  vast_id  is a string, it must not be blank or whitespace-only Prevents " " , "...

testing

09052025 T-1 { "volume_groups" : { "vgroot" : { "vgsize" : "304G" , "fs_type" : "xfs" } } , "logical_volumes" : { "root" : { "lvroot" : { "vgname" : "vgroot" , "lvname" : "lvroot" , "lvsize" : "12G" , "mountpoint" : "/" , "purpose" : "root filesystem" , "disk" : 1 , "partition" : 2 } } , "swap" : { "lvswap" : { "vgname" : "vgroot" , "lvname" : "lvswap" , "lvsize" : "4G" , "mountpoint" : "NA" , "purpose" : "swap" , "disk" : 1 , "partit...

temp

 {   "_id": {     "$oid": "6841e4b0fd270b2ab92d7eaa"   },   // πŸ“Œ [Auto-generated]   // Description: Unique system identifier for internal use (MongoDB ObjectId).   // Type: ObjectId (string)   // Required: No (automatically handled)   "vast_id": "21452",   // πŸ“Œ [Required]   // Description: Your unique request ID or reference number.   // Type: string   // Format: Numeric string (e.g., "21452")   // Example: "21452"   "env": "dev",   // πŸ“Œ [Required]   // Description: The environment where the VM will be deployed.   // Type: string   // Allowed values: "dev", "qa", "uat", "prod"   // Example: "dev" for development, "prod" for production   "ver": "0.2",   // πŸ“Œ [Do Not Modify]   // Description: Template version. Used by automation to ensure compatibility.   // Type: string   // Format: Semantic versioning (e.g., "...