Question

In: Computer Science

(Operating System CSE) Consider a file system in which a file can be deleted and its...

(Operating System CSE)

Consider a file system in which a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided?2)Consider a file systemthat uses a modifiedcontiguous-allocation scheme with support for extents.A file is a collection of extents, with each extent corresponding to a contiguous set of blocks. A key issue in such systems is the degree of variability in the size of the extents. What are the advantages and disadvantages of the following schemes? a. All extents are of the same size, and the size is predetermined. b. Extents can be of any size and are allocated dynamically. c. Extents can be of a few fixed sizes, and these sizes are predetermined.3)If all the access rights to an object are deleted, the object can no longer be accessed. At this point the object should also be deleted, and the space it occupies should be returned to the system. Suggest an efficient implementation of this scheme.

Solutions

Expert Solution

Obviously, the filesystem code has a rather severe bug. The only fix is to FIX THE BUG.

Unix fixed this in the mid 1980s (BSD developed) by extending a design from the 1970s - using “reference counting”.

Each file on disk is represented by an inode. The inode has a reference count, and the file is not deleted until the reference count goes to zero. Every time a link is made, the reference count is incremented. Every time a link is removed, the reference count is decremented.

Easy to know when a file is to be deleted. Even if the system crashes, a file is only deleted if the reference count is 0. It COULD have “orphan” files where the deletion couldn’t finish before a crash - these “lost” files are those where the reference count isn’t zero, but there are no links. Thus a file system corruption (minor) occurs - and a filesystem check pass was used to identify these and enter them into “lost+found” directory so the admin can decide what to do. Journaling filesystems covered this by recording what was going on in the filesystem at the time, thus a crash recovery just replays the journal, and finishes the delete.

Late 1980s through 1991s extended this reference counting to include any open file - thus a two level count, where processes with open files get counted as a reference. File systems still tracked the links, but when the link goes to zero the filesystem is prevented from deleting the file as the open file count may still be non-zero, thus the file doesn’t get deleted.

This added feature made it MUCH easier to update the system as executables and shared libraries could now be removed and replaced without causing problems to the running system.

Linux just used the same system when released around 1993 as the technique had become an industry standard.

Symbolic links are explicitly NOT part of this as they can cross filesystem boundaries. These links are interpreted by kernel software and are not the same kind of link, though they can act in a similar way. Having dangling symbolic links is not a fault of the filesystem, as what is left may be in another filesystem (which might not be mounted)… So it is not an error in either filesystem. The symbolic link itself also identifies WHAT is being linked to, so there is still data available about the link, and the admin/user can decide what to do about it.

I dont know much about file systems but i wrote it all which i thought was correct


Related Solutions

1)Consider a file system in which a file can be deleted and its disk space reclaimed...
1)Consider a file system in which a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided? 2)Consider a file systemthat uses a modified contiguous-allocation scheme with support for extents.A file is a collection of extents, with each extent corresponding to a contiguous set of blocks....
(Operating System , CSE) What commonly used computer programs are prone to man-in-the-middle attacks? Discuss solutions...
(Operating System , CSE) What commonly used computer programs are prone to man-in-the-middle attacks? Discuss solutions for preventing this form of attack.
Part A Operating systems generally maintain a computer’s file system. Which of the following items of...
Part A Operating systems generally maintain a computer’s file system. Which of the following items of information about a file would you expect an operating system to maintain? Note: This question gives a small amout of negative marks for wrong answers. Select one or more: a. File password b. Modification date c. Ownership d. Font size e. Access permissions f. Last access date g. File checksum h. Location (directory) i. Colour j. Expiry date k. File name l. File size...
3.2 Comparing and contrasting components of an operating system File systems and features Features File management...
3.2 Comparing and contrasting components of an operating system File systems and features Features File management Services Processes Drivers Utilities Interfaces
What is an operating system? What are its functions? What are the types of operating system?
What is an operating system? What are its functions? What are the types of operating system?
Consider the relation T on the set of all undergraduate TAs (UTA) for the CSE department...
Consider the relation T on the set of all undergraduate TAs (UTA) for the CSE department where s1 T s2 if and only if s1 and s2 are UTAs for the same course. (a) Assuming that no one is a UTA for multiple courses, prove that T is an equivalence relation. (b) Assuming that no one is a UTA for multiple courses, what do the equivalence classes for T represent? (c) Explain why the assumption that no one is a...
1. When a file is created on Linux Operating System, What are the default permissions of...
1. When a file is created on Linux Operating System, What are the default permissions of the file? 2. Write a command to find the total disk space used by a specific user on linux system? 3. What is "s" permission bit in a file? 4. Explain the difference between grep and egrep? 5. Write a command to list files where third letter is x or y? 6. Write command to remove array element with id 5? 7. Write a...
Assume there is a file which consists of 20 blocks. Consider that the file-control block is...
Assume there is a file which consists of 20 blocks. Consider that the file-control block is already stored in the memory. Calculate the number of disk I/O operations are required for contiguous and linked allocation strategies, if, for one block, the following conditions hold. Also assume that the block information to be added is stored in memory. a. The block is added at the beginning. b. The block is added in the middle. c. The block is added at the...
Its a (Test) Case of Swapping Download swap_case_test.c here, or copy it to your CSE account...
Its a (Test) Case of Swapping Download swap_case_test.c here, or copy it to your CSE account using the following command: cp -n /web/cs1511/20T3/activities/swap_case_test/swap_case_test.c . Read Me First: Software Testing One of the most fundamental parts of writing software is testing. In this course, we mostly do the testing for you -- the autotest program checks your software is correct. While this is handy, testing will not always be so easy. In the following labs, and in Assignment 2, there will...
a)examine five factors to consider when selecting an operating system
a)examine five factors to consider when selecting an operating system
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT