0% found this document useful (0 votes)
53 views

CS 3307: Unit 5 - Lab Report Student Program Assignment University of The People

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
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

CS 3307: Unit 5 - Lab Report Student Program Assignment University of The People

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
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CS 3307: Unit 5 – Lab Report

Student Program Assignment


University of the People

This study source was downloaded by 100000813700581 from CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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.”
(die.net) 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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
#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);
...” (die.net, 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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
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 CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
Reference(s)

Chung, C. n.d. Understanding NTFS Hard Links, Junctions and Symbolic Links. Retrieved from
https://www.2brightsparks.com/resources/articles/NTFS-Hard-Links-Junctions-and-
Symbolic-Links.pdf

Geek University n.d. Inode. Retrieved on May 14, 2019 from https://geek-
university.com/linux/inode/

Die.net n.d. read. Retrieved on May 14, 2019 from https://linux.die.net/man/3/read

Arpaci-Dusseau. R., & Arpaci-Dusseau, A. (2012). Operating systems – three easy pieces.
University of Wisconsin–Madison: http://pages.cs.wisc.edu/~remzi/OSTEP/file-ffs.pdf

Hoffman, C. Feb 18, 2013. 6 Ways the Linux File System is Different from the Windows File
System. Retrieved from https://www.howtogeek.com/137096/6-ways-the-linux-file-
system-is-different-from-the-windows-file-system/

This study source was downloaded by 100000813700581 from CourseHero.com on 12-15-2021 21:26:01 GMT -06:00

https://www.coursehero.com/file/55531142/CS3307Unit5ProgramAssignmentdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like