0% found this document useful (0 votes)
24 views9 pages

CS 3307: Linux File Systems Overview

This lab report summarizes key differences between hard and symbolic links, describes what an inode is and how Linux reads files from disk. It also explains how the Fast File System improved on the original UNIX file system. Finally, it outlines several key differences between Windows and Linux file systems, such as directory structure, case sensitivity, use of backslashes vs. forward slashes, inclusion of drive letters, and ability to delete or modify open files.

Uploaded by

studyjunky
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views9 pages

CS 3307: Linux File Systems Overview

This lab report summarizes key differences between hard and symbolic links, describes what an inode is and how Linux reads files from disk. It also explains how the Fast File System improved on the original UNIX file system. Finally, it outlines several key differences between Windows and Linux file systems, such as directory structure, case sensitivity, use of backslashes vs. forward slashes, inclusion of drive letters, and ability to delete or modify open files.

Uploaded by

studyjunky
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CS 3307: Unit 5 – Lab Report

Student Program Assignment


University of the People

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
Assignment Introduction
This week’s assignment is to look at some file system related processes, research them and
provide summaries of each. Below are the details of what we will look at in this assignment.

 Describe Hard Links and Symbolic Links and the differences between them.
 Explain what an inode is and what it is used for in the Linux operating system.
 Explain the process by which the Linux operating system is able to read a file from disk.
 Describe the Fast File System and how it improved upon the original UNIX file system.
 Describe the differences, advantages and disadvantages between the Windows and
Linux file systems.

The answers for each of these will be provided in the results section of this paper.

Results
1. Hard and Symbolic Links:
Both Windows and Linux Operating systems have the concept of hard and symbolic links.
When reading up on them I found an article about windows that had a good description
of what a hard link is. This article describes a hard link as “a file that represents another
file on the same volume without actually duplicating the data of that file.” (Chung, n.d.).
What this means is that a hard link is linking to the underlying data itself, not copying it,
so if you delete the original file, the file with the hard link still shows the same
information as the originating file because you did not delete the information beneath
the file.

Use Case for hard links:


“An example of using hard links is when a user needs to have a file stored in two
different folders. He could copy the file to the other folder and have two copies of the
same file. However, twice the amount of storage space would be used.” (Chung, n.d.)
With a hard link the data is only stored once, there are two files with links to the same
information with only using the hard drive space of the original process.

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
A symbolic link by comparison is “a file system object that points to another file system
object. In simpler terms, it is a more advanced type of shortcut.” (Chung, n.d.) In this
type of link, if you delete the original file, then the files that were linked to that, can no
longer find the information.

2. Inode in Linux O/S systems:


In Linux an inode is “a data structure that stores various information about a file in Linux,
such as the access mode (read, write, execute permissions), ownership, file type, file
size, group, number of links, etc. Each inode is identified by an integer number. An inode
is assigned to a file when it is created.” (Geek University, n.d.) You could think of it like
the ‘address’ to the underlying data that makes up a file.
Below is a screen shot of what a listing of inode numbers:

3. Linux File read process:


The Linux file read process, read() function works this way, “attempts to read a certain
amount of bytes from the file associated with the open file descriptor, into the buffer.”
([Link]) See below code example of a file read in Linux.

“The following example reads data from the file associated with the file descriptor fd
into the buffer pointed to by buf.

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
#include <sys/types.h>
#include <unistd.h>
...
char buf[20];
size_t nbytes;
ssize_t bytes_read;
int fd;
...
nbytes = sizeof(buf);
bytes_read = read(fd, buf, nbytes);
...” ([Link], n.d.)

4. Fast File System:


The fast file system (FFS) was developed by a group at Berkeley. (Arpaci-Dusseau. R., &
Arpaci-Dusseau, A., 2012). It was developed to address performance issues with the
original file system used in Linux/Unix. This file system was designed with the intention
of building file structures and allocation policies that were “disk aware” to address the
disk fragmentation and performance issues that were part of the original file system.
They kept the same command APIs, like read(), write(), close(), etc. but changed the
internal implementation of those processes. By doing it this way they ensured
compatibility while gain the benefits of the new design.

5. Windows vs. Linux File Systems:


