Skip to content

Disks and storage

Finding out which disks there are and how full they are, partitioning and formatting new disks, mounting them permanently, growing file systems, working with LVM and checking disk health.

Basics: Block devices, partition tables, file systems, /etc/fstab and LVM

Overview

  • lsblk


    All disks and partitions as a tree.

  • blkid


    UUID, label and type of file systems.

  • findmnt


    Mounted file systems, check /etc/fstab.

  • df


    Used and free space per file system.

  • du


    Find out what takes up the space.

  • ncdu


    Interactive disk usage browser.

Partition and format

  • fdisk


    Show and edit partition tables.

  • parted


    Partition in one command line.

  • mkfs


    Create a file system.

  • mkswap


    Prepare swap space.

  • swapon


    Activate and show swap.

Mount

  • mount


    Mount file systems.

  • umount


    Unmount file systems.

Check and grow

LVM

  • pvs


    Physical volumes of LVM.

  • vgs


    Volume groups of LVM.

  • lvs


    Logical volumes of LVM.

  • lvcreate


    Create a logical volume.

  • lvextend


    Grow a volume and its file system.

RAID

  • mdadm


    Mirror disks with software RAID.

Health