Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File System Implementation Objective The objective of this assignment is to become familiar with the relationship between files and inodes on a UNIX or Linux

File System Implementation

Objective

The objective of this assignment is to become familiar with the relationship between files and inodes on a UNIX or Linux system. On these systems, files are represented with inodes. That is, an inode is a file (and vice versa). You can complete this exercise on the class server or empress.

Assignment:

In the source code available with this text, open file1.txt and examine its contents. Next, obtain the inode number of this file with the command:

ls -li file1.txt

This will produce output similar to the following:

16980 -rw-r--r-- 2 os os 22 Sep 14 16:13 file1.txt

where the inode number is boldfaced. (The inode number of file1.txt is likely to be different on your system.) The UNIX ln command creates a link between a source and target file. This command works as follows:

ln [-s]

UNIX provides two types of links: (1) hard links and (2) soft links. A hard link creates a separate target file that has the same inode as the source file. Enter the following command to create a hard link between file1.txt and file2.txt:

ln file1.txt file2.txt

What are the inode values of file1.txt and file2.txt? Are they the same or different? Do the two files have the sameor differentcontents?

Next, edit file2.txt and change its contents. After you have done so, examine the contents of file1.txt. Are the contents of file1.txt and file2.txt the same or different?

Next, enter the following command which removes file1.txt:

rm file1.txt

Does file2.txt still exist as well?

Now examine the man pages for both the rm and unlink commands. Afterwards, remove file2.txt by entering the command

strace rm file2.txt

The strace command traces the execution of system calls as the command rm file2.txt is run. What system call is used for removing file2.txt?

A soft link (or symbolic link) creates a new file that points to the name of the file it is linking to. In the source code available with this text, create a soft link to file3.txt by entering the following command:

ln -s file3.txt file4.txt

After you have done so, obtain the inode numbers of file3.txt and file4.txt using the command

ls -li file*.txt

Are the inodes the same, or is each unique? Next, edit the contents of file4.txt. Have the contents of file3.txt been altered as well? Last, delete file3.txt. After you have done so, explain what happens when you attempt to edit file4.txt.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago

Question

=+Are they specific or general in nature?

Answered: 1 week ago

Question

=+ What is the nature of the contracts or agreements with unions?

Answered: 1 week ago