Study notes covering Administering Storage.
Author: Dylan Barrett
Date: 02/28/2026
📖 Useful Vocabulary / Acronyms
| Terminology | Definition |
|---|---|
| File Storage | A Storage method where data is managed as a discrete file within the operating system's filesystem. It is very common on workstations, servers, and NAS devices |
| Block Storage | The Storage method that breaks data into chunks and distributes the chunks across available storage space, independent of the server's filesystem. |
| Object Storage | A storage method where data is broken into chunks and managed with detailed metadata. It is very scalable and is best for data that is written once and read often. |
| Storage Area Network | Network dedicated to provisioning storage resources, typically consisting of storage devices and servers connected to switches via host bus adapters. |
| Logical Volume Manager (LVM) | Software that maps physical devices and partitions to logical volumes |
| Scalability | Property by which a computing environment can gracefully fulfill its ever-increasing resource needs |
| Master Boot Record | Sector on a mass storage devices that hold information about partitions and the OS Boot Loader |
| GUID Partition Table (GPT) | Modern Disk partitioning system allowing large numbers of partitions and very large partition sizes |
| Unified Extensible Firmware Interface (UEFI) | Type of system firmware, providing support for 64-bit cpu operation at boot, full GUI and mouse operation at boot and better boot security |
| Filesystem in Userspace (FUSE) | Permits the creation of non-privileged access to the kernel by providing an interface between the two |
| Userspace | The area in system memory outside of the kernel space that includes software that accesses kernel services |
| Latency | Time Taken for a singnal to reach the recipent, measured in milliseconds. Latency is a particular problem for two-way applicaitons, such as VoIP and online confrencing. |
| Throughput | Amount of data transfer supported by a link in typical conditions. |
| RAID | Specifications that support redundancy and fault tolerance for different configurations of multiple-deivce storage systems. |
| Input/Ouput Operations Per Second (IOPS) | Preformacne indicator that measure the time taken to complete read/write operations |
| Multipathing | Overprovisoning controllers and cabling so that a host server has failover connections to networks and storage media |
| Storage Area Network | Network Dedicated to provisioning storage resouces |
| Fiber Channel | High Speed netwwork communications protocol used to implement SAN's |
| Internet Small Computers System Interface (iSCSI) | IP tunneling protocol that enables the transfer of SCSI data over an IP-Based network to create a SAN |
Deploy Standard Storage
Linux Storage Concepts
- When managing storage capacity is only part of the issue, you also have to take into consideration its performance, cost, and reliability.
Types of Storage Design
- File Storage - The standard approach to storing data on local drives. Data is stored in hierarchical directories. Regular File Storage is not very scalable, and it must be scaled out not up.
- Block Storage - This is a good choice for large amounts of unstructured data. It is commonly used with Storage Area Networks.
- Object Storage - Cost-effective data storage that is difficult to modify once written.
- Most Linux systems work on File storage with a file system like XFS or EXT4
Partitoning and Logical Volume Manager
- Partitioning works with each device independently, and you can split one drive into multiple partitions,,, and each drive will show as its own drive
- Logical Volume Manager (LVM) Displays and aggregates the space into a single logical unit. LVM is far more flexible and scalable than regular partitioning.
Hard Disk Drive Deployments
- There are many different types of internal storage, and as the system administrator, you will often have to choose the one that is most beneficial to your deployment
- Small Computer Systems Interface (SCSI) - Tends to be expensive and hold less capacity but tends to be much faster spinning at 10,000 - 15,000 RPMS.
- Serial Attached SCSI (SAS) Upgraded SCSI design with larger capacities and faster transfer speeds.
Disk and Partition References
- Most references to a storage media include a path, and every bit of hardware is mapped to the /dev directory.
- The sd string is followed by a letter defining the drive's location.
- The first storage disk in the system is displayed as /dev/sda
- The hwinfo can be used to display storage information with the --storage option or the --block option
- the --storage option can be used to display storage controllers
- the --block option displays information on storage disks
- The lsblk command displays information about storage devices that the system is aware of.
- The lsscsi command is used to display information about SCSI devices if the system has any
- The sd string is followed by a letter defining the drive's location.
Types of partitions
- Administrators can divide storage drives into partitions for more efficiency and organization.
- Two of the ways to track partition divisions
- Master Boot Record - The traditional choice, but it is limited to a 2TB maximum and four partitions
- GUID Partition Table - The more modern design of MBR is a part of UEFI, and can handle much larger volume sizes than MBR
- Two of the ways to track partition divisions
Partitions on the Drive
Partition Design
- Linux administrators often dedicate specific partitions to certain filesystem hierarchy standard directories. This is especially helpful for directories, such as /var/log and /home, which are susceptible to filling, and having these partitioned off helps to prevent system failure.
the fdisk utility
- The fdisk utility is a menu-driven program used to create, modify, or delete partitions on a storage drive. Some of its common options are
- n - creates a new partition
- d - remoces a partition
- p - Prints the listing partitions
- w - writes the changes to the drive, and exits
- q - Quits without saving changes to the partition table
Partition Management
- GNU Parted is another good partition management tool and is called with the command parted. Some of its options are:
- select - Chooses which device or partition to modify
- mkpart - creates a partition with a specified file system type
- print - Lists the partition table
- resizepart - Modifies the end of the position of a partition
- rm - Relets a partition
- quit - Writes changes and exits the GNU Parted Utility
The growpart Utility
- The growpart utility helps to extend partitions. It is bundled with the cloud-utils Linux Package ia is used to grow partitions on cloud based linux deployments
The partprobe command and the /proc/partitions Directory
- The partprobe command is used to scan for storage disks and partition changes,
- Partition information is stored in a file named /proc/partitions which is recreated at system boot or when you run the partprob command
- You can also use the blkid command to display known information on the partitions, and it will display the UUID of the drive.
Filesystems on a partition
- ext4 - The older filesystem, which provides journaling and is recognized by most distros
- The XFS Filesystem - is the newer version of the ext4 filesystem and can recognize a larger partition size, larger file size, and avoid inode exhaustion
- Btrfs - This file system is very scalable and provides easy management. It is the default for SUSE Linux Enterprise Server 15 and Fedora 41
- The Temporary File System tmpfs - Stores and organizes data in memory rather than on a storage disk. It offers fast read and writefor the data, but is not maintained when the system shuts off
- Filesystem in Userspace FUSE - You can use FUSE to create a virtual file system for sandboxed applications.
Filesystem Management,
- Some Filesystems such as ext4 and XFS offer flexible configuration options and often require periodic maintenance
- The fsck command is a diagnostic and repair tool for the ext4 and XFS file systems and can:
- Filesystem check - Checks for bad sectors on the disk and other potential failures
- File System Repair - Updating filesystem information with bad sectors or after resizing operations
- Automatic - Has an option to run automatically during system startup
- Recovery may recover damaged files and store them in the lost+found directory
- The e2label command allows you to label a filesystem
- resize2fs - allows you to enlarge or shrink an ext4 filesystem on a device. You can enlarge the file system with it mounted if you want to shrink it is must first be unmounted.
- tune2fs helps to configure various parameters associated with ext4.
- The dumpe2fs command is used to dump ext2 and etx3 and ext4 filesystem information, which is useful for troubleshooting a faulty filesystem
- XFS Tools, Just like ext4 there are various tools to help with the XFS filesystem and some of these are:
- xfs_info - Displays details about the XGS file system
- xfs_admin - Changes the parameters of a XFS filesystem including its label,,, and UUID
- xfs_metadata - Copies the superblock of an XFS filesystem to a file
- xfs_grow - Expands the XFS filesystem
- xfs_copy - Copies the contents of the XFS filesystem to another location
- xfs_repair - Repairs and recovers a corrupt XFS file system
- xfs_debug - Debugs the XFS filesystem
Swap Space and Virtual Memory
- Swap Space is not a memory replacement but is used to help alleviate the issues that happen when you run out of memory. It also allows to offload some of the stuff in memory that's not currently in use so that it can still be recalled easily.
- Swap Management commands
- mkswap is used to make swapspace some of its options are:
- -c - Verifies that the device is free from bad sectors, before mounting swap space
- -p - Set the page size for the mkswap command
- -L {label} - Activates the Swap space using labels applied to partitions or filesystems
- You can use the swapon and swapoff commands to turn on or off swap space.
Deploy Logical Volume Managment
Configure Logical Volume Managment
- Logical Volume Manager Functions are based on three configuration layers for storage.
- Physical Volumes (PV) - Drives or partitions allocated to LVM
- Volume Group (VG) - This layer represents the aggregated storage capacity of an designated PV's
- Logical Volumes (LV) - These are treated by the system as if they were regular partitions.
- Because of this layout LVM is much more scalable then Regular Filesystem storage
- The /dev/mapper directory contains all of the logical volumes on the system that LVM manages
LVM Managment Tools
- LVM divides its volume managment tools into three categories based on three different layers that make up the LVM
- Physical Volume Tools:
- pvscan Scans for all physical devices that are being used as physical volumes.
- pvcreate Initializes a drive or partition to use as a physical volume.
- pvresize Expands or shrinks a physical volume, increasing LVM's flexibility.
- pvdisplay Lists attributes of physical volumes.
- pvchange Changes attributes of a physical volume.
- pvs Displays information about physical volumes.
- pvck Checks the metadata of physical volumes.
- pvremove Removes physical volumes.
- pvmove Moves data from one phyiscal volume to another.
- Volume Group Tools:
- vgscan Scans all physical devices for volume groups.
- vgcreate Creates volume groups.
- vgdisplay Lists attributes of volume groups.
- vgchange Changes attributes of volume groups.
- vgs Displays information about volume groups.
- vgck Checks the metadata of volume groups.
- vgrename Renames a volume group.
- vgreduce Removes physical volumes from a volume group to reduce its size.
- vgextend Adds physical volumes to volume groups.
- vgimport Imports a VG configuration from one system to another.
- vgexport Exports a VG configuration from one system to another.
- vgmerge Merges two volume groups.
- vgsplit Splits a volume group into two.
- vgremove Removes volume groups.
- Logical Volume Tools:
- lvscan Scans all physical devices for logical volumes.
- lvcreate Creates logical volumes in a volume group.
- lvdisplay Lists attributes of logical volumes.
- lvchange Changes attributes of logical volumes.
- lvs Displays information about logical volumes.
- lvrename Renames logical volumes.
- lvreduce Reduces the size of logical volumes.
- lvextend Extends the size of logical volumes.
- lvresize Resizes logical volumes.
- lvremove Removes logical volumes.
Logical Volume Deployments
# Create the Physical Volumes
pvcreate /dev/sdb
pvcreate /dev/sdc
pvdisplay
# Create the Volume Groups
vgcreate vg_projects /dev/sdb /dev/sdc
vgdisplay
# Create the Logical Volume
lvcreate --name projects --size 500G vg_projects
lvdisplay
Mount Storage
Manually Testing Mount
- The Steps for adding more storage to a Linux system are,
- Install the Drive
- Create partitions using the fdisk or parted commands, or create an LVM
- Install a filesystem using the mkfs command
- Add the storage to the FHS structure by mounting
The mount and umount commands
mkdir /projects
mount /dev/sdb2 /projects
Testing the Storage
- the df and du commands facilitate storage-space tracking
- the df command stands for disk free and displays the devices free space, file system, total size, space used, percentage value of space used, and mount point
- the du command displays how a device is used, including the size of directory tress and files within it
- You can view the system'sthe knowledge of its storage space by using the cat /proc.partitions and cat /proc/mounts
Automatically Mounting New Storage
Use a systemd.mount file
- Most Linux Distros rely on the systemd system and service management software suite to configure operating system settings and options. This Process is also used to manage the automatic mounting of partitions to the filesystem
- systemctl -t mount - Is used to display mounted partition information. Here are the steps to configure the system to mount the partition automatically
- Get the UUID by using the blkid command: blkid /dev/sdb2.
- Create a systemd unit file by using a text editor. - Restart the systemd service daemon: systemctl daemon-reload. - Start the filesystem: systemctl start projects. mount. - Enable the filesystem: systemctl enable projects. mount - systemctl -t mount - Is used to display mounted partition information. Here are the steps to configure the system to mount the partition automatically
# This file mounts the /projects directory via systemd
[Unit]
Description=Project Directory (/projects)
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount. target
After=swap.target
[Mount]
What=/dev/disk/by-uuid/eca1646e-3245-5bf5-faab-31f6c424c09f
Where=/projects
Type=ext4
Options=defaults
[Install]
WantedBy=multi-user.target
[Unit]
Description=Mount NFS Share
After=network.target
[Mount]
What=fileserver07:salesdata
Where=/mnt/sales_share
Type=nfs
Options=defaults
[Install]
WantedBy=multi-user.target
Use the /etc/fstab File
- Some distros rely on the /etc/fstab file to mount partitions; even systems that use Systemd have a reference to the /etc/fstab file. The /etc/fstab file consists of six fields
- Block device: Drive and partition.
- Mount point: Where to mount the partition.
- Filesystem type: The filesystem on the partition (XFS or ext4).
- Mount options: Read-write or read-only options, others.
- Dump: Whether the dump program backs up partition (1 or 0).
- fsck order: The order in which fsck checks partitions (1 for root, 2 for all others).
- There are various mount options that you can configure in /etc/fstab that control how the system handles filesystem mounting. Here are some of the choices:
- noatime Disables file access time updates, possibly improving performance.
- nodiratime Disables directory access time updates, possibly improving performance.
- nodev Prohibits creation of device files as a security measure.
- noexec Prevents binary (command) execution as a security measure.
- nofail Prevents the system from refusing to boot if the specified filesystem is missing. This is useful for removable filesystems that don't contain bootup information.
- nosuid Prevents SUID and SGID configurations within the filesystem as a security measure against privilege escalation attacks.
- ro Mounts the filesystem in read-only mode.
- rw Mounts the filesystem in read-write mode (the default).
The AutoFS Service
- The AutoFS service is used only mount and talk to a file server when it is called to prevent unnecessary resource utilization. Its configuration file is /etc/auto.master
Disk Performance
- When reviewing a disk's preformance there are multiple things you need to take into consideration, such as:
- Latency - The time it takes for data to travel across the communications media
- Throughput - The measure of the storage device's effective bandwidth or ability to move data to or from the drive.
- RAID - RAID can affect both the throughput and latency of the devices that are in it
Measuring input/output operations per second
- You can measure Input/Output Operations per Second (IOPS) with the iostat and ioping commands
- iostat displays the following information about the device
- Transfers per second
- Number of blocks read per second
- Number of blocks written per second
- The total number of blocks read
- The total number of blocks written
- ioping can measure the latency of a storage device and has these command options:
- -c {count} Specifies the number of I/O requests to perform before stopping.
- -i {time} Sets the time (interval) between I/O requests.
- -t {time} Sets the minimum valid request time. Requests faster than this are ignored.
- -T {time} Sets the maximum valid request time. Requests slower than this are ignored.
- -s {size} Sets the size of requests.
Scheduling Input/Output operations
- I/O scheduling is the process by which the operating system determines the order of input and output operations of block storage devices.
- Dealine scheduoler preforms sorting I/O operations using three queues.
- Complete Fair Queuing (CFQ) Scheduler - The default scheduler for modern versions of the Linux kernel, each process is given its own queue.
- Noop is the simplest scheduler and does not sort I/O requests by merely merging them.
Manage Other Storage Options
Linux Unified Key Setup 2
- Data stored on a disk is vulnerable to security breaches, and one way to help mitigate this risk is the use Linux Unified Key Setup Version 2 (LUKS3)
- The crypsetup command is the way to configure LUKS2 with the syntax of crypsetup {options} {action} {action arguments} here are some of the actions:
- luksFormat Formats a storage device using the LUKS2 encryption standard.
- isLuks Identifies whether a given device is a LUKS2 device.
- luksOpen Opens a LUKS2 storage device and sets it up for mapping, assuming the provided key material is accurate.
- luksClose Removes a LUKS2 storage device from mapping.
- luksAddKey Associates new key material with a LUKS2 device.
- luksDelKey Removes key material from a LUKS2 device.
Software Raid
- You can configure software RAID in Linux with the mdadm command. Here are some of its options:
- --monitor Monitors changes to the array, such as a failed drive.
- --manage Adds or removes storage, designates spares.
- --verbose Provides detailed output.
# Create a RAID 0 array with sdb and sdc
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc
# Save the details of the new array to a file for configuration at boot
mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
# See the status of the array
cat /proc/mdstat
Storage Area Network
- Two common protocols for communicating between nodes on a storage area network are
- Internet Small Computer System Interface -
- Relatively Easy to configure
- Standard and common to most IP networks
- SCSI commands over a standard IP Network
- Fiber Channel
- More difficult to configure
- Performance increaseof to iSCSI
- SCSI Commands over a fiber channel
- Internet Small Computer System Interface -
- You can use the fcstat command to display information about Fiber Channels
- The multipathd command is responsible for checking and displaying information about multipath paths.
Storage Quota's
# View the storage quota for jsmith
quota -u jsmith
# Turn on storage Quota's for the root directory
quotaon /
# Turn Off Quota's on the root Directory
quotaoff /