https://drive.google.com/file/d/1tcC1eOqQZtmOXgEkqUYVzdFuU4xKepND/view?usp=sharing

1. Discovering Disks and Hardware

Explanation

Before managing storage, identify available disks and their details.

Key Commands

lsblk                     # List block devices (disks & partitions)
fdisk -l                  # List partition tables (MBR only)
dmesg | tail -20          # View recent kernel messages (e.g., disk detection)
lsscsi                    # List SCSI/SATA/NVMe devices
lshw -class disk          # Detailed hardware info (install with `sudo yum install lshw`)
cat /proc/scsi/scsi       # Legacy SCSI device info (may be empty on modern systems)

Lab Steps

  1. List current disks:

    lsblk
    
    
  2. Check for new hardware:

    dmesg | grep -i sd
    
    

2. Rescanning for New Disks (Hot-Add)

Explanation

When attaching a disk to a running system (e.g., VM or hot-swap server), rescan the SCSI/SATA bus to detect it.

Rescan Command

# Rescan all SCSI hosts
ls /sysclass/scsi_host/ | while read host; do
  echo "- - -" > /sysclass/scsi_host/$host/scan
done

✅ Note: - - - means: channel, target, LUN (wildcard = scan all).

Verify Detection

lsblk    # New disk (e.g., /dev/sdb) should appear