Understanding Linux Storage Alternatives

Once we create and format a partition, there is difficulty on how to make it larger or smaller. Individual partitions are prone to disk failures resulting in data loss. To create more dynamic environment on partitions, and increase fault-tolerance, let’s discuss some features Linux incorporates.

Multipath

Linux kernel supports Device Mapper (DM) multipathing which allows multiple paths between Linux system and network storage devices. Multipathing connects paths providing increased throughput while all paths are active. Also, it provides fault tolerance if one path fails. The Linux Device Mapper tools include:

  1. dm-multipath: The kernel module that provides multipath support
  2. multipath: Command for viewing multipath devices
  3. multipathd: Process for monitoring, activating, and deactivating paths
  4. kpartx: Command to create device entries for multipath storage devices

You can learn more on multipath by clicking here

Logical Volume Manager

LVM is used to combine multiple physical partitions or physical disks into virtual logical volumes. Each virtual volume is then treated as single partition on the system. Physical disks are added in one Volume Group. Total size of Volume Group is like a pool of space that can be used to create multiple logical volumes. Each logical volume consumes space from volume group. On top of logical volumes, we can mount different filesystems.

Benefit of LVM is that you can add an remove physical partitions or disks as needed, and create new logical volumes, or expand and shrink logical volumes as needed.

For each physical partition, using fdisk or gdisk, assign partition type as Linux LVM filesystem. Then, use LVM tools to create an manage logical volumes:

  1. pvcreate: To create physical volume
  2. vgcreate: To group physical volumes into a volume group
  3. lvcreate: To create logical volume from partitions in each physical volume

Click here to read more interesting stuff about LVM!

RAID

Reduntant Array of Inexpensive Disks (RAID) allows you to increase reliability, and data redundancy. There are several RAID versions available:

  1. RAID 0: Disk striping. Half data is stored on one drive, other half on other. RAID 0 is not fault tolerant
  2. RAID 1: Disk mirroring. Data is duplicated on two drives
  3. RAID 10: Disk mirroring and striping.
  4. RAID 4: Disk striping with parity
  5. RAID 5: Disk striping with distributed parity
  6. RAID 6: Disk striping with double parity

The mdadm utility allows you to specify multiple partitions to be used in any RAID environment.

Leave a Reply