Parmar_1230438757_M8A2
docx
keyboard_arrow_up
School
Arizona State University *
*We aren’t endorsed by this school
Course
510
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
13
Uploaded by CountSummer14886
1
Module 8: Assignment 2 – File System
Krupal Parmar
Information Technology, Arizona State University
IFT 510 Principles of Computer Information and Technology
Dinesh Sthapit
11/19/2023
2
Topic 1: Journaling File Systems
Q1:
A journaling file system is a type of file system that keeps track of changes that have not
been saved yet. It does this by recording the intentions of those changes in a log called a
"journal". This journal is usually a circular log. If the system crashes or loses power, these file
systems can be brought back online faster and are less likely to get damaged.
Depending on how it's set up, a journaling file system may only keep track of basic information
about files, which can make it run faster but also make it more likely for data to get messed up.
Instead, a journaling file system can keep track of both saved data and extra information about it.
Some versions let you choose how this works.
Benefits of Keeping a Journaling File System
Reduces the chance of losing or messing up data if the system crashes or the power goes out.
Faster to get the filesystem working again after it stops working.
Monitors and records any changes made to files that are currently being worked on.
You don't need to keep the journal log and file system on the same device.
Q2:
exFAT and NTFS are two different types of file systems. They are used to organize and store
data on a computer or storage device.
ExFAT is a type of storage system that was put into Windows in 2006. It works with more
devices and systems than NTFS, like media players and consoles. It's smaller and takes up less
space, so it's perfect for devices with not much power.
In contrast, NTFS has many new features like keeping a journal, compressing files, storing extra
data, and more. In general, these changes make it more dependable than exFAT and better at
recovering from a crash or other problem.
3
In short, use NTFS for your computer's main drives and exFAT for USB drives. Its low cost
makes it work well on flash memory, and most users don't need NTFS' extra features in this
situation.
NTFS and FAT32 are types of file systems used to organize and store data on a computer.
NTFS and FAT32 are similar in some ways but also have differences. FAT32 is older than exFAT
and doesn't have as many features. The main problem is that it can't store files that are bigger
than 4GB. It is not as secure as NTFS, it is harder to recover/repair files, and does not have
compression.
Why use FAT32. The main reason is because it is compatible with many devices. Because FAT32
is older, it has more support than exFAT. It should work well on all kinds of devices like printers,
media players, and TVs. For instance, macOS can read and write FAT32 drives, but can only
read NTFS drives. FAT32 is good for a USB drive but not good for regular use in a computer.
Comparison between FAT32 and exFAT FAT32 and exFAT are two types of file systems that are
used to organize and store data on computer devices.
If you have a USB drive, and you are deciding between using exFAT and FAT32, it depends on
how you will use the drive.
As we said before, FAT32 can be used with almost any device. exFAT might not work on older
devices but should work on newer ones. The PlayStation 3 can't use an exFAT drive, but the PS4
and PS5 can use both types of drives.
If you use old computer equipment, then FAT32 might be the best option. However, it may not be
a good idea to use it if you want to store big files because it has limits on file size. If you want to
watch videos from a USB stick, exFAT is the best option. exFAT is a little faster than FAT32. It's
a better choice unless your device can't use it.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
4
Ext4 and NTFS are both types of file systems. They are used to organize and store data on a
computer's hard drive.
People have been arguing about ext4 and NTFS for a long time on the internet. Which one is
better mostly depends on what someone thinks. Both can be used every day, but it's important to
know that ext4 partitions cannot be read by Windows operating systems. Often, it is used in
Linux and it has some benefits compared to NTFS.
Firstly, ext4 lets you use symbols like ". " in file names. As a fully journaled filesystem, it also
does not need fragmentation tools and is much quicker at checking disks.
However, NTFS also has some good points. Unlike ext4, it lets you securely delete files. It can
keep your files safe by making them secret and can make files smaller to save space on the
computer. It can read and write files on all Windows versions, and many Linux and BSD
versions, but it can only read files on macOS.
Topic 2: Introduction to Files
Q1:
Files are a fundamental concept in computer systems that allow for the storage and retrieval
of data. In the context of computing, a file is a collection of information, such as text, images, or
programs, that is stored as a unit with a specific name.
Kinds of Files:
Text files are simple documents that can be opened with a basic text editor.
Binary files store information in a way that people can't easily understand. Some examples are
programs you can run and pictures.
The second text is about simplifying a text. Types of files:
Files come in different types. For instance, usual text files are . txt, and picture files are . jpg,
png, and so on.
5
Different formats have their own way of organizing and rules for putting in information.
Rewrite this in simpler words: The location of a file:
A file path is the address of a file in the folders of a computer.
It has the main folder, folders inside, and the name of the file. For instance, the file example. txt
is located in C:UsersUsernameDocuments.
The text is not complete. Can you provide the full text. Working with files:
Reading from a File: Getting information from a file.
Saving or changing information in a document.
Getting rid of a file: Taking a file out of the file system.
Rewrite this text in simple words: 5. Do you have any questions about the instructions. "File
Systems: " can be written as "The way files are organized and stored in a computer. "
A file system is a way for computers to store and organize files on storage devices.
Some common file systems are NTFS, FAT32, and ext4. NTFS is for Windows, FAT32 is for
smaller devices, and ext4 is for Linux.
"Rewrite this text in simple words. " Managing files in programming:
Many coding languages have tools for working with files.
Typical things you can do are to open, read, write, and close files.
Q2: Sequential File Access:
Accessing files one after the other is the simplest way to access
them. This way of accessing data looks at one piece of information at a time, from the start to the
finish of the file.
Sequential file access is good for programs that work with data in a step-by-step way, like
reading or writing data in a log file or processing data in groups. For instance, if you have a lot of
6
data to study, it can be helpful to save the data in a specific order and then read it one piece at a
time to do the analysis you want.
Sequential file access is great because it's simple to use and easy to set up. On the other hand, its
biggest problem is that it might be slow and not work well when trying to access things in a
random order or with really big files.
Advantages:
1.
Simple Implementation: Sequential access is often easier to implement and is more
straightforward in terms of coding.
2.
Efficient for Certain Operations: It is efficient when you need to process data in a linear
manner, such as reading or writing data sequentially.
3.
Low Overhead: There is minimal overhead involved in managing the file pointer since it
moves in a linear fashion.
Limitations:
1.
Inefficient for Random Access: If you need to access data at a specific location in the file,
you have to traverse through all the preceding data, making it inefficient for random
access.
2.
Not Suitable for Modifications: If you need to modify or delete data in the middle of the
file, it may require rewriting the entire file from that point onward.
Direct File Access:
Accessing a file directly or by picking random parts. It lets us get
information from any part of the file without having to go through all the other records first. In
addition, this method finds information in the file by using where they are located.
Accessing files directly is good for apps that need fast and efficient access to specific data within
a file. For instance, in a database program, we might have to get customer information fast using
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
7
a specific customer ID. Direct file access means getting to the customer data quickly without
having to go through all the other records first.
Directly accessing a file is faster and more efficient for finding and using information from
different parts of the file. However, the main problem is that it can be harder to use than
sequential file access.
Advantages:
1.
Efficient for Direct Access: Random access is highly efficient when you need to access
specific data without traversing through the entire file.
2.
Suitable for Modifications: If you need to modify or delete data at a specific location,
random access allows for efficient updates without rewriting the entire file.
Limitations:
1.
Complex Implementation: Random access can be more complex to implement, especially
in comparison to the simplicity of sequential access.
2.
Higher Overhead: Managing a file with random access may involve additional overhead,
such as maintaining an index or file pointers.
3.
Less Efficient for Sequential Operations: Reading or writing data sequentially is less
efficient in a random access system compared to a sequential access system.
Q3:
Contiguous memory allocation means giving a process just one block of memory next to
each other. On the other hand, non-contiguous allocation divides the process into several pieces
and saves them in different memory locations.
The operating system needs to keep track of which parts of memory are being used by programs
in a clear and organized way. In non-contiguous memory allocation, each process has a table that
shows where its memory blocks are stored in the computer's memory.
8
During execution, the process is stored in a continuous memory space, so there is no need to
translate addresses. In non-contiguous memory allocation, there is an extra step of translating
addresses while running a program because the blocks of the program are not next to each other
in memory.
The operating system can manage and allocate memory in a more organized way. Alternatively,
the Non-Contiguous Memory Allocation is hard for the Operating System to handle.
On the other hand, when the process is spread out in different parts of the memory, it takes
longer to execute.
Contiguous memory allocation means putting all the memory needed for a program in one place.
It can be done in one big section or separated into different sections. However, Non-Contiguous
memory allocation includes Paging and Segmentation.
Both inside and outside pieces of memory happen with continuous memory allocation. On the
other hand, when memory is not arranged next to each other, it causes external fragmentation.
Processes that are swapped in are put into the space that was originally given to them in the
memory. On the other hand, when processes are swapped in with non-contiguous memory
allocation, they can be placed anywhere in memory.
Topic 3: File Allocation and Storage
Q1: Contiguous Allocation:
In this plan, each file takes up a set of blocks that are next to each other on the disk. For instance,
if a file needs n blocks and starts at block b, then the blocks given to the file will be: b, b+1, b+2,
……b+n-1. This means that if we know the beginning of a file and how big it is, we can figure
out which blocks the file is using.
The information about a file that is stored in one place.
9
Location of the first block
The size of the given part.
The file called 'mail' in the picture begins at block 19 and is 6 blocks long. So it takes up 19 to 24
blocks.
Benefits:
Both the Sequential and Direct Access methods are available in this. To find the address of the
kth block of a file that starts at block b, just add k to b.
This is very fast because the files are stored in a way that reduces the need to search for them.
Cons:
This is not good at using memory effectively.
Making a file bigger can be hard because it relies on having enough memory in one place at the
same time.
Linked List Allocation:
In this plan, each file is a list of disk blocks that are not next to each other. The blocks on the disk
can be found in different places.
The directory entry has a pointer that shows where the file starts and where it ends. Each block
has a pointer to the next block used by the file.
The picture shows how the blocks are scattered in the file called 'jeep'. The last block (25) is
empty and doesn't point to any other block.
connected
Benefits:
This can handle different size files easily. File size can be made bigger easily because the system
doesn't need to find a large block of memory all in one place.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
10
This method does not have a problem with extra space becoming unused. This means it uses
memory better.
Downsides:
The file blocks are scattered all over the disk, so it takes a lot of searching to find and access
each one. This makes linked allocation go more slowly.
It cannot support jumping to any part of the information directly. We can't get to the parts of a
file right away. To get to a block in a file, you have to go through k blocks one after the other,
starting from the beginning of the file and using block pointers.
Pointers needed in linked allocation cause extra work.
Indexed Allocation:
In this plan, a special block called the Index block has the pointers to all the blocks used by a
file. Every file has a block that keeps track of its positions. The index block has information
about where each file block is stored on the disk. The directory entry has the address of the index
block shown in the picture.
Benefits:
This allows you to quickly access the blocks used by the file.
It solves the issue of stuff getting stuck outside.
Cons:
Linked allocation is better than indexed allocation because it has less overhead.
For really tiny files, like ones that only take up 2-3 blocks, using indexed allocation could waste
a lot of memory because it needs a whole block just for the pointers. However, in linked
allocation, we only lose the space of one pointer per block.
Q2: Contiguous Allocation:
11
Each file occupies a contiguous block of storage on the disk.
Simple and easy to implement.
Reading and writing are generally faster because the entire file is stored in one
continuous block.
Performance Implications:
Efficient for sequential access since the blocks are adjacent.
Fragmentation can occur over time, leading to wasted space and potentially slower
performance.
Difficult to allocate space for growing files if contiguous space is not available.
2. Linked Allocation:
Each file is a linked list of disk blocks, with each block containing a pointer to the next
block.
No fragmentation issues since files can be scattered across the disk.
Performance Implications:
Efficient for sequential access within the file but may involve non-contiguous disk reads.
No need to pre-allocate space; it can grow dynamically.
Random access within a file can be slow due to the need to traverse the linked list.
3. Indexed Allocation:
An index block is used to store pointers to the actual data blocks of a file.
The index block contains entries for each data block, allowing for direct access.
Performance Implications:
Efficient for both sequential and direct access.
No external fragmentation as data blocks can be scattered across the disk.
12
Overhead in maintaining the index structure, but random access is faster compared to
linked allocation.
Comparison:
1. Space Utilization:
Contiguous allocation may lead to fragmentation, wasting space.
Linked and indexed allocations are more efficient in utilizing space, as they can handle
non-contiguous allocation without fragmentation.
2. Access Speed:
Contiguous allocation is generally faster for sequential access.
Indexed allocation is efficient for both sequential and direct access.
Linked allocation can be slow for direct access due to the need to traverse pointers.
3. Ease of Implementation:
Contiguous allocation is simpler to implement.
Linked allocation requires managing pointers and dynamic allocation.
Indexed allocation involves maintaining an index structure but allows for efficient access.
4. Fragmentation:
Contiguous allocation is prone to external fragmentation.
Linked and indexed allocations are less prone to fragmentation but may have internal
fragmentation in terms of unused space within blocks.
5. File Growth:
Contiguous allocation may require moving the entire file if it outgrows its allocated
space.
Linked and indexed allocations can easily accommodate file growth.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
13
References:
Topic 1:
File Systems from Tanenbaum, A.S. (2008). Modern operating systems (3rd ed., pp. 287).
Upper Saddle River, NJ: Prentice Hall.
McKusick, Marshall Kirk; Roberson, Jeff.
"Journaled Soft-updates"
Topic 2:
"Implementing a Custom File Format"
.
Microsoft Developer Network
Library. Microsoft
Corporation. 9 November 2010
. Retrieved 5 December 2010
.
https://www.prepbytes.com/blog/general/difference-between-sequential-and-random-
access-file/#:~:text=Sequential%20access%20files%20store%20and,updating%2C
%20and%20retrieving%20specific%20records
.
https://www.geeksforgeeks.org/difference-between-contiguous-and-noncontiguous-
memory-allocation/
Topic 3:
https://www.scaler.com/topics/file-allocation-methods-in-os/
https://www.javatpoint.com/os-allocation-methods
Related Documents
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage


EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning

Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,

Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage


EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning

Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,

Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning