AMBO UNIVERSITY WOLISO CAMPUS
School of Technology and Informatics Department of Information Systems
Course Title: System And Network Course Code: InSy3082; ECTS: 5
Administration
1
CHAPTER THREE
File Systems and Management of Data Storages
INSY3082 : System And
Network Administration
BSc(IS) 3rd Year, Second Semester, 2018 E.C
JAFAR B.
4/29/2026
Outlines
2
Introduction to File System Administration
Creating File Systems
Format the Partition
Swap Partitions
RAID and its configuration in Linux
Creating a RAID-5 Array (Using mdadm):
Managing RAID array
4/29/2026
File System Administration
3
File system administration involves tasks related to the setup,
configuration, management, monitoring, and maintenance of
file systems on a computer or server.
Proper administration ensures optimal performance, data
integrity, and reliability.
Journaling means a feature used by many modern file systems to
improve data integrity and reduce recovery time in the event of a
system crash, power failure or hardware malfunctions
4/29/2026
File System Types
4
Creating a file system writes information to the device and creates
order of the empty space.
This file system-related data consumes a small percentage of the
space.
The remaining space on the disk drive is split into small,
consistently sized segments called blocks.
Linux supports a number of file system types, some of which
are described as follows
4/29/2026
Types of Linux File System
5
Ext2
Stand for second extended file system
High performance for fixed disk and removable media
Does not have journaling features
Maximum individual file size can be from 16 GB to 2 TB
Ext3
Journaling version of ext2
Adds journaling capabilities, which improves reliability and recovery after
crashes.
Backward compatible with ext2, allowing easy upgrades.
Maximum file size: 2 TB and maximum file system size: 32 TB.
The journal can be used in three modes: write back, ordered, and Journald.
4/29/2026
Cont..
6
Ext4
Supports larger files and file system sizes
Enhances performance and scalability compared to ext3.
Supports larger file sizes: up to 16 TB and file system sizes of up to 1 EB
(exabyte).
Introduces features like extents (contiguous blocks of space), delayed
allocation, and a better journaling system.
Improved file system checking time.
Vats
VFAT is an extension of the FAT16 and FAT32 file systems
MS-DOS file system useful when shearing file between windows and Linux
It was introduced by Microsoft to support long filenames while maintaining
backward compatibility with older FAT systems.
It is commonly used on USB drives, memory cards, and other portable storage
devices.
Does not include journaling, which can lead to file corruption if the system crashes
or loses power
4/29/2026
Cont..
7
Xfs
High performance journaling file system
Supports file systems up to 8 exabytes (theoretical limit).
Handles large files efficiently, with support for individual file sizes up to 8
exabytes.
Advantages
Performance: Optimized for high-speed I/O operations and large files.
Reliability: Journaling ensures quick recovery from crashes.
Scalability: Suitable for very large file systems and datasets.
Low Fragmentation: Delayed allocation reduces fragmentation, improving long-term
performance.
Parallelism: Allocation groups enable efficient use of multi-core CPUs.
4/29/2026
Cont..
8
Btrfs
Btrfs (pronounced "butter-fs" or "b-tree-fs") is a modern copy-on-write (CoW) file
system developed by Oracle
Addresses Scalability requirements of large storage systems
Btrfs supports read-only and writable snapshots, allowing you to save the state of the
file system at a specific point in time
Advantages
Data Integrity: Copy-on-write and checksumming ensure reliable data storage.
Snapshots and Backups: Snapshots enable easy backups and rollbacks.
Native RAID Support: Simplifies redundancy and fault tolerance.
Scalability: Supports very large file systems (16 exabytes theoretical).
Compression: Reduces storage usage without significant performance penalties
4/29/2026
Creating File Systems
9
The command to build a Linux file system on a device, or hard disk partition,
ismkfs.
The syntax for the command is: # mkfs [options] device
The mkfs command is actually a front end for the different file system builder
utilities such a smkfs.ext2and mkfs.ext4.
These utilities are executable directly from the command line.
When using the mkfs wrapper, include the -t fstype option to specify the type of
file system to be built.
If not specified, the default file system type,ext2, is created
4/29/2026
Creating a File System in Linux
10
You would want to create a file system in Linux for various reasons:-
To keep your audio and video files separately,
To hold your backup files separately,
To organize the data ,
To reduce the fragmentation,
To making a storage device usable ,
To enabling the computability of file systems and so on.
To create a file system, you need to create a partition and format it.
Note that these steps involve loss of data, so take backups of the data before
proceeding and take precautions.
4/29/2026
Creating a Partition
11
On Linux, a primary partition is used to boot the Linux system and a swap
partition is used to create space to hold extended memory.
You can create three more primary partitions. You can designate a primary
partition as an extended partition to hold multiple logical partitions within that.
If you have a disk space of 100GB, figure out how many partitions you would
want to create.
For example: - /dev/hda1 with 20GB - First primary partition to mount the boot
point.
4/29/2026
Creating the File System on a Partition
12
After creating a partition, you must format a file system as per one of the
supported file system types using the mkfs command or the Disk Utility.
For example, to create an ext4 file system on the /dev/hda2 partition, run the
following command: mkfs -t ext4 /dev/hda2
For example, to create a FAT32 file system on a USB drive to use it on most
operating systems, run the following command: mkfs -t vfat -L 'MyUSBDrive'
/dev/sdc1.
4/29/2026
Prerequisites
13
A system running Linux
A user account with sudo or root privileges
Access to a terminal window / command line (Activities>Search>Terminal)
Partition1: Partition a Disk Using parted Command
Follow the steps below to partition a disk in Linux by using the parted command.
Step 1: List Partitions
Before making a partition, list available storage devices and partitions.
This action helps identify the storage device you want to partition. Run the following
command with sudo to list storage devices and partitions: sudo parted -l.
4/29/2026
Partition1: Partition a Disk Using parted Command
14
The terminal prints out available storage devices with information about:
Model-Model of the storage device.
Disk-Name and size of the disk.
Sector size-Logical and physical size of the memory. Not to be confused
with available disk space.
Partition Table-Partition table type (msdos, gpt, aix, amiga, bsd, dvh,
mac, pc98, sun, and loop).
Disk Flags-Partitions with information on size, type, file system, and flags
4/29/2026
Partitions types can be:
15
Primary-Holds the operating system files. Only four primary partitions can
be created.
Extended-Special type of partition in which more than the four primary
partitions can be created.
Logical-Partition that has been created inside of an extended partition.
In our example, there are two storage devices (/dev/sdaand/dev/sdb):
Make a Partition Table: Create a partition table (e.g., GPT or MSDOS):
mklabel gpt Confirm with "Yes.“
Check Table: Verify the partition table: print
Create Partition: For example, to create a primary FAT32 partition from 0%
to 512MiB: mkpart primary fat32 0% 512MiB
4/29/2026
Cont..
16
4/29/2026
Step 2: Open Storage Disk
17
Open the storage disk that you intend to partition by running the following
command: sudo parted /dev/sdb
Always specify the storage device. If you don't specify a disk name, the disk is
randomly selected. To change the disk to dev/sdbrun: select /dev/sdb
The dev/sdbdisk is open:
4/29/2026
Step 3: Make a Partition Table
18
Create a partition table before partitioning the disk.
A partition table is located at the start of a hard drive and it stores data about
the size and location of each partition.
Partition table types are: aix,amiga,bsd,dvh,gpt,mac,ms- dos,pc98,sun, and
loop.
The create a partition table, enter the following: mklabel [partition_table_type]
For example, to create a gpt partition table, run the following command:
mklabel gpt
Type Yes to execute:.
4/29/2026
Step 4: Check Table
19
Run the print command to review the partition table.
The output displays information about the storage device:
Step 5: Create Partition
• Let's make a new 1854MB-partition using the ext4 file system.
• The assigned disk start shall be 1MB and the disk end is at 1855MB.
• To create a new partition, enter the following: mkpart primary ext4 1MB
1855MB
4/29/2026
Cont..
20
After that, run the print command to review information on the newly created
partition. The information is displayed under the Disk Flags section:
• In a gpt partition table, the partition type is the mandatory partition name. In
our example, primary is the name of the partition, not the partition type.
• To save your actions and quit, enter the quit command.
• Changes are saved automatically with this command.
4/29/2026
Option 2: Partition a Disk Using fdisk Command
21
Follow the steps below to partition a disk in Linux by using the fdisk command.
Step 1: List Existing Partitions
Run the following command to list all existing partitions: sudo fdisk -l
The output contains information about storage disks and partitions:
4/29/2026
Step 2: Select Storage Disk
22
Select the storage disk you want to create partitions on by running the following
command: sudo fdisk /dev/sdb
The/dev/sdb storage disk is open:
Step 3: Create a New Partition
1. Run the n command to create a new partition.
2. Select the partition number by typing the default number (2).
3. After that, you are asked for the starting and ending sector of your hard drive.
It is best to type the default number in this section (3622912).
4. The last prompt is related to the size of the partition. You can choose to have
several sectors or to set the size in megabytes or gigabytes. Type +2GB to set
the size of the partition to 2GB.
A message appears confirming that the partition is created.
4/29/2026
Cont..
23
Step 4: Write on Disk
The system created the partition, but the changes are not written on the disk.
1. To write the changes on disk, run the w command:
2. Verify that the partition is created by running the following command: sudo
fdisk -l As you can see, the partition /dev/sdb2 has been created
4/29/2026
Format the Partition
24
Once a partition has been created with the parted of fdisk command, format it
before using it.
Format the partition by running the following command: sudo mkfs -t ext4
/dev/sdb1
Mount the Partition
To begin interacting with the disk, create a mount point and mount the partition
to it.
1. Create a mount point by running the following command: sudo mkdir -p /mt/sdb1
2. After that, mount the partition by entering: sudo mount -t auto /dev/sbd1 /mt/sdb1
The terminal does not print out an output if the commands are executed successfully.
3. Verify if partition is mounted by using the df hT command:
4/29/2026
Swap Partitions
25
Swap partitions are created in a similar way to regular partitions, but before
writing the partition table to disk, you must use the "t" command to change the
partition's system id to "82" (Linux Swap).
The default system id is "83" (Linux). The following output shows the creation
of a 2G swap partition as the second partition on the disk.
4/29/2026
LVM Partitions
26
Creating partitions for use with the Logical Volume Manager (LVM) is similar to
creating swap partitions, except you set the system id of the partition to "8e"
(Linux LVM). Creating the New RAID 5 Array using the 'mdadm' command.
RAID in Linux can be implemented in multiple levels, each offering distinct
benefits.
Before we start any thing we will check the existing the disk attached to the
machine. Below is the command to list the available disks.
4/29/2026
RAID Level 0
27
This level provides striping without parity.
Since it does not store any parity data and perform read and write operation
simultaneously, speed would be much faster than other level.
This level requires at least two hard disks.
All hard disks in this level are filled equally. You should use this level only if
read and write speed are concerned.
If you decide to use this level then always deploy alternative data backup plan.
As any single disk failure from array will result in total data loss.
RAID 0 focuses on performance
4/29/2026
RAID Level 1
28
This level provides parity without striping. RAID 1 on mirroring for redundancy
It writes all data on two disks.
If one disk is failed or removed, we still have all data on other disk. This level
requires double hard disks.
It means if you want to use 2 hard disks then you have to deploy 4 hard disks or if
you want use one hard disk then you have to deploy two hard disks.
First hard disk stores original data while other disk stores the exact copy of first disk.
Since data is written twice, performance will be reduced. You should use this level
only if data safety is concerned at any cost.
4/29/2026
RAID Level 5
29
This level provides both parity and striping.
It requires at least three disks. It writes parity data equally in all disks.
If one disk is failed, data can be reconstructed from parity data available on
remaining disks.
This provides a combination of integrity and performance.
Wherever possible you should always use this level.
RAID 5 and 6 provide a balance of performance and redundancy, while RAID
10 offers a combination of mirroring and striping.
Understanding these levels is crucial for selecting the most suitable RAID
configuration for your needs
4/29/2026
RAID and its configuration in Linux
30
RAID (Redundant Array of Independent Disks):
RAID is a technology that combines multiple physical disks into a single
logical unit to improve performance, redundancy, or both.
It operates as a layer between raw drives/partitions and the file system.
It provides fault tolerance, data redundancy, and increased storage
performance.
There are two main types of RAID: Hardware RAID (built using
dedicated RAID controllers) and Software RAID(configured within the
operating system).
4/29/2026
Software RAID in Linux:
31
Software RAID is managed by the operating system using tools like mdadm(Multiple
Device Administration).
It uses system resources (CPU, RAM) and is cost-effective.
Software RAID levels include:
RAID 0 (Striping): Data is split across multiple disks for improved performance but without
redundancy.
RAID 1 (Mirroring): Data is duplicated on two or more disks for redundancy.
RAID 5 (Striping with Parity): Provides both performance and redundancy by distributing
data and parity information across multiple disks.
RAID 6 (Striping with Double Parity): Similar to RAID 5 but with an additional parity disk
for better fault tolerance.
RAID 10 (Combination of RAID 1 and RAID 0): Mirrored pairs are striped for both
performance and redundancy.
4/29/2026
Configuring Software RAID in Linux
32
Step 1: Install mdadm:
Ensure that the mdadm package is installed on your system.
Step 2: Create RAID Arrays:
Use mdadm to create RAID arrays (e.g., RAID 1, RAID 5, etc.).
Specify the RAID level, devices, and other parameters.
Step 3: Format and Mount the RAID Array:
Format the RAID array using a file system (e.g., ext4).
Mount it to a directory in the file system.
Step 4: Monitor and Manage:
Use /proc/mdstatto check the status of RAID devices.
Use mdadm commands to manage arrays (add/remove disks, grow arrays,
etc.).
4/29/2026
RAID concept (create and managing a RAID-5 Array)
33
RAID is valuable for data redundancy and performance gains.
When Is RAID a Good Idea?
1. Data Redundancy:
• RAID helps increase data availability.
• During drive failures, data remains accessible, minimizing disruptions.
• Note that RAID is not a substitute for backups; separate backups are always
recommended.
Performance Enhancement:
• Storage I/O speed is often limited by a single disk.
• RAID allows data distribution or redundancy, improving throughput.
• Write operations can also benefit from certain RAID configurations
4/29/2026
Creating a RAID-5 Array (Using mdadm):
34
1. Install Necessary Utilities:
Begin by installing the required RAID utilities, such as mdadm.
2. Create the RAID Array:
• Use mdadm to create the RAID-5 array.
• Specify the disks involved (at least three) and their order.
• Example:sudo mdadm—create /dev/md0 --level=5 --raid-devices=3
/dev/sdX1 /dev/sdY1 /dev/sdZ1
[Link] and Mount: Format the RAID array with a file system (e.g., ext4).
Mount it to a directory in the file system.
4/29/2026
Managing RAID Arrays
35
Monitoring: Check the status of RAID devices using /proc/mdstat.
Expanding: To add more disks or increase capacity, use mdadm commands.
Resizing File system: Resize the file system on the RAID array using
appropriate tools.
4/29/2026
Ended!
36
Chapter Three
File Systems and Management of Data Storages
INSY3082 : System and Network
Administration
BSc(IS) 3rd Year, Second Semester, 2018 E.C
4/29/2026