How to list disks , USB and other hardware

To **discover drives on a Linux system**, here are several essential commands and tools you can use, each serving a slightly different purpose:

## βœ… **Common Commands to Discover Drives**

### πŸ” 1. `lsblk` – List Block Devices
“`bash
lsblk
“`
– Shows all disks and partitions in a tree-like structure.
– Great overview of drive names, sizes, and mount points.

Add `-f` to show file system info:
“`bash
lsblk -f
“`

### 🧾 2. `fdisk -l` – Detailed Disk Info
“`bash
sudo fdisk -l
“`
– Lists all partitions on all detected drives.
– Shows partition sizes and types.
– Useful for both internal and external drives.

### 🧩 3. `blkid` – Show UUIDs and File Systems
“`bash
sudo blkid
“`
– Shows block devices with UUIDs and file system types.
– Helps with identifying drives for mounting.

### πŸ“¦ 4. `df -h` – Show Mounted Drives and Usage
“`bash
df -h
“`
– Displays all mounted file systems with used/available space.
– Doesn’t show unmounted drives.

### πŸ“ 5. `ls /dev/sd*` – List Disk Device Files
“`bash
ls /dev/sd*
“`
– Lists devices like `/dev/sda`, `/dev/sdb1`, etc.
– NVMe drives will appear as `/dev/nvme0n1`, `/dev/nvme0n1p1`, etc.

### πŸ–₯️ 6. `lshw -class disk` – Hardware Info
“`bash
sudo lshw -class disk
“`
– Detailed info including vendor, size, and bus type (e.g., SATA, NVMe).

You can also run:
“`bash
sudo lshw -short | grep disk
“`

### 🧠 7. `dmesg` – Kernel Messages for Drive Detection
“`bash
dmesg | grep -i sd
“`
– Useful after plugging in a new drive to see detection logs.

### πŸ”Œ 8. For USB or External Drives
“`bash
lsusb
“`
– Lists connected USB devices (including external drives).

### Optional Tools for GUI or Interactive Use
– **`gnome-disks`** – Disk utility for GNOME (GUI).
– **`ncdu`** – For analyzing disk space in terminal.
– **`parted`**, **`gparted`** – Tools for partition management.

Let me know if you’re trying to find **new, unmounted drives**, or preparing to **mount or format a new disk**, and I’ll guide you step by step.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top