Disk and File System Commands in Linux (original) (raw)

Last Updated : 7 Jan, 2026

Disk and file system commands in Linux are used to manage disks, partitions, and file systems. These commands help administrators monitor disk usage, create and modify partitions, mount file systems, perform backups, and restore data safely.

Disk and file system commands are essential for:

Below are some commonly used Disk and File System Commands in Linux.

disk_and_file_system_commands

1. cfdisk

The cfdisk command is an interactive, text-based disk partitioning utility.

**Syntax:

cfdisk [device]

**Example:

cfdisk /dev/sda

2. df

The df command displays disk space usage of mounted file systems.

**Syntax:

df [options] [filesystem]

**Example:

df -h

file

3. dosfsck

The dosfsck command checks and repairs FAT (MS-DOS) file systems.

**Syntax:

dosfsck [options] device

**Example:

sudo dosfsck -a /dev/sdb1

This command automatically repair the filesystem on a FAT-formatted partition, use the -a option

4. dump

The dump command is used to create backups of Linux file systems.

**Syntax:

dump [options] filesystem

**Example:

sudo dump 0uf /dev/qft0 /dev/sda6

Lightbox

This shows the dump command performing a level-0 (full) backup of the /dev/sda6 filesystem to the tape device /dev/qft0. It displays the backup progress, data size, transfer speed, completion status, and then prompts to mount the next volume to continue the backup process.

5. dumpe2fs

The dumpe2fs command displays detailed information about ext file systems.

**Syntax:

dumpe2fs [options] device

**Example:

dumpe2fs /dev/sda2

file

6. fdisk

The fdisk command is used to create, delete, and manage disk partitions.

**Syntax:

fdisk [device]

**Example:

fdisk /dev/sda

This command is used to view all disk partitions on device '/dev/sda'.

7. mount

The mount command attaches a file system to a directory.

**Syntax:

mount [options] device directory

**Example:

mount

list mounted file system

The mount command allows us to view this information easily:

8. restore

The restore command is used to recover files from backups created using dump.

**Syntax:

restore [options]

**Example:

restore

It will be going to print the general syntax of the command along with the various options that can be used with the restore command.

9. sync

The sync command forces cached data to be written to disk.

**Syntax:

sync

**Example:

sync