So one of my assignments in CS2301 Operating Systems 1 required me to determine file systems in Linux. I found this asignment really interesting since I did not have Linux as my Operating System at the time of doing the assignment, So I installed Virtual Box from virtualbox.org and used a Linux ISO (I chose Kali Linux 2023.3 Version)
After installing Virtual Box and downloading Kali Linux ISO File, I created a new virtual machine, created a virtual hard disk, mounted the ISO, installed it and I had Kali Linux up and running virtually on my machine 😊!
Basically, filesystem serves as the blueprint or structure employed to house files within a storage device. Its primary function lies in the logical organization of a storage medium, allowing for the seamless arrangement, retrieval, modification, and deletion of files. Essentially, it acts as the virtual architecture that enables efficient navigation and management of data within the storage device.
The contemporary landscape boasts a myriad of filesystem options, each characterized by unique structures, logics, features, flexibility, and security attributes. Examples include Ext4, Btrfs, XFS, ZFS, NTFS, and FAT32.
For Linux system administrators, the ability to discern the filesystem type becomes crucial, whether for the purpose of mounting a filesystem or diagnosing potential issues. Varied filesystems come equipped with distinct tools tailored for tasks such as error checking, troubleshooting, and maintenance. Consequently, identifying the specific filesystem in use becomes paramount in determining the appropriate tools and methodologies for effective system management.
So I opted to employ two different methods, namely the df command-line tool and the lsblk command-line program, to scrutinize the filesystem types associated with various storage devices and partitions.
Method 1: Using the df Command-Line Tool
Executing the following command in the terminal $ df -Th
provides a succinct overview of the filesystem types associated with mounted storage devices and partitions.
Output:
└─$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 938M 0 938M 0% /dev
tmpfs tmpfs 197M 1.1M 196M 1% /run
/dev/sr0 iso9660 4.2G 4.2G 0 100% /run/live/medium
/dev/loop0 squashfs 3.7G 3.7G 0 100% /run/live/rootfs/filesystem.squashfs
tmpfs tmpfs 984M 127M 858M 13% /run/live/overlay
overlay overlay 984M 127M 858M 13% /
tmpfs tmpfs 984M 0 984M 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs tmpfs 984M 8.0K 984M 1% /tmp
tmpfs tmpfs 197M 132K 197M 1% /run/user/1000
┌──(kali㉿kali)-[~]
The columns in the output present crucial information:
• Filesystem: The storage device or partition name currently mounted.
• Mounted on: The directory where the storage device/partition is mounted.
• Type: The filesystem type of the mounted storage device/partition.
• Size: The size of the mounted storage device/partition.
• Used: The disk space used from the mounted storage device/partition.
• Use%: The percentage of disk space used.
• Avail: The amount of free disk space.
Observations:
- /dev/sr0 represents an ISO9660 filesystem, indicative of a live medium.
- /dev/loop0 employs a squashfs filesystem for the root filesystem.
- Understanding filesystem types aids in optimizing storage and efficient disk space management.
Method 2: Using the lsblk Command-Line Tool
Executing the following command $ lsblk -f
generates an output detailing essential information about filesystem types.
Output:
┌──(kali㉿kali)-[~]
└─$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0 squashfs 4.0 0 100% /usr/lib/live/mount/rootfs/filesystem.squashfs
/run/live/rootfs/filesystem.squashfs
sda
sr0 iso9660 Joliet Extension Kali Live 2023-08-21-16-17-11-00 0 100% /usr/lib/live/mount/medium
/run/live/medium
┌──(kali㉿kali)-[~]
Key details include:
• NAME: Storage device or partition name.
• MOUNTPOINT: Directory where the storage device/partition is mounted (if mounted).
• FSTYPE: Filesystem type of the storage device/partition.
• LABEL: Filesystem label.
• UUID: Universally Unique Identifier of the filesystem.
• FSUSE%: Percentage of disk space used.
• FSAVAIL: Amount of free disk space.
Observations:
• The lsblk
command reveals details about the loop device (loop0) using squashfs.
• The /dev/sr0
device displays an ISO9660
filesystem with a Kali Live label.
Conclusion
I believe the exploration of the Kali Linux file system using the df and lsblk commands offers insights into the filesystem types associated with mounted storage devices and partitions. These two methods I have used provide some glimpse into the storage architecture.
References:
[1] Wikipedia – File System
Thanks for reading: D
Ian.