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.
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:
- dm-multipath: The kernel module that provides multipath support
- multipath: Command for viewing multipath devices
- multipathd: Process for monitoring, activating, and deactivating paths
- 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:
- pvcreate: To create physical volume
- vgcreate: To group physical volumes into a volume group
- lvcreate: To create logical volume from partitions in each physical volume
Click here to read more interesting stuff about LVM!
Reduntant Array of Inexpensive Disks (RAID) allows you to increase reliability, and data redundancy. There are several RAID versions available:
- RAID 0: Disk striping. Half data is stored on one drive, other half on other. RAID 0 is not fault tolerant
- RAID 1: Disk mirroring. Data is duplicated on two drives
- RAID 10: Disk mirroring and striping.
- RAID 4: Disk striping with parity
- RAID 5: Disk striping with distributed parity
- RAID 6: Disk striping with double parity
The mdadm utility allows you to specify multiple partitions to be used in any RAID environment.