File System Analysis in Android & Linux
File System Analysis in Android & Linux
SUBMITTED BY:
This report focuses on analyzing the File System and System Monitoring Tools of the
Android operating system in comparison with Ubuntu, Debian, and Red Hat. It covers
architecture, security, platform differences, and potential improvements.
The Android File System is responsible for secure data storage, file access control, and
compatibility with app sandboxing. Monitoring tools provide real-time performance,
debugging, and diagnostic data, which are essential for developers and system stability.
3. Cross-Module Interactions
The File System closely interacts with memory management, I/O operations, and user-
level access APIs like the Storage Access Framework. Monitoring tools access logs,
memory usage, and process states to provide relevant data.
4. Stakeholder Requirements
Developers require detailed debugging and tracing tools like Perfetto and logcat.
End-users need efficient, secure file access with minimal performance overhead.
The Android File System differs from Ubuntu (ext4), Red Hat (XFS), and Debian (ext4)
due to its focus on mobile devices using F2FS and EROFS optimized for flash storage.
Monitoring tools in Android (logcat, dumpsys, Perfetto) are tightly integrated with the
application layer, while Linux distributions use generalpurpose tools like journalctl and
systemd.
3. Comparison Table
See Section 4 in the original document. Key comparisons include encryption methods
(fscrypt vs LUKS), monitoring tools (logcat vs systemd), and volume management
strategies. Android focuses on mobile centric optimizations, unlike general purpose
Linux distros.
Android employs sandboxing, SEAndroid (SELinux for Android), file based encryption,
and app permissions to mitigate threats.
3. Recovery Strategies
Fallback mechanisms include recovery mode for corrupted partitions, watchdog timers to
restart system services, and secure boot to validate system integrity.
Android evolved from YAFFS2 to ext4, then to F2FS/EROFS. Ubuntu and Red Hat
moved from ext3 to ext4/XFS. Monitoring tools grew from dmesg to Perfetto with trace
visualizations.
Enhanced sandboxing
More transparent permissions
Better developer access to logs
Storage performance improvements
Privacy focused monitoring tools
4. Historical Bugs
For this project, we focus on the File System and Monitoring Tools within the Red Hat
Linux distribution. The File System is fundamental to the operating system, providing the
structure for storing, organizing, and accessing data. Monitoring tools are crucial for
observing system performance, identifying bottlenecks, and ensuring stability.
Understanding their implementation and capabilities is essential for comprehending
overall OS functionality. This report will explain the significance of these modules,
compare their complexity and uniqueness across Ubuntu, Android, and Debian, and
highlight Red Hat's strengths and weaknesses in these areas.
• How are the core file system functionalities implemented differently in Red Hat
compared to Ubuntu, Android, and Debian?
• What are the primary monitoring tools available in Red Hat, and how do they
compare in features and usability to those in the other distributions?
• How does the Red Hat file system interact with other core components like
memory management and process management?
• What are the unique security features and considerations related to the file system
and monitoring tools in Red Hat?
3. Breakdown of Study Areas
Strengths:
• Stability and Reliability: Red Hat is renowned for its rigorous testing and focus
on stability, making its file system and monitoring tools highly dependable for
critical enterprise environments.
• Security Focus: Strong integration with SELinux (Security-Enhanced Linux)
provides enhanced security for the file system and system processes, offering
granular control over access and preventing unauthorized modifications.
Monitoring tools often have features to audit security-related events.
• Enterprise-Grade Tools: Red Hat provides powerful and comprehensive
command-line monitoring tools like sar for historical data analysis and Cockpit
for a web-based graphical interface suitable for server management.
• Extensive Documentation and Support: Red Hat offers excellent official
documentation and professional support, crucial for understanding and
troubleshooting complex file system and monitoring configurations.
Weaknesses:
Linux file systems control where data is stored on disk. They employ data structures
known as inodes to index every file. When a file is deleted, the inode of the file simply
gets "unlinked" from its name, and the data becomes difficult to retrieve. Another
important concept is journaling: most contemporarys Linux file systems (ext3, ext4 etc.)
initially record changes to a journal before actually making them. Journaling protects the
disk in case the system crashes by enabling the file system to redo incomplete operations
during boot. Simply put, journaling is when the file system writes new data to a logs
initially and commits it later to the primary storage in a way that maintains consistency.
Recovery is made significantly faster and partials data corruption is avoided.
Ubuntu ext4 file system is the default since Ubuntu 9.10. Ext4 (the fourth "extended"
file system) is a journaling file system that superseded ext3 and ext2. Ext4 added
journaling checksums, delayed allocation, and extents which means clustering
contiguous blocks to enhance performance. Extents allow ext4 to allocate larger
contiguous areas to files, which accelerates writes.
Linux system monitoring tools help users and administrators understand how the system
is performing by showing real time data about CPU usage, memory consumption, disk
activitys and running processes. On Ubuntu, tools like `top` and `htop` gather this
information by reading from special virtual directories such as `/proc` and `/sys`, which
the Linux kernel uses to expose live system data. The `top` command shows CPU and
memory stats for each process, while `htop` provide a more user friendly view where
users can scroll throughs processes , it sort them, and even stop or restart them directly.
Cross-platform strategies:
• Use standard APIs and tools: it code against POSIX C functions or common
libraries. Like a C program using open() and read() works on any Linux
includings. Scripting languages like Python or shell scripts (bash) are also
portable across Ubuntu, Debian, and Red Hat. Android does have a limited shell.
• Abstract differences: For any low levels differences use configuration files or
environments checks. For example if a tool needs to examine disk usage, it can
read /proc/mounts rather than assume /etc/mtab.
• Consider hardware: Android devices usually use ARM CPUs and have custom
partition layouts. In contrast, Ubuntu has often x86_64. Cross compilation or
containerization like using qemu or Docker images can help test on different
architectures.
• Use the VFS for portability: Because of the VFS file system features can be
swappeds. For example Ubuntu uses ext4 by default, but it also supports XFS via
kernel modules. You can design tools assuming ext4 but ideally use generic file
APIs so the code also works if the system uses XFS.
Another cross platform consideration is how monitoring data is presented. For Linux
Ubuntu,Debian,Red Hat you can design a tool that reads /proc and writes output to a
terminal. That same tool could run on Android’s shell. Howevers i searched, Android
devices often require root to access all /proc data, and they expect graphical app. If
PAK OS includes mobile devices, we can use Android’s developer APIs like the
MemoryInfo or ActivityManager for an app based monitor
File systems and monitoring also involve security considerations. Journaling is partly
about integrity, it prevents data corruption which is a form of risk mitigation.
• File permissions and ownership: Unix style permissions are the first defense.
Every file and directory on all Linux systems has permission bits that restrict
access. Android also uses similar permissions, plus each app runs as a separate
user ID. This means that by default one user or app cannot read another’s private
files unless explicitly alloweds
• Mandatory Access Control (MAC): Ubuntu uses AppArmor by default to
control what apps can access, using profiles that limit file and system access. Red
Hat and Android use SELinux instead which labels files and processes and
enforces strict rules even root can be limited.
• Disk encryption: To protect data at rest, Linux distributions support full-disk or
file-based encryption. Ubuntu and Debian installers can set up LUKS encryption
for whole disks or partition
• Monitoring and alerting: System monitoring helps with security by spotting
strange behavior, like unknown processes or CPU spikes. Tools like top, auditd,
or sysstat can show issues early. On Android, logcat or SafetyNet are use
Using file system checks (like fsck) and backups is crucial. If a file system ever gets
marked as “unclean”, the system will automatically run fsck on reboot to repair it.
Journaling means fsck is usually quick because most of the recovery is done by replaying
the journal
File systems and monitoring tools have evolved significantly. In the Linux world:
• File systems: Linux started with ext2 (no journaling), then moved to ext3 (with
journaling), and later to ext4, which improved speed and reliability with features
like extents and checksums. Ubuntu mostly use ext4
• Monitoring tools: in ubuntu,the earliest tools like top, and iostat came from the
procps and sysstat packages. Over time, newers tools appeared: htop added
interactivity, glances and bpytop (now btop) added more GUI like displays, and
container focused tools appeared for modern workloads. Kernel level tracing is a
recents areas tools like bcc/bpftrace can profile system calls and I/O in detail.
The journaling in ext4 and XFS fixed many corruption bugs present in non-journaled
systems. Monitoring tools also had to adapt: the old /proc/stat format changed slightly
between kernel versions, and tools had to adjust parsing. But generally, the evolution
has been incremental: new file system capabilities (like resizing partitions online, or
encryption support) get added as features without completely overhauling the system.
When analyzing bugs, its often filesystem drivers or tools that need updates. For
example, if a new SSD has unusual behavior, the ext4 or F2FS driver might need a patch
to align I/O properly. Or a new kernel could expose a race condition in /proc reading. Part
of Module Evolution is that distributions backs port critical fixes: Ubuntu’s LTS kernels
and Red Hat’s RHEL backport many updates to keep file systems and monitoring tools
secure and stables
The file system and monitorings “modules” have evolved from simple to more complex:
from ext2 to journaling ext4/XFS, from top to interactive dashboards. Each new feature
was integrated after testing. Bug analysis is ongoing: communities track issues on places
like [Link]. But by 2025, ext4 and XFS are very mature, F2FS is stable for Android
use, and monitoring tools are rich and battle tested.
• File System: Ubuntu utilizes the ext4 file system by default, known for its
reliability and performance.
• Security: AppArmor is enabled by default in Ubuntu, providing mandatory
access control through easy-to-manage profiles
• System Monitoring: Ubuntu comes with essentials monitoring tools like top, and
users can install htop and sysstat for enhanced system performance tracking .
• Package Management: The APT package manager, along with support for PPAs
and Snap packages, offers flexibility in software installation and updates.
The file system module in an operating system kernel manages the logic for on-disk file
systems, handling files, directories, metadata and system calls such as open, read, write,
and delete. In Linux, the Virtual File System (VFS) layer provides a uniform API to
userland, while individual file system drivers interpret specific on-disk formats. The
module interfaces with the VFS for file operations, utilizes the buffer/page cache to store
data in RAM, and communicates with block device drivers for I/O operations. It also
ensures metadata updates and journaling for crash consistency. Key tasks include
directory lookups, file creation/deletion, space allocation, permission checks, and error
recovery. The file system collaborates with memory management (via the page cache)
and the I/O subsystem (through block I/O scheduling) to optimize performance and data
integrity.
Monitoring tools differ across platforms. Debian and Ubuntu provide standard Linux
utilities such as df and du for disk usage, inotify, auditd, and dnotify for file event
monitoring, and iostat/vmstat for I/O statistics, alongside system logs. RHEL offers
similar tools, often installed via yum install sysstat, with enhanced logging through auditd
and SELinux alerts. Android, lacking a traditional shell, uses logcat, dumpsys, 1 and its
SELinux/Audit framework for file-access tracking. All these systems depend on the
kernel’s VFS and audit subsystems for monitoring.
Cross-Module Interactions:
The file system module is closely integrated with memory management and I/O sub
systems. Linux utilizes available RAM as a dynamic page cache for file data, where free
memory is consumed by cached disk pages and reclaimed under pressure. The VFS
maintains inode and directory entry (dentry) caches in memory to accelerate metadata
lookups. Under memory pressure, the kernel prioritizes purging the page cache, as it is
reclaimable without terminating processes. On the I/O side, the file system issues block
reads/writes through the Linux block layer, which uses I/O schedulers (e.g., CFQ,
deadline, blk-mq) to optimize request ordering. For instance, ext4’s delayed-allocation
batches writes for efficient placement by the block layer. Thus, the file system sits
between memory and I/O, leveraging caches (page, inode, dentry) to reduce disk traffic
and relying on the block I/O subsystem for physical reads/writes, with locking and
journaling ensuring consistency.
Stakeholder Requirements:
Developers: Expect a stable, POSIX-compliant file API with features like large file
support, asynchronous I/O, symlinks, ACLs, and extended attributes. They value reliable
behavior across versions and robust debugging tools. Debian’s stability and free software
ecosystem, with its extensive libraries and predictable file system semantics, make it
appealing.
End Users: Demand simplicity and data safety, expecting file systems that are fast,
reliable, and recover transparently from crashes. Features like mount-on-insert for USB
drives, desktop disk utilities, and automatic resizing are valued, alongside data integrity
and performance for everyday tasks. Intuitive monitoring tools, graphical or command-
line, and minimal downtime on errors are essential.
Cross-Platform Design, Application & Implementation
Design and API Differences
Debian and Ubuntu share a Linux-based design, using dpkg/apt for package management,
adopting stable kernel releases, and targeting general-purpose use (desktops, servers,
embedded). Ubuntu enhances desktop usability with GNOME and Snap packaging,
incorporating newer kernels, while Debian prioritizes long-tested versions for stability.
Both adhere to POSIX/Linux-standard APIs. RHEL uses RPM/Yum/DNF packaging,
emphasizes certified enterprise software, and lags in adopting bleeding-edge kernels for
stability, enforcing SELinux by default for commercial users. Android employs a
modified Linux kernel with Google’s Bionic libc, exposing a Java-based API (Storage
Access Framework, content providers) rather than POSIX calls. Hardware support aligns
with these goals: Debian/Ubuntu support diverse architectures (x86_64, ARM, RISC-V),
RHEL focuses on enterprise hardware (x86_64, ARM, IBM Power), and Android
optimizes for flash based mobile hardware (eMMC, UFS).
From a UI perspective, Ubuntu provides desktop utilities like Disk Usage Analyzer and
Disk Utility. RHEL’s GUI tools (GNOME Disks, Cockpit) target administrators. Debian
emphasizes flexibility with command-line tools and manual partitioning. Android
abstracts file system details, automatically mounting partitions and providing user-facing
file managers for specific storage locations.
Debian(Linux) Uses ext4 by Standard Unix Broad hard ware Very stable,
default (fast permissions, support (x86, minimal in
for small optional ARM, etc.). staller/UI.
files, efficient SELinux/AppArm Supports most Command-
journaling). or, LUKS Linux file line tools
Lacks special encryption, ACLs. systems (ext4, dominate.
acceleration Ext4 journaling XFS, Btrfs, JFS, Less novice
for large files ensures crash ReiserFS, friendly
beyond resilience. Fewer FAT/NTFS) out- (manual
extents. default restrictions of-the-box. partitioning,
Stable but than RHEL. no default
not tuned for snap shots).
extreme Strong
throughput. community
support.
Integrity Flags: Files on ext2/3/4 can be marked immutable (chattr +i), preventing
modifications even by root. AppArmor/SELinux can enforce read-only or no-execute
policies.
Mount Options: Security flags like noexec, nosuid, and nodev on untrusted volumes
block code execution or device creation.
Isolation: Linux containers and Android’s multi-user model use namespaces and
SELinux domains to limit exploit scope.
• User-Driven Improvements:
• Performance Optimizations:
Tuned defaults.
Weaknesses: Conservative updates may delay support for newer hardware or file
systems. It lacks commercial support contracts, and default security policies are less strict
than RHEL’s.
Suitability: Debian’s openness and architecture support suit a locally developed OS for
diverse devices. Its stability and community-driven model align with national initiatives,
supporting critical systems like servers and educational platforms.
Suitability: RHEL suits PAK OS needs for security and reliability in critical
deployments. Free clones address cost concerns, offering enterprise-grade features
without licensing fees.
Justification: Debian and RHEL balance openness and enterprise support. Debian’s
customizability and ecosystem suit a homegrown OS, while RHEL’s security and support
meet strict requirements. Ubuntu could be a runner-up for desktop usability, but Debian
underpins it. Android is unsuitable for desktop/server use, and other distributions
(Fedora, SUSE) offer shorter support or smaller ecosystems.
References
1. File Systems, [Link] html
2. Linux Performance Tuning: Dealing with Memory and Disk IO, Yugabyte, https:
//[Link]/blog/linux-performance-tuning-memory-disk-io
3. Ext4- Debian Wiki, [Link]
4. Chapter 1. Overview of available file systems, Red Hat Enterprise Linux 9, https:
//[Link]/en/documentation/red_hat_enterprise_linux/9/html/managing_
file_systems/overview-of-available-filesystems_managing-file-systems.
5. What is Android’s file system?, Stack Overflow, [Link]
questions/2421826/what-is-androids-file-system
6. F2FS- Wikipedia, [Link]
7. File system drivers (Part 1), Linux Kernel Documentation, [Link]
labs. [Link]/refs/pull/189/merge/labs/filesystems_part1.html
8. Which OS is better? Red Hat (RHEL) vs. Debian, IONOS, [Link]
com/digitalguide/server/know-how/red-hat-vs-debian
9. Security-Enhanced Linux in Android, Android Open Source Project, https://
[Link]/docs/security/features/selinux
10. CVE-2025-23150 Impact, Exploitability, and Mitigation Steps, Wiz, [Link]
[Link]/vulnerability-database/cve/cve-2025-23150
11. dm-crypt- Wikipedia, [Link]
12. ‘chattr’ Commands to Make Important Files IMMUTABLE in Linux, Tecmint, 7
[Link]
13. Ext3- Debian Wiki, [Link]
14. Android moving from YAFFS2 to ext4, Forensic Focus Forums, [Link]
[Link]/forums/general/android-moving-from-yaffs2-to-ext4