Linux - Linux Storage Architecture
Linux storage is built in layers, and each layer has a specific purpose.
From physical disks → partitions → LVM → RAID → filesystem → mount points → applications.
Let’s break it down simply.
1. Physical Storage Layer
This is the hardware layer.
Examples:
-
HDD (
/dev/sda) -
SSD (
/dev/nvme0n1) -
USB drives (
/dev/sdb) -
SAN/NAS devices (iSCSI, Fibre Channel)
Linux detects storage as block devices, accessible under:
/dev/
Examples:
-
/dev/sda -
/dev/sdb -
/dev/nvme0n1
You can list them with:
lsblk
2. Partition Layer
Each disk can be divided into partitions, using:
-
MBR (older)
-
GPT (modern)
Tools:fdisk, gdisk, parted
Example partitions:
-
/dev/sda1 -
/dev/sda2
Partitioning is used to separate:
-
OS
-
Home directory
-
Swap
-
Data storage
3. RAID Layer (Optional)
RAID combines multiple physical disks to improve performance, redundancy, or capacity.
Example RAID array device:
-
/dev/md0
Tools:
-
Hardware RAID (RAID controller)
-
Software RAID (
mdadm)
RAID sits on top of physical disks, but below LVM/filesystem.
4. LVM Layer (Logical Volume Manager) (Optional but common)
LVM gives flexible storage management:
-
Resize filesystem easily
-
Combine disks
-
Create snapshots
-
Add/remove storage dynamically
Components:
-
PV (Physical Volume) → created from partitions/disks
-
VG (Volume Group) → storage pool
-
LV (Logical Volume) → partitions inside VG
Example:
-
Physical:
/dev/sda1 -
PV: created with
pvcreate /dev/sda1 -
VG:
/dev/vgdata -
LV:
/dev/vgdata/lvhome
LVM sits above RAID and below filesystem.
5. Filesystem Layer
Once you have a partition or logical volume, you format it with a filesystem.
Common Linux filesystems:
-
ext4 (most common)
-
xfs (enterprise, performance)
-
btrfs (snapshots + compression)
-
vfat/ntfs (USB/Windows)
Command example:
mkfs.ext4 /dev/vgdata/lvhome
The filesystem manages:
-
File storage
-
Directory structure
-
Journaling
-
Metadata
6. Mount Layer
Mounting makes the filesystem accessible from the Linux directory tree.
Linux uses a single unified directory tree starting at /.
Mount command:
mount /dev/vgdata/lvhome /home
Mount points can be:
-
/home -
/var -
/srv -
/mnt/data -
/media/usb
Persistent mounts go into:
/etc/fstab
7. Application Layer
Finally, applications and users access files using:
-
Commands (cp, mv, ls)
-
Services (databases, webservers)
-
APIs
They don’t care about:
-
RAID
-
LVM
-
Hardware
-
Filesystem
… these are abstracted by the OS.
Linux Storage Architecture – Layer Diagram
┌───────────────────────────────┐
│ Applications │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ Mount Points (/mnt) │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ Filesystems (ext4) │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ LVM (PV/VG/LV) │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ RAID Arrays (/dev/md0) │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ Partitions (/dev/sda1/sda2) │
└───────────────▲───────────────┘
│
┌───────────────┴───────────────┐
│ Physical Disks (/dev/sda) │
└───────────────────────────────┘
Putting It All Together — Example Path
A typical server might look like:
Physical Disk → Partition → RAID 5 → LVM → ext4 → Mounted on /data → App uses it
Example device:
/dev/md0 → /dev/vgdata/lvdata → /data
Advantages of This Layered Architecture
✔ Flexibility (LVM)
✔ Reliability (RAID)
✔ Easy expansion of storage
✔ Modular (change one layer without touching others)
✔ Good performance + safety
In Summary
Linux storage is built in layers:
-
Physical disks
-
Partitions
-
RAID (optional)
-
LVM (optional)
-
Filesystem (ext4/xfs)
-
Mount points
-
Applications
This layered architecture gives Linux powerful, flexible, and reliable storage management.