> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage Management

> Practical guide to Linux storage fundamentals covering partitioning, filesystems, swap, LVM, mounting, and NFS automounting to troubleshoot and manage disks and network storage.

Imagine a server that’s low on memory and starts swapping heavily. Disk space fills up and a file system needs to be extended. A new disk is added and must be integrated without downtime. A network share becomes unavailable and the system hangs during boot.

These are common, real-world storage problems administrators face every day. This lesson teaches practical, foundational techniques for diagnosing and resolving these issues: basic storage concepts, swap space management, LVM logical volumes, and working with network-attached storage. Finally, you’ll learn how to avoid boot-time failures by using autofs for NFS automounting.

![A dark-themed overview slide showing a vertical list of storage topics (Basic storage, Managing Swap Space, Logical Volumes, Working with Network Attached Storage, Configuring autofs for NFS automounting). The word "Overview" is prominent on the left and a small "Copyright KodeKloud" appears in the corner.](https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Storage-Management/storage-overview-swap-lvm-nfs-autofs.jpg?fit=max\&auto=format\&n=9E2T0ocsNwD7Od8i\&q=85\&s=5390d0b3c6832a3d9f3bb56ea5242143)

## Why storage fundamentals matter

Before jumping into LVM, RAID, or network storage, you must understand how Linux represents and layers storage. That foundation makes troubleshooting predictable and efficient.

Storage in Linux is layered:

* Physical layer: SSDs / HDDs where bits are stored.
* Protocols: ATA, SCSI, Fibre Channel used to communicate with hardware.
* Logical layer: device-mapper, LVM, RAID, MPIO — abstractions that combine or transform physical disks.
* Block devices: `/dev/sda`, `/dev/mapper/*` — the system’s presentable devices.
* File systems: XFS, ext4, Btrfs, VFAT — where files and directories live.

Knowing how these layers interact helps you choose the right tools and avoid mistakes when resizing, replacing, or troubleshooting storage.

![A dark-themed infographic titled "Storage Stack" showing layered storage architecture. Each layer lists components like Cluster/Traditional/Btrfs file systems, block device files, device-mapper (LVM/DM‑RAID/MD/MPIO), ATA/SCSI/FC protocols, and SSDs.](https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Storage-Management/storage-stack-layered-infographic.jpg?fit=max\&auto=format\&n=9E2T0ocsNwD7Od8i\&q=85\&s=3b89d0145484d8718439f682563bc269)

## Disk partitioning basics (MBR vs GPT)

Most disks need a partition table before you create filesystems or use LVM. Two common partition table formats are MBR (msdos) and GPT.

![A side-by-side infographic comparing MBR and GPT partition layouts, with MBR on the left showing a few primary/logical partitions and a 2 TB limit, and GPT on the right showing many partitions (127) and a 9.2 ZB disk capacity.](https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Storage-Management/mbr-vs-gpt-partition-layouts.jpg?fit=max\&auto=format\&n=9E2T0ocsNwD7Od8i\&q=85\&s=732848661a73979f7ce84efb76c40e85)

Key differences:

| Feature | MBR (msdos) | GPT |
| -: | :-: | :- |
| Partition limit | 4 primary (use extended + logical for more) | Typically 128 (configurable) |
| Disk size support | \~2 TiB | Much larger (exabytes) |
| Redundancy | No backup partition table | Stores backup header/partition table at end of disk |
| Modern use | Legacy systems | Recommended for new systems and large disks |

Use GPT for modern systems and large disks. Use MBR only for legacy compatibility.

## Inspecting block devices

Before changing anything, always inspect what the kernel currently sees.

Useful lsblk commands:

```bash theme={null}
# Show all block devices (disks, partitions, LVM, empty devices)
sudo lsblk -a

# Show filesystems, UUIDs, and mount points
sudo lsblk -f
```

Run these as root or with `sudo` so device information is complete.

## Partitioning with parted

On RHEL-based systems, `parted` is a common tool for creating and modifying partition tables and partitions.

Common `parted` interactive commands:

| Command | Description |
| -: | :- |
| `print` | List the current partition layout |
| `mklabel gpt` / `mklabel msdos` | Create a partition table (GPT or MBR) |
| `mkpart` | Create a new partition (specify type, start, end) |
| `rm` | Remove a partition |
| `resizepart` | Resize an existing partition (careful with data) |

Always back up important data before modifying partition tables.

