Assignment No. 1
Assignment No. 1
Assignment No. 1
A file system defines how files are named, stored, and retrieved from a storage device. Every time
you open a file on your computer or smart device, your operating system uses its file system
internally to load it from the storage device. Every time you open a file on your computer or smart
device, your operating system uses its file system internally to load it from the storage device.
Whenever you download a file or access a web page over the Internet, a file system is involved
too.
Why do we need a file system in the first place?
without a file system, the storage device would contain a big chunk of data stored back-to-back,
and the operating system wouldn't be able to tell them apart. The term file system takes its name
from the old paper-based data management systems, where we kept documents as files and put
them into directories. Imagine a room with piles of papers scattered all over the place. A storage
device without a file system would be in the same situation - and it would be a useless electronic
device.
However, a file system changes everything:
A file system isn't just a bookkeeping feature, though. Space management, metadata, data
encryption, file access control, and data integrity are the responsibilities of the file system too.
Most operating systems allow you to format a partition based on a set of file systems. For instance,
if you are formatting a partition on Windows, you can choose between FAT32, NTFS, and exFAT
file systems.
A file system is a set of data structures, interfaces, abstractions, and APIs that work together to
manage any type of file on any type of storage device, in a consistent manner. Each operating
system uses a particular file system to manage the files. In the early days, Microsoft used FAT
(FAT12, FAT16, and FAT32) in the MS-DOS and Windows 9x family. Starting from Windows
NT 3.1, Microsoft developed New Technology File System (NTFS), which had many advantages
over FAT32, such as supporting bigger files, allowing longer filenames, data encryption, access
management, journaling, and a lot more.
NTFS has been the default file system of the Window NT family (2000, XP, Vista, 7, 10, etc.) ever
since. NTFS isn’t suitable for non-Windows environments, though or you can just use the exFat
file system. Extended File Allocation Table (exFAT) is a lighter version of NTFS created by
Microsoft in 2006. exFAT was designed for high-capacity removable devices, such as external
hard disks, USB drives, and memory cards. exFAT is the default file system used by SDXC cards.
Unlike NTFS, exFAT has read and write support on non-Windows environments as well, including
Mac OS — making it the best cross-platform file system for high-capacity removable storage
devices.
So basically, if you have a removable disk you want to use on Windows, Mac, and Linux, you
need to format it to exFAT.
Apple has also developed and used various file systems over the years, including
Hierarchical File System (HFS), HFS+, and recently Apple File System (APFS).
Just like NTFS, APFS is a journaling file system and has been in use since the launch of OS X
High Sierra in 2017.
The Extended File System (ext) family of file systems was created for the Linux kernel - the core
of the Linux operating system.
The first version of ext was released in 1991, but soon after, it was replaced by the second extended
file system (ext2) in 1993.
In the 2000s, the third extended filesystem (ext3) and fourth extended filesystem (ext4) were
developed for Linux with journaling capability.
ext4 is now the default file system in many distributions of Linux, including Debian and Ubuntu.
Computers use particular kinds of file systems to store and organize data on media, such as a hard
drive or flash drive, or the CDs, DVDs, and BDs in an optical drive.
A file system can be thought of as an index or database containing the physical location of every
piece of data on the device. The data is usually organized in folders called directories, which can
contain other folders and files.
A file is a collection of related information that is recorded on secondary storage. Or file is a
collection of logically related entities. From user’s perspective a file is the smallest allotment of
logical secondary storage.
The name of the file is divided into two parts as shown below:
name
extension, separated by a period.
File
A file is a named collection of related information that is recorded on secondary storage such as
magnetic disks, magnetic tapes and optical disks. In general, a file is a sequence of bits, bytes,
lines or records whose meaning is defined by the files creator and user.
File Structure
A File Structure should be according to a required format that the operating system can understand.
• A file has a certain defined structure according to its type.
• A text file is a sequence of characters organized into lines.
• A source file is a sequence of procedures and functions.
• An object file is a sequence of bytes organized into blocks that are understandable
by the machine.
• When operating system defines different file structures, it also contains the code to
support these file structure. Unix, MS-DOS support minimum number of file
structure.
File Type
File type refers to the ability of the operating system to distinguish different types of file such as
text files source files and binary files etc. Many operating systems support many types of files.
Operating system like MS-DOS and UNIX have the following types of files −
Ordinary files
• These are the files that contain user information.
• These may have text, databases or executable program.
• The user can apply various operations on such files like add, modify, delete or
even remove the entire file.
Directory files
• These files contain list of file names and other information related to these files.
Special files
• These files are also known as device files.
• These files represent physical device like disks, terminals, printers, networks, tape
drive etc.
These files are of two types −
• Character special files − data is handled character by character as in case of
terminals or printers.
• Block special files − data is handled in blocks as in the case of disks and tapes.
Different types of file system in Windows OS
There are so many types of file systems; different file systems have unique features and have
their own ways of organizing data. Some have faster speed, some provide better compatibility,
and other has better security.
For Windows operating systems, FAT16, FAT32, exFAT and NTFS are four types of file
systems most widely adopted by users. Here are some brief introductions about the different
features of these four file systems.
● FAT16, also known as File Allocation Table 16, was created for old systems like MS-DOS,
Windows 95. FAT16 uses a 16-bit binary number to keep clusters, and this is why it called
FAT16. If a file exceeds the capacity of singular sector of a FAT16 partition, it would take more
space than the size of the file itself.
FAT16 is outdated because it has a big weakness: it supports partition with a capacity of no more
than 2GB. In today’s world, it is really difficult to find a disk under 2GB, and a 2GB disk cannot
meet the demand of most users.
● FAT32 file system was firstly introduced by Microsoft in 1996 to be taken as the advanced
edition of FAT16. It uses 32-bit binary number to hold clusters, limiting the partition or volume
size up to 2TB with a sector size of 512 bytes. And it works with most of Windows, even Mac,
and game consoles.
But it also has a size limit. It can only support a maximum of 32GB partition, and a maximum of
4GB single file. If you copy a file like a movie that is usually larger than 4GB to a FAT32 hard
drive, you will be told that the file is too large for the destination disk.
● NTFS stands for New Technology File System. It is a great improvement in many aspects over
FAT32 and FAT16 file system. It uses B-tree structure that allows users to use hard disk larger
than 2TB and provides much fast speed, making itself a popular choice among an increasing
number of Windows users. Besides, NTFS is a journaling file system that resists data loss and
damage. It has additional permission settings that can encrypt files to control access of files and
folders.
However, NTFS file system also has its weakness: it is only compatible with Windows 2000 and
later versions. And NTFS doesn’t support PS4, android smartphone, camera, and other devices.
Mac OS X can only read NTFS partition.
● exFAT is a new file system launched in 2006, which was usually used for flash memory like
USB flash drive, SD card. It can be seen as a lightweight of FAT32 without additional features
of NTFS. exFAT makes up for the disadvantages of FAT32 in file size and the compatibility of
NTFS, which means it can store a file larger than 4GB and can both work in Windows and Mac
OS.
However, exFAT file system is not suitable for HDD on computers, otherwise, the performance
and service life would be seriously affected. And it doesn’t work in the Windows XP system.
A file system in an operating system decides the way the contents of its storage medium (secondary
memory, etc) are stored and organized. Examples of filesystems are btrfs, xfs, zfs, ext series, ntfs,
etc. These filesystems differ in aspects of implementation, use cases, etc. A filesystem is essential
in the proper and efficient functioning of an operating system.
A file system in OS dictates how the contents of a storage medium are stored and organized. These
storage media (such as secondary memory, external drives, etc) could be computer secondary
memory, flash memory, etc. The contents are either files or directories. Most of the time, a storage
device has a number of partitions. Each of these partitions is formatted with an empty filesystem
for that device. A filesystem helps in separating the data on the storage into comparatively smaller
and simpler segments. These chunks are files and directories. The filesystem also provides for
storing data related to files, such as their name, extension, permissions, etc.
Properties of a Filesystem
Files are stored on a storage medium such as disk and do not vanish when a user logs out of the
computer system. With each file are associated access permissions, which permit controlled
sharing of that file. Files may form arranged or complex structures according to the relationship
among them. Several files can be grouped together under a directory.
A directory also referred to as a folder also has attributes similar to those of a file, such as a
name, size, location, access permissions, etc.
A file system also provides several features such as a crash recovery mechanism, data
loss/corruption prevention, etc.
Functions of a File
• A file system controls the way the contents of a storage medium are stored, organized, and
accessed.
• A file is a logical unit of information created by processes and managed by the OS.
• File attributes are configuration and information associated with files.
• There are three types of files accessing mechanisms in operating systems, namely, indexed,
direct and sequential.
• There are a large number of file types, such as media, programs, files internal to OS,
documents, etc.
• There are three methods of space allocation in a filesystem, namely, contiguous, indexed,
and linked.
• In contiguous space allocation, In this method, every file occupies a set of consecutive
addresses on the storage.
• Indexed space allocation method maintains a set of pointers is in an index table.
• In Linked space allocation each data block in the file contains the address of the next block.
Each entry in a directory contains file-name, block address, and a pointer to the last block.
Classification of Files:
• Alphabetical Classification.
• Numerical Classification.
• Geographical Classification.
• Subject Classification and.
• Chronological Classification.