The below referenced article by Hoffman points out 6 differences between Windows and
Linux file systems. They consist of:
 Directory Structure:
Linux’s directly structure is a different layout than windows. See screen shot of
each type. Windows you will see something like C:\program files\application,

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
etc. where as in Linux files for applications are split between multiple locations
and put together in binaries, libraries, configuration files, /etc/.

 Case Sensitivity
Windows file system isn’t case sensitive so it would see a file named HAPPY and
happy as the same name so you can’t have them in the same directory. Linux is
case sensitive so it sees HAPPY and happy as different files and you can see both.

 Backslashes and Forward Slashes


Windows uses back slashes, while Linux uses forward slashes. As seen in the
directory structure file path examples, you can see windows file path would look

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
like this: C:\windows\program files and so on. Linux file path would look like this:
/media/howto and so on.

 No Drive Letters
Windows as you can see in the screen shot and example above uses drive letters.
Linux however does not do that as you can see in in the earlier screen shot and in
the sample path, there are no letters, only a forward slash /.

 Everything is a File (sort of)


While everything on Linux is not really a file, if you look at the screen shot below
from Linux, you can see that drives, appear as file path’s rather than as in
windows where you see drives as letters as described above.

In above you can see a cdrom drive is shown as a file path under dev folder, so it
would be /dev/cdrom. Where as windows would look like this:

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
The dvd drive shows as a separate new letter, it is not under a directory, instead it
is the top level resource.

 Delete and Modify Open Files.


On Linux and other UNIX-like operating systems, applications don’t lock exclusive
access to files as often as they do on Windows. What this means is that with
windows if you are looking at a file, you can’t delete it. This is where you would
see an error something like, “can’t modify or delete file in use.” However that
same file opened on Linux would allow you to delete it without an error.

One advantages of the Linux file structure over Windows is that for applications, you can
find individual files easily regardless of application. For example, because all libraries are
together you can quickly find a programs library files, where as with Windows you have
to search first for the application folders then search probably several folders to find one

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
or more of those same library files. One disadvantage of Linux over Windows is finding
external resource drives, like CDRoms you have to know its ‘file path’, yet with windows
those external and internal resources are at the top level and easy to find, as a letter.

Conclusion
This week we looked at Linux file systems and did some comparison with them to Windows file
systems. This was quite interesting, it helped me to learn a lot because I am quite familiar with
windows but have no background in Linux so the direct comparison was very helpful.

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
Reference(s)

Chung, C. n.d. Understanding NTFS Hard Links, Junctions and Symbolic Links. Retrieved from
[Link]
[Link]

Geek University n.d. Inode. Retrieved on May 14, 2019 from [Link]
[Link]/linux/inode/

[Link] n.d. read. Retrieved on May 14, 2019 from [Link]

Arpaci-Dusseau. R., & Arpaci-Dusseau, A. (2012). Operating systems – three easy pieces.
University of Wisconsin–Madison: [Link]

Hoffman, C. Feb 18, 2013. 6 Ways the Linux File System is Different from the Windows File
System. Retrieved from [Link]
system-is-different-from-the-windows-file-system/

This study source was downloaded by 100000813700581 from [Link] on 12-15-2021 21:26:01 GMT -06:00

[Link]
Powered by TCPDF ([Link])

Common questions

Powered by AI

New users transitioning from Windows to Linux might face challenges such as understanding the hierarchical directory structure without drive letters, adapting to case sensitivity in file names, and using different path separators . Additionally, they may struggle with Linux's permission and access model, which differs significantly from Windows, especially regarding executable permissions and the concept of everything being treated as a file . Learning to manage symbolic and hard links, as well as understanding the inode system for file metadata, could also present learning curves . Overcoming these challenges requires relearning tasks that are second nature in Windows but are fundamentally different in Linux due to the underlying file system philosophy and structure.

The file read process in Linux involves reading a specified amount of bytes from a file associated with an open file descriptor into a buffer, as part of its low-level read() function . This process is different from other operating systems that might enforce exclusive locking or require additional overhead for file operations. The advantage of Linux's approach is that it allows for concurrent access and modifications, leading to more efficient multitasking and resource management by avoiding unnecessary locking . Furthermore, it supports a more seamless experience in multi-user environments typical of UNIX-like systems.

