Corruption and Recovery
If during the boot process, one or more filesystems fail to mount, fsck may be used to attempt repair. However, before doing that one should check that /etc/fstab has not been misconfigured or corrupted. Note once again that you could have a problem with a filesystem type the kernel you are running does not understand.
File Analysis Tools
- file - Determine the file type.
Filesystem Features
Extended Attributes
Filesystems
Applications write and read files. The files are abstractions to the actual physical/hardware layer. The filesystem is an interface between the applications and the I/O layer.
inodes
An inode is an index node. It serves as a unique identifier for a specific piece of metadata on a given filesystem.
LVM (Logical Volume Management)
Virtual devices may be easier to manage than physical devices, and can have capabilities beyond what the physical devices provide themselves. A Volume Group (VG) is a collection of one or more physical devices, each called a Physical Volume (PV). A Logical Volume (LV) is a virtual block device that can be used by the system or applications. Each block of data in an LV is stored on one or more PV in the VG, according to algorithms implemented by Device Mapper (DM) in the kernel.
Making/Formatting
Every filesystem has a utility for formatting/making a filesystem on a partition. Usually it's prefix is mkfs and the binary resides in /sbin/mkfs.
Mounting Filesystems
To be able to use a filesystem after creation, we need to mount it somewhere within the tree structure in a child directory within the / directory.
Mounting Network Filesystems
The three methods of mounting network filesystems (immediate mount -command line-; always mounted; and mounted on-demand) use a common configuration file /etc/fstab. Over the years, additional features and services have updated the options in /etc/fstab. Functionality that required external packages, services and configuration are now combined under systemd services.
NFS
Network File System is a filesystem protocol built upon the Open Network Computing Remote Procedure Call system (ONC RPC). RPCs are managed by the portmap service.
Other Network Filesystems
- Andrew File System (AFS) is a distributed, network filesystem built for high performance. OpenAFS is an open source branch of the original AFS now owned by IBM.
Output to File and STDOUT
Reading Files
View File from Bottom
Run Command on Multiple Files
Server Message Block (SMB)
The Server Message Block (SMB) protocol was originally designed at IBM and later incorporated as the de facto networking file/print sharing system for Microsoft Windows.
Storage Devices
/dev
Swap
Linux employs a virtual memory system that allows it to function as if it had more memory than it physically has. Overcommiting functions two ways:
Troubleshooting
The most common errors found in setting up network filesystems are: