Displaying disk information in Linux provides insight into how storage is laid out, which devices back important filesystems, and how much capacity remains available. Clear visibility into disks and partitions avoids unexpected outages when volumes fill and simplifies tasks like extending storage or attaching new devices.
Linux exposes block devices through the kernel and presents them via tools such as lsblk, blkid, hdparm, and smartctl. These utilities reveal disk topology, identifiers, firmware details, and health data, while commands like df and dmesg show mounted filesystems and recent kernel messages related to storage.
Many disk utilities require sudo to access raw devices and controller state, and some operations can generate noticeable I/O load. Careful attention to device names such as /dev/sda or /dev/nvme0n1 reduces the risk of targeting the wrong disk when running more advanced or destructive commands outside of information gathering.
Steps to list and view disk information:
- Open a terminal with access to a user account that can run commands with sudo.
$ whoami user
- List all block devices to see disks, partitions, and mount points in a single overview.
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 512M 0 loop /mnt/bench nbd0 43:0 0 0B 0 disk nbd1 43:32 0 0B 0 disk nbd2 43:64 0 0B 0 disk nbd3 43:96 0 0B 0 disk nbd4 43:128 0 0B 0 disk nbd5 43:160 0 0B 0 disk nbd6 43:192 0 0B 0 disk nbd7 43:224 0 0B 0 disk vda 254:0 0 1.8T 0 disk `-vda1 254:1 0 1.8T 0 part /etc/hosts /etc/hostname /etc/resolv.conf vdb 254:16 0 606.5M 1 disk nbd8 43:256 0 0B 0 disk nbd9 43:288 0 0B 0 disk nbd10 43:320 0 0B 0 disk nbd11 43:352 0 0B 0 disk nbd12 43:384 0 0B 0 disk nbd13 43:416 0 0B 0 disk nbd14 43:448 0 0B 0 disk nbd15 43:480 0 0B 0 diskEntries where TYPE is disk are whole devices, while entries where TYPE is part are partitions on those disks.
- Show only whole disks with their model and size for a concise hardware list.
$ lsblk -d -o NAME,MODEL,SIZE,TYPE NAME MODEL SIZE TYPE loop0 512M loop nbd0 0B disk nbd1 0B disk nbd2 0B disk nbd3 0B disk nbd4 0B disk nbd5 0B disk nbd6 0B disk nbd7 0B disk vda 1.8T disk vdb 606.5M disk nbd8 0B disk nbd9 0B disk nbd10 0B disk nbd11 0B disk nbd12 0B disk nbd13 0B disk nbd14 0B disk nbd15 0B disk
- Install smartmontools if smartctl is not yet available on the system.
$ sudo apt update WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Hit:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease Hit:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease Hit:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease Hit:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease Reading package lists... Building dependency tree... Reading state information... 5 packages can be upgraded. Run 'apt list --upgradable' to see them. $ sudo apt install --assume-yes smartmontools WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Reading package lists... Building dependency tree... Reading state information... smartmontools is already the newest version (7.4-2build1). 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
On RHEL or Fedora, install with sudo dnf install smartmontools.
- Display detailed hardware information for a specific disk, including model, serial number, firmware revision, and rotation speed.
$ sudo hdparm -I /dev/vdb /dev/vdb:
Some virtualized disks expose minimal identify data, so the hdparm -I output may be limited or empty.
- Run a read-only performance test on the disk to estimate cached and buffered read speeds.
$ sudo hdparm -tT /dev/vdb /dev/vdb: Timing cached reads: 50114 MB in 1.99 seconds = 25159.01 MB/sec Timing buffered disk reads: 606 MB in 0.11 seconds = 5548.33 MB/sec
Benchmarking with hdparm increases I/O load on the target disk, which can briefly slow other workloads using the same storage.
- Check the SMART health status that the disk firmware reports for early signs of failure.
$ sudo smartctl --health /dev/vdb smartctl 7.4 2023-08-01 r5530 [aarch64-linux-6.12.54-linuxkit] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org /dev/vdb: Unable to detect device type Please specify device type with the -d option. Use smartctl -h to get a usage summary
Some virtualized disks do not expose SMART data directly; try smartctl -d <type> or run the command on the host if the device type cannot be detected.
- Show filesystem UUIDs, labels, and types for disks and partitions.
$ blkid /dev/loop0: UUID="6c2b5271-7333-4ce9-a493-21ac96c28bb0" TYPE="swap" /dev/vdb: UUID="ab937823-7fcd-4a20-bf31-2ddb0fb68612" BLOCK_SIZE="4096" TYPE="erofs" /dev/vda1: UUID="0f29d829-7b21-4784-8807-a473ed0d4528" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7bc2caaf-01"
UUIDs provide stable identifiers for filesystems and are commonly used in /etc/fstab entries.
- Display disk usage and free space for all mounted filesystems in human-readable units.
$ df -h Filesystem Size Used Avail Use% Mounted on overlay 1.8T 17G 1.7T 1% / tmpfs 64M 0 64M 0% /dev shm 64M 0 64M 0% /dev/shm /dev/vda1 1.8T 17G 1.7T 1% /etc/hosts tmpfs 4.7G 11M 4.7G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock /dev/loop0 488M 24K 452M 1% /mnt/bench
- Attempt to read detailed SMART attributes (including temperature when supported) from the disk.
$ sudo smartctl -a -d scsi -T permissive /dev/vdb smartctl 7.4 2023-08-01 r5530 [aarch64-linux-6.12.54-linuxkit] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org Standard Inquiry (36 bytes) failed [Inappropriate ioctl for device] Retrying with a 64 byte Standard Inquiry Standard Inquiry (64 bytes) failed [Inappropriate ioctl for device] === START OF READ SMART DATA SECTION === Request Sense failed, [Inappropriate ioctl for device] Read defect list: asked for grown list but didn't get it Error Counter logging not supported Device does not support Self Test logging
Some virtualized disks do not expose temperature or attribute data; run smartctl on the host or with an appropriate -d type when available.
- Review disk-related kernel messages for the selected device to spot connection issues or errors.
$ sudo dmesg | grep vdb [ 0.000000] Kernel command line: init=/initd loglevel=1 root=/dev/vdb rootfstype=erofs ro vsyscall=emulate panic=0 eth0.dhcp eth1.dhcp linuxkit.unified_cgroup_hierarchy=1 console=hvc0 virtio_net.disable_csum=1 vpnkit.connect=connect://2/1999 com.docker.VMID=eec37bc6-f935-4764-9595-d603b9cbe364 [ 0.171534] virtio_blk virtio3: [vdb] 1242056 512-byte logical blocks (636 MB/606 MiB) [ 0.219491] erofs: (device vdb): mounted with root inode @ nid 36.
Entries in dmesg reveal how the kernel detected the disk and may include warnings about I/O errors or link problems.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