The Linux file system's single-root structure allows users to navigate seamlessly worldwide in a unified directory tree, thereby offering consistent and simplified resource exploration across different types of devices without switching contexts or drive letters . This model facilitates easier scripting and automation, as paths are uniform regardless of device type . Additionally, standardized locations for different types of files (e.g., /bin/, /etc/) mean that users and system processes can predictably locate files, reducing the need for cumbersome searching through drive-specific hierarchies as seen in Windows . The absence of isolated drive designations enables Linux to more gracefully handle network and removable storage, treating them as extensions of the main directory structure .

An inode is a data structure in Linux that stores metadata about a file, except the file name and directory path, such as permissions, ownership, size, and location of the data blocks on disk . Each file has a unique inode number that allows the operating system to access and manage the file's data independently of its name and location in the directory hierarchy . Inodes are critical for file management as they enable efficient file retrieval and ensure consistent handling of file operations across different file systems, permitting features like hard links, which share the same inode .

Linux manages libraries by placing them in standardized directories like /lib/ and /usr/lib/, enabling quick access and management of shared resources by all users and system processes . This uniform structure simplifies maintenance and troubleshooting, as libraries are predictably located regardless of the application . However, the limitation of this approach is that it requires users to be familiar with the operating system's directory conventions and permissions model to avoid conflicts . In contrast, Windows typically stores application-specific libraries within the application's own directory, which can lead to redundancy and inconsistency but is more straightforward for application-specific isolation and management .

The lack of exclusive file locking in Linux means that files can often be accessed and modified by different users and processes simultaneously without restricting each other . This capability is advantageous in multi-user environments as it allows for greater flexibility and efficiency where resources are shared among multiple users or applications . However, it also introduces the potential for conflicts or data integrity issues if two processes attempt to modify a file concurrently without coordination. This necessitates the use of software-level locking mechanisms or version control systems to manage concurrent file access safely .

Windows and Linux file systems differ mainly in directory structure, case sensitivity, path separators, drive letter usage, and file handling methods . Linux uses a single-rooted directory structure, is case sensitive, employs '/' as the path separator, embeds drives into the directory tree without using drive letters, and allows more flexible file access and modification practices . In contrast, Windows uses multiple roots with drive letters (like 'C:'), is case-insensitive, and uses '\' for paths . These differences impact user experience; Linux users benefit from consistent file management practices and more streamlined directory navigation at the cost of complexity in locating hardware resources, whereas Windows users enjoy simplicity in accessing drives but at the cost of potentially cumbersome file management in large directory structures .

The Fast File System (FFS) introduced disk-aware file structures and allocation policies to address fragmentation and performance issues inherent in the original UNIX file system . It did so by organizing data in such a way that improved the speed of file access and minimized the movement of the disk arm by grouping related data blocks closer together . FFS maintained compatibility with existing command APIs such as read() and write(), allowing seamless adoption while enhancing performance through these architectural improvements . The changes primarily enhanced performance by reducing latency and optimizing storage efficiency.

Hard links point directly to the data of the original file, essentially acting as another name for the same data on disk. This means that even if the original file is deleted, the data remains accessible through the hard link because the data itself is not removed until all links are deleted . Symbolic links, on the other hand, are shortcuts or references to another file or directory, which means if the original file is deleted, the symbolic link becomes a broken link with no access to the data . These differences impact data management by influencing disk space usage and the risk of data loss: hard links save space by avoiding data duplication, while symbolic links can lead to issues if the target is moved or deleted, making data management critical to ensure data integrity.

Linux's "everything is a file" concept simplifies interface design and system interactions, as devices, directories, and network sockets can be accessed using standard file operations . This uniform treatment enhances flexibility and interoperability across different system components . However, the limitation of this approach is that it abstracts the differences between various resource types, which might obscure their unique attributes and functionalities, requiring additional commands or interfaces for specialized operations . Windows, having a more distinct treatment of drives and devices (e.g., using drive letters), can provide more intuitive navigation for users familiar with its layout, but at the cost of losing the broad applicability and simplicity of the UNIX-like approach .

You might also like