## Choosing a file system

After partitioning, format partitions with a filesystem. Choose based on workload, compatibility, and performance.

![A dark-themed infographic titled "Filesystems" showing four tiles for XFS, Ext4, Ext3, and VFAT. Each tile includes a short description like "High-performance large storage," "Reliable general-purpose filesystem," "Legacy Linux filesystem," and "Cross-platform USB filesystem."](https://mintcdn.com/kodekloud-c4ac6d9a/9E2T0ocsNwD7Od8i/images/Prep-Course-Red-Hat-Certified-System-Administrator-RHCSA/Storage-Management/Storage-Management/filesystems-xfs-ext4-ext3-vfat.jpg?fit=max\&auto=format\&n=9E2T0ocsNwD7Od8i\&q=85\&s=31b418f64dac22de3db157697e9b594a)

Comparison at a glance:

| Filesystem | Use case |
| -: | :- |
| XFS | Default on many enterprise systems; excellent for large files and high-performance large-volume workloads |
| ext4 | General-purpose, reliable, broad compatibility |
| ext3 | Legacy systems; mostly replaced by ext4 |
| VFAT | Cross-platform USB drives and Windows compatibility (no Unix permissions) |

Formatting examples:

```bash theme={null}
# Create an ext4 filesystem
sudo mkfs.ext4 /dev/sdb1

# Create an XFS filesystem
sudo mkfs.xfs /dev/sdb1

# Create a VFAT filesystem (generic)
sudo mkfs.vfat /dev/vdb1

# Create a FAT32 filesystem (for larger USB partitions)
sudo mkfs.vfat -F 32 /dev/vdb1
```

Note: `mkfs.vfat` without `-F 32` can produce FAT12/FAT16 on small media—use `-F 32` for FAT32.

Always run filesystem creation commands on the correct device. A small typo (e.g., `/dev/sdb1` vs `/dev/sda1`) can overwrite data irrecoverably. Back up important data before formatting.

## Mounting filesystems and persistent mounts

A newly formatted partition must be mounted to be accessible.

* `mount /dev/sdb1 /mnt/mydisk` mounts manually (not persistent).
* To mount automatically on boot, add entries to `/etc/fstab`.

Each non-comment line in `/etc/fstab` contains six fields:

1. Device (or `UUID=` or `LABEL=`)
2. Mount point
3. Filesystem type (e.g., `xfs`, `ext4`, `swap`)
4. Mount options (comma-separated; use `defaults` for typical behavior)
5. Dump (0 or 1 — used by dump utility)
6. Pass (fsck order at boot: 0 = skip, 1 = root, 2 = other filesystems)

Example entries:

```fstab theme={null}
# Mount by device path
/dev/sdb1    /mountme    xfs    defaults    0 0

# Mount by UUID (recommended because device names can change)
UUID=0d55de42-4224-42f9-a5ab-3f88894ab722    /mountme2    ext4    defaults    0 0

# Swap by UUID
UUID=9195a088-5d97-4a5b-a448-720f1b1b5ad8    swap    swap    defaults    0 0
```

Why use UUIDs? Device names such as `/dev/sdb` can change after hardware re-enumeration or when adding new disks. Using `UUID=` makes mounts stable across reboots.

Do not place network mounts (NFS, CIFS) in `/etc/fstab` with required (`defaults`) options without testing. If the network resource is unavailable at boot, the system can hang waiting for the mount. Use `autofs` or `noauto,x-systemd.automount` options to avoid boot hangs. This lesson covers configuring `autofs` for safe NFS automounting.

## Quick references and further reading

* man pages: `man lsblk`, `man parted`, `man mkfs`, `man mount`, `man fstab`
* Red Hat Storage and File Systems documentation: [https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/latest/html/storage\_administration\_guide/](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/latest/html/storage_administration_guide/)
* GNU Parted: [https://www.gnu.org/software/parted/](https://www.gnu.org/software/parted/)

With these fundamentals in place — knowing how disks, partitions, block devices, and filesystems relate — you’ll be ready to manage swap, create and resize LVM volumes, and safely work with network-attached storage (including using autofs to prevent boot failures).

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/red-hat-certified-system-administrator-rhcsa/module/2f9323b6-f8cf-4f7e-94e3-a136743e7970/lesson/be2ecf7c-83f2-4285-9ec5-975d9a4e0cfa)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.