You are on page 1of 24

Linux Filesystems

Intro
- Think of the Filesystem as an
organized library
- There are different ways to go about
organizing the bits on your hard
drive
- Linux is about “choice” so that adds
more options to the mix
Filesystem Types

1. Journaling Filesystem

2. Log-Structured Filesystem

3. Copy-On-Write Filesystem
Journaling Filesystem
A filesystem that maintains a special
file called “a journal” that is used to
repair any inconsistencies that occur
as the result of an improper shutdown
of a computer.

ex. NTFS, ext3/ext4, ReiserFS, JFS, XFS


Journaling Filesystem
Advantage:
- Consistency of metadata is ensured.
- Faster than traditional fsck checks.

Disadvantage:
- Complete data consistency is not ensured.
- Redundancy of metadata writes occurs.
Log-Structured Filesystem
Maintain a log within the filesystem
itself.
The filesystem data on disk is
structured in the form of a log.
Log-Structured Filesystem
Advantage: Write efficiency is very
high because of sequential writes.
Redundant writes are avoided.

Disadvantage: Random reads are high


making the reads slow.
Copy-On-Write Filesystem (COW)
“Normal” Write: Existing blocks of a file are
overwritten, when the content changes.

Copy-On-Write: If content of a block changes,


the changed block is put besides the non-changed
block & the metadata (block-list) changes

ex. BTRFS & ZFS


Copy-On-Write Filesystem (COW)
Advantage: Efficient Storage,
Deduplication, Snapshots, Integrity
beyond Journaling Filesystem

Disadvantage: Performance impact on


specific workloads, such as storing
VMs
Union Mount
A way of mounting that allows several
filesystems or directories to be
simultaneously mounted and visible
through a single mount point,
appearing to be one filesystem.

ex. AUFS & Overlay


Common Filesystems
- Fat16/Fat32 - BTRFS
- NTFS - AUFS
- ext3/ext4 - Overlay
- reiserFS - XFS
- JFS - ZFS
File Allocation Table Fat16/Fat32
- Non-journaling
- A legacy file system which is simple
and robust
- Originally designed in 1977 for use
on floppy disks
- Used commonly on Windows systems
- Today most notably found on USB
sticks, flash drives, etc
New Technology File System: NTFS
- Journaling Filesystem
- Proprietary filesystem developed by
Microsoft
- Improved support for metadata, &the
use of advanced data structures to
improve performance, reliability, &
disk space utilization, plus
security access control lists (ACL)
ext3/ext4: Extended Filesystem
- Journaling Filesystem
- Most commonly used by the Linux
kernel
- The performance of ext3 is less than
ext4, JFS, ReiserFS & XFS. But ext3
allows in-place upgrades from ext2
without having to backup & restore
data.
ext3/ext4: Extended Filesystem
- The ext4 filesystem can support
volumes with sizes up to 1 exbibyte
(EiB) and files with sizes up to 16
tebibytes (TiB).
- ext4 is backward compatible with
ext3 and ext2, making it possible to
mount ext3 and ext2 as ext4.
ReiserFS
- The first journaling file system to
be included in the standard kernel
- Before Linux 2.6.33, ReiserFS
heavily used the big kernel lock
(BKL) — a global kernel-wide lock —
bad performance, because the
critical code parts are only ever
executed by one core at a time.
Journaled File System: JFS
- There are versions for AIX,
eComStation, OS/2, and Linux
operating systems
- JFS is supported with a kernel
module in Linux
- Actual usage of JFS in Linux is
uncommon, as ext4 typically offers
better performance
B-tree Filesystem: BTRFS
- Copy-On-Write Filesystem for Linux
- Btrfs is intended to address the
lack of pooling, snapshots,
checksums, and integral multi-device
spanning
- Goal was "to let Linux scale for the
storage that will be available”
AUFS
- Another Union Filesystem
- Needs to be compiled into the kernel
- Can unite several directories into a
single virtual filesystem. The
member directory is called as a
branch.
- Also used by Docker
Overlay
- Implements a union mount for other
filesystems
- Backend storage driver for Docker
- Added in Kernel 3.18
- Relatively new, but the idea has
been around awhile
XFS
- Journaling Filesystem
- NASA Advanced Supercomputing
Division uses it for two 300+
terabyte XFS filesystems on two SGI
Altix archival storage servers, each
of which is directly attached to
multiple Fibre Channel disk arrays
ZFS
- Copy-On-Write Filesystem
- Protects against data corruption
- Support for high storage capacities
- Efficient data compression
- Volume management & snapshots
- Continuous integrity checking
- Automatic repair
- Common to Solaris
Let’s not forget...
Virtual Filesystem: VFS
- An abstraction layer on top of a
more concrete filesystem
- /proc contains information about
your system hardware and the
processes that are running on the
system
- You can change kernel config by
writing to specific files in /proc

You might also like