Storage and Disks

Help and Info~4 minView script

Curated reference for storage inspection on Proxmox hosts: block devices, partitions, mounts, LVM volumes, Proxmox storage configuration, and a few VM disk operations (importdisk, qemu-img convert).

Quick disk inventory

lsblk shows block devices and partitions in a tree. Inspect persistent identifiers with ls -lh /dev/disk/by-id/: these normally remain stable across reboots and device reordering for the same disk. Replacing a disk or changing the way a controller exposes its identity can change its by-id path.

Disk Information

CommandDescriptionAction
lsblkList block devices and partitions
fdisk -lList disks with detailed info
blkidShow UUID and filesystem type of block devices
ls -lh /dev/disk/by-id/List disk persistent identifiers
parted -lDetailed partition layout with GPT info

Storage Usage

CommandDescriptionAction
df -hShow disk usage by mount point
du -sh /pathShow size of a directory
mount | grep ^/devShow mounted storage devices
cat /proc/mountsShow all active mounts from the kernel

LVM Management

CommandDescriptionAction
pvdisplayDisplay physical volumes (LVM)
vgdisplayDisplay volume groups (LVM)
lvdisplayDisplay logical volumes (LVM)
pvsConcise output of physical volumes
vgsConcise output of volume groups
lvsConcise output of logical volumes

Proxmox Storage

CommandDescriptionAction
cat /etc/pve/storage.cfgShow Proxmox storage configuration
pvesm statusShow status of all storage pools
pvesm status --enabled 1List enabled configured storage
pvesm list <storage>List content of specific storage
pvesm scan nfs <server>Discover NFS exports on a server

Disk Actions

CommandDescriptionAction
qm importdisk <vmid> <image_path> <storage>Import disk image as an unused disk for the VM; attach it separately
qm set <vmid> -<bus><index> <disk_path>Assign physical disk to VM (passthrough mode)
qemu-img convert -O <format> <input> <output>Convert an offline disk image format

SMART Disk Health

CommandDescriptionAction
smartctl --scanList SMART-capable devices on the host
smartctl -i /dev/<disk>Basic device info (model, firmware, serial)
smartctl -H /dev/<disk>Quick health check — overall PASSED / FAILED
smartctl -A /dev/<disk>SMART attributes only (raw values, thresholds)
smartctl -a /dev/<disk>Full SMART info — info + attributes + self-test log
smartctl -t short /dev/<disk>Start short self-test (~2 minutes, runs in background)
smartctl -t long /dev/<disk>Start long self-test (hours, runs in background)
smartctl -l selftest /dev/<disk>View self-test log (results of past tests)
smartctl -X /dev/<disk>Abort the running self-test

NVMe Disk Health

CommandDescriptionAction
nvme listList NVMe devices visible to the kernel
nvme smart-log /dev/<nvme>NVMe-specific SMART log (temperature, wear, errors)
nvme id-ctrl /dev/<nvme>Controller info (model, firmware, capabilities)
nvme error-log /dev/<nvme>Recent NVMe error log entries

LVM short vs long commands

Both forms are available. pvs / vgs / lvs produce compact tables with one row per physical volume, volume group or logical volume respectively. pvdisplay / vgdisplay / lvdisplay provide more detailed multi-line output. The short forms are convenient for everyday checks.

SMART for SATA/SAS vs NVMe

SATA / SAS disks, including SSDs, can be inspected with smartctl from smartmontools (installed by default on Proxmox). Specify the device, for example /dev/sda or /dev/sdb. NVMe disks use a different native protocol. smartctl also supports them, while nvme from nvme-cli provides NVMe-specific controller, namespace and health queries. Install it with apt install nvme-cli if absent.

Self-tests run in the background

On supported drives, smartctl -t short /dev/<disk> and smartctl -t long /dev/<disk> start background tests and return immediately. Check progress with smartctl -a /dev/<disk> (look for "Self-test routine in progress") or wait and read smartctl -l selftest /dev/<disk>. Short tests commonly take about two minutes; long tests can take hours. The disk remains usable, but testing can reduce I/O performance.

Related