UNDER DEVELOPMENT... Learning never stops. Your comments, encouragement or criticism to my blog tkokhing.github.io are most welcome to help me grow. Thank you! ...UNDER DEVELOPMENT

Home / topics / AtoZ / terrified-by-linux / chapter1-2


Chapter 1-2: Hardware and Disk Management

Cover Image for Chapter 1-2: Hardware and Disk Management
tkokhing
tkokhing
Posted on:

Chapter 1-2: Hardware and Disk Management

Whether you're setting up a new system or troubleshooting performance issues, it's critical to understand the underlying hardware—especially storage devices and their behavior.

On this page, we explore how Linux and Windows expose low-level disk information and performance stats through the command line. These tools help you understand what's connected, how full your disks are, and how actively they’re being used.


💽 4. List Connected Storage Devices

✅ Purpose

Lists connected drives, partitions, and mount points—useful for identifying USB drives, internal disks, or new volumes.


💻 Windows

C:\> wmic logicaldisk get name

📋 Sample Output

Name
C:
D:
E:
📝 Note:
This command shows logical drives only — you won’t see hardware-level details like disk names or partition types. For deeper inspection, use diskpart or the Disk Management GUI.

🐧 Linux

$ lsblk

📋 Sample Output

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   500G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0   488G  0 part /
└─sda3   8:3    0    12G  0 part [SWAP]
sdb      8:16   1    32G  0 disk 
└─sdb1   8:17   1    32G  0 part /media/usb
💡 Tip:
Use lsblk -f to show filesystem types and labels. Also try lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL for custom output.

📊 5. Check Disk Usage

✅ Purpose

Displays how much space is used vs. available on each partition. Essential for monitoring capacity or finding storage bottlenecks.


💻 Windows

C:\> Get-PSDrive

📋 Sample Output

Name           Used      Free      Provider      Root
----           ----      ----      --------      ----
C              92.4 GB   30.1 GB   FileSystem    C:\
D              14.0 GB   45.9 GB   FileSystem    D:\
📝 Note:
Get-PSDrive is available in PowerShell and provides a more readable alternative to chkdsk. It won't check for errors—just space usage.

🐧 Linux

$ df -h

📋 Sample Output

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       488G  102G  361G  23% /
/dev/sda1       512M   45M  467M   9% /boot/efi
/dev/sdb1        32G   10G   22G  32% /media/usb
📝 Note:
Use the -h flag for human-readable output (GB/MB instead of raw bytes). If you want per-directory usage: du -sh *
⚠️ Alert:
A disk usage over 90% (especially on /) may affect system stability. Clean logs or temp files as needed.

🚀 6. Monitor Disk I/O Activity

✅ Purpose

Measures how actively your disks are reading and writing data—key for diagnosing performance issues like high I/O wait.


💻 Windows

C:\> typeperf "\PhysicalDisk(*)\Disk Transfers/sec"

📋 Sample Output (Partial)

"(PDisk(_Total))\Disk Transfers/sec","(PDisk(0 C:))\Disk Transfers/sec"
"04/24/2025 15:22:12.902","12.000000","15.000000"
"04/24/2025 15:22:13.902","10.000000","13.000000"
📝 Note:
This command captures real-time disk I/O data. Use Ctrl+C to stop it. Consider resmon (Resource Monitor) for a GUI-based view.

🐧 Linux

$ iostat

📋 Sample Output

Linux 5.15.0-89-generic (mymachine)   04/24/25        _x86_64_

Device            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda              3.44        24.52        92.18     292840     1100780
sdb              0.00         0.00         0.00          0           0
💡 Tip:
Install with sudo apt install sysstat if iostat is missing. Use iostat -x 1 for extended stats every second.
⚠️ Alert:
If the tps (transfers per second) or write rates are constantly high and your system feels sluggish, investigate background processes (like logging or swap activity).

🧩 Summary

FeatureWindows CommandLinux Command
List Driveswmic logicaldisk get namelsblk
Check Disk UsageGet-PSDrive (PowerShell)df -h, du -sh
Monitor Disk I/Otypeperf "\PhysicalDisk...\Disk..."iostat

Linux’s tooling allows for granular control and more detailed reporting at the command line, making it ideal for engineers and sysadmins who need precise visibility into disk behavior.


✅ Coming Up Next

In Part 3: Network Management, we shall explore how to list interfaces, view open ports, and monitor network traffic on Linux with CLI tools comparable to Windows.

Stay tuned.