0% found this document useful (0 votes)
80 views17 pages

OSY Winter 23

Osy winter 23 msbte questions bank

Uploaded by

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

OSY Winter 23

Osy winter 23 msbte questions bank

Uploaded by

milindnagare13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

OSY Winter 23 Question Paper

1. Attempt any FIVE of the following: 10

a) Define real time operating system, along with any two applications of it.
Ans.Real time Operating System:
A real time system has well defined fixed time constraints. Processing
should be done within the defined constraints -Hard and Soft real time
system.
OR
The real-time operating system used for a real-time application means
for those applications where data processing should be done in the fixed
and small quantum of time.
Types of real time operating system
1. Hard real-time
2. Soft real-time
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications

b) List any four services provided by operating system.


Ans.1.User Interface: All operating systems have a user interface that
allows users to communicate with the system. Three types of user
interfaces are available:
a. Command line interface (CLI)
b. Batch interface
c. Graphical user interface (GUI)
2. Program execution: The operating system provides an environment
where the user can conveniently run programs. It also performs other
important tasks like allocation and deallocation of memory, CPU
scheduling etc. It also provides service to end process execution either
normally or abnormally by indicating error.
3. I/O operations: When a program is running, it may require
input/output resources such as a file or devices such as printer. So the
operating system provides a service to do I/O.
4.File system manipulation: Programs may need to read and write data
from and to the files and directories. Operating system manages the
secondary storage. Operating system makes it easier for user programs
to accomplish their task such as opening a file, saving a file and deleting
a file from the storage disk.
5.Communication: In the system, one process may need to exchange
information with another process. Communication can be implemented
via shared memory or through message passing, in which packets of
information are moved between processes by the operating system.
6.Error detection: Operating systems detects CPU and memory
hardware such as a memory error or power failure, a connection failure
on a network or lack of paper in the printer etc.
7.Resource allocation: Operating system manages resource allocation
to the processes. These resources are CPU, main memory, file storage
and I/O devices.
8.Accounting: Operating system keeps track of usages of various
computer resources allocated to users.

c) Draw neat labelled process state diagram along with the correct directions of arrows.
Ans.

d) Define CPU bound program and I/O bound program.


Ans.CPU bound program: If execution of a program is highly dependent on the CPU then it is
known as CPU bound program.
OR
If a task does a lot operations using CPU, it's called a CPU-bound task.
I/0 bound program: If execution of a program is dependent on the input-output system and its
resources, such as disk drives and peripheral devices then it is known as 1/0 bound program.

e) Define paging and segmentation.


Ans.Paging is a memory management scheme that permits the physical address space of process
to be noncontiguous. Logical memory is divided into blocks of same size called as pages.
OR
Paging is a storage mechanism used in OS to retrieve processes from secondary storage to the
main memory as pages.
OR
The process of retrieving processes in the form of pages from the secondary storage into the
main memory is known as paging.

Segmentation is a memory management scheme that permits dividing logical address space into
multiple segments.
OR
Segmentation divides the Computer's physical memory and program's address space into
segments.

f) What is the use of PS command? Write long forms of UID, PID in the output of this
command.
Ans.ps command:It is used to display the characteristics of a process.
This command is used to list the processes associated with a user at a particular terminal.
UID - (Owner) User-id
PPID - Parent Process-id

g) List any four file operations.


Ans.
 Creating a file
 Writing a file
 Reading a file
 Repositioning within a file
 Deleting a file
 Appending new information to the end of the file
 Renaming an existing file.
 Truncating a file
 Creating copy of a file, copy file to another 1/0 device such as printer or display

2.Attempt any TH REE of the following: 12

a) Describe multiprocessor OS with it’s advantages (any two).


Ans.Multiprocessor systems are also known as parallel systems of tightly coupled systems.
 These systems have two or more processors in close communication and they share
computer resources such as bus clock, memory and peripheral devices.
 The whole task of multiprocessing is managed by the operating system, which allocates
different tasks to be performed by the various processors in the system.
 Applications designed for the use in multiprocessing are said t be threaded, which
means that they are broken into smalle routines that can be run independently.
 Multiple CPUs are linked together so that a job can be divide and executed more
quickly. When a job is completed, the result from all CPUs are compiled to provide the
final output.

Advantages
 Increased reliability: Due to the multiprocessing system, processing tasks can be
distributed among several processors. This increases reliability as if one processor fails;
the task can be given to another processor for completion.
 Increased throughout: As several processors increase, more work can be done in less
time.
 The economy of Scale: As multiprocessors systems share peripherals, secondary storage
devices, and power supplies, they are relatively cheaper than single-processor systems.
 Reduce Cost

b) Write down the responsibilities of the following components of OS.


i) Memory management
ii) File management
Ans.i) Memory Management:
• Keeping track of which parts of memory are currently being used and by whom.
 Deciding which processes (or parts thereof) and data to move into and out of memory.
 Allocating and deallocating memory space as needed.
 Managing swap spaces, which store inactive pages of memory.
 Implementing policies for memory allocation.
File Management:
 The creation and deletion of files.
 The creation and deletion of directory
 The support of primitives for manipulating files and directions.
 The mapping of files onto secondary storage.
 The backup of files on stable storage media.
 Adding and editing the data in files.
 Moving files from one location to another.
 Store, arrange, or accessing files on a disk or other storage locations.
c) Explain shared memory method of IPC using neat labelled
diagram.
Ans.Inter-process communication: Cooperating processes require an Inter- process
communication (IPC) mechanism that will allow them to exchange data and information.

 In this, all processes who want to communicate with other processes can access a region
of the memory residing in an address space of a process creating a shared memory
segment.
 All the processes using the shared memory segment should attach to the address space
of the shared memory. All the processes can exchange information by reading and/or
writing data in shared memory segment.
 The form of data and location are determined by these processes who want to
communicate with each other.
 These processes are not under the control of the operating system.
 The processes are also responsible for ensuring that they are not writing to the same
location simultaneously.
 After establishing shared memory segment, all accesses to the shared memory segment
are treated as routine memory access and without assistance of kernel.

d) Explain following terms with respect to scheduling


i) CPU utilization
ii) Throughput
iii) Turnaround time
iv) Waiting time
Ans.
 CPU utilization: In multiprogramming the main objective is to keep CPU as busy as
possible. CPU utilization can range from 0 to 100 percent.
 Throughput: It is the number of processes that are completed per unit time. It is a
measure of work done in the system. Throughput depends on the execution time required
for any process.
 Turnaround time: The time interval from the time of submission of a process to the
time of completion of that process is called as turnaround time. It is the sum of time
period spent waiting to get into the memory, waiting in the ready queue, executing with
the CPU, and doing 1/0 operations.
 Waiting time: It is the sum of time periods spent in the ready queue by a process. When
a process is selected from job pool, it is loaded into the main memory. A process waits in
ready queue till CPU is allocated to it.
3.Attempt any THREE of the following: 12
a) Explain following commands with their syntax –
i) Kill
ii) Sleep
iii) Wait
iv) Exit
Ans.
i)kill
Syntax: kill pid
Kill command is used to stop execution of particular process by sending an interrupt signal to the
process
ii)Sleep
Syntax: sleep NUMBER|SUF FIX]
The sleep command pauses the execution for specified time in command.
iii) Wait
Syntax: wait [pid]
Wait command waits for running process to complete and return the exit status.
iv) Exit
Syntax: exit
used to quit the shell (OR)
Syntax: exit[n]
The terminal window will close and return a status of n

b) What is deadlock? Discuss any one method of deadlock prevention.


Ans.A deadlock is a situation where a set of processes are blocked because each process is
holding a resource and waiting for another resource acquired by some other process.
Methods for deadlock prevention (Any 1)
1. Eliminate Mutual Exclusion:
The mutual-exclusion condition must hold for non-sharable resources.
Mutual section from the resource point of view is the fact that a resource can never be used by
more than one process simultaneously which is fair enough but that is the main reason behind the
deadlock.
If a resource could have been used by more than one process at the same time then the process
would have never been waiting for any resource.Read-only files are a good example of a
sharable resource. If several processes attempt to open a read-only file at the same time, they can
be granted simultaneous access to the file.
A process never needs to wait for a sharable resource. Sharable resources, in contrast, do not
require mutually exclusive access and thus cannot be involved in a deadlock
2. Eliminate Hold and Wait:
One way to avoid this Hold and Wait is when a process requests a resource; it does not hold any
other resources. One protocol that can be used requires each process to request and be allocated
all its resources before it begins execution. Another protocol that can be used is, to allow a
process to request resources only when the process has none. A process may request some
resources and use them.
Before it requests any additional resources, it must release all the resources that are currently
allocated to it.
3. Eliminate No Preemption:
If a process that is holding some resources requests another resource that cannot be immediately
allocated to it, then all resources currently being held are preempted. That is this resources are
implicitly released. The preempted resources are added to the list of resources for which the
process is waiting. Process will be restarted only when all the resources i.e. its old resources, as
well as the new ones that it is requesting will be available.Preemption ensures that resources are
efficiently utilized and prevents deadlocks caused by the hold and wait condition.
4. Eliminate Circular Wait:
Circular-wait condition never holds is to impose a total ordering of all resource types, and to
require that each process requests resources in an increasing order of enumeration.
Let R = {R1, R2, ..., Rn} be the set of resource types. We assign to
each resource type a unique integer number, which allows us to compare two resources and to
determine whether one precedes another in our ordering. Formally, define a one-to-one function
F: R N, where N is the set of natural numbers.

c) Describe concept of free space management technique using bit map method.
Ans.Bit Map:
The free-space list is implemented as a bit map or bit vector.
Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit
is 0.
For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of
the blocks are allocated.
The free-space bit map would be : 0011110011111100

1=Free block 0=Allocated block


The main advantage of this approach is its relative simplicity and its efficiency in findingthe first
free block or n consecutive free blocks on the disk.
d) Draw the diagram of linked file allocation method and explain it.
Ans.
This allocation is on the basis of an individual block. Each block contains a pointer to the next
block in the chain.
 In this scheme, each file is a linked list of disk blocks which need not be contiguous.
The disk blocks can be scattered anywhere on the disk.
 The directory contains a pointer to the first and the last blocks of the file.
 Creating a file is easy. We simply create a new entry in the device directory. A write to
a file removes first free block from free space list and write to it. This new block is then
linked to the end of the file. To read a file, we simply read block by following the
pointers from block to block.
 There is no external fragmentation with linked allocation.

 There is no external fragmentation since only one block is needed at a time.


 The size of a file need not be declared when it is created.
 A file can continue to grow as long as free blocks are available
 This method is used only for a sequential access files
 This method requires more space to store pointers
 So instead of blocks, clusters are used for allocation but this creates internal
fragmentation.

4. Attempt any THREE of the following: 12


a) Compare between CLI based OS and GUI based OS (any four points).
Ans.
b) What are the different types of system calls? Give examples of each.
Ans.System call provides an interface between a running program and
operating system. It allows user to access services provided by
operating system. This system calls are procedures written using C,
C++ and assembly language instructions. Each operating system has its
own name for each system call. Each system call is associated with a
number that identifies itself.
System calls:
Process Control: Program in execution is a process. A process to be
executed must be loaded in main memory. while executing it may need
to wait, terminate or create & terminate child processes.
 Create/ Terminate process
 Load/Execute Process.
 End/Abort process.
 Ready process/Dispatch process.
 Suspend process/Resume Process.
 Get/Set Process Attributes.
 Wait event, signal event
 Allocate and deallocate memory
File Management: System allows us to create and delete files. For
create and delete operation system call requires the name of the file and
other attributes of the file. File attributes include file type, file size,
protection codes, accounting information and so on. Systems access
these attributes for performing operations on file and directories. Once
the file is created, we can open it and use it. System also allows
performing reading, writing or repositioning operations on file.
 create new file, delete existing file
 open, close file
 Create and delete directories
 read, write, reposition
 get/set file attributes
3. Device Management: When a process is in running state, it requires
several resources to execute. These resources include main memory,
disk drives, files and so on. If the resource is available, it is assigned to
the process. Once the resource is allocated to the process, process can
read, write and reposition the device.
 request device, release device
 read, write, reposition
 get/set device attributes
 logically attach or detach devices
4. Information Maintenance: Transferring information between the
user program and the operating system requires system call. System
information includes displaying current date and time, the number of
current user, the version number of the operating system, the amount of
free memory or disk space and so on. Operating system keeps
information about all its processes that can be accessed with system
calls such as get process attributes and set process attributes.
 get/set time or date
 get/set system data
 get/set process, file, or device attributes
5. Communication: Processes in the system, communicate with each
other. Communication is done by using two models: message passing
and shared memory. For transferring messages, sender process
connects itself to receiving process by specifying receiving process
 create, delete communication connection
 send, receive messages
 transfer status information
 attach or detach remote devices

c) Explain working of CPU switch from process to process with neat labelled diagram.
Ans.A CPU switch from process to process is referred as context switch.
A context switch is a mechanism that store and restore the state or context of a CPU in Process
Control block so that a process execution can be resumed from the same point at a later time.
When the scheduler switches the CPU from one process to another process, the context switch
saves the contents of all process registers for the process being removed from the CPU, in its
process control block.Context switch includes two operations such as state save and state restore.
State save operation stores the current information of running process into its PCB. State restore
operation restores the information of process to be executed from its PCB. Switching the CPU
from one process to another process requires performing state save operation for the currently
executing process (blocked) and a state restore operation for the process ready for execution.
This task is known as context switch.

d) Solve given problem by using FCFS scheduling algorithm.


Draw correct Gantt chart and calculate average waiting time
and average turnaround time –
Process Arrival time Burst time
P0 0 10
P1 1 29
P2 2 3
P3 3 7
P4 4 12
Ans.

e) Which hole is taken for next segment request for 8 KB in a


swapping system for First fit, Best fit and Worst fit.
OS
4 KB
9 KB
20 KB
16 KB
8 KB
2 KB
6 KB
Ans.

5.Attempt any TWO of the following: 12


a) Write two uses of the following operating system tools –
i) Security policy
ii) User management
iii) Performance Monitor
Ans.
A) Security Policy:
 As OS security policies and procedures cover a large area, there are following techniques
to addressing them:
 Installing and updating anti-virus software
 Ensure the systems are patched or updated regularly $ yum updates
Syum check-update
 Implementing user management policies to protect user accounts and privileges.
 Installing a firewall and ensuring that it is properly set to monitor all incoming and
outgoing traffic.
 Use Secure SSH: Telnet and rlogin protocols uses plain text, not encrypted format
which is the security breaches. SSH is a secure protocol that use encryption technology
during communication with server. Never login directly as root unless necessary. Use
"sudo" to execute commands.
$ vi /etc/ssh/sshd _config
$ PermitRootLogin no #disable root login
$AllowUsers username # Allow only specific users
$ Protocol 2 #use SSH protocol 2 version
Lock and Unlock Features: They are very useful, instead of removing an account from the
system, you can lock it for an week or a month. To lock a specific user, you can use the follow
command. $ passwd - 1 accountname
Turn Off IPv6: If you are not using a IPvo protocol, then you should disable it because most of
the applications or policies not required IPv6 protocol and currently it doesn't required on the
server. Go to network configuration file and add followings lines to disable it.
# vi /etc/sysconfig/network
NETWORKING_IPV6=no
IPV6INIT=no
Enables Iptables (Firewall): It is highly recommended to enable Linux firewall to secure
unauthorised access of your servers. Apply rules in iptables to filters incoming, outgoing and
forwarding packets.
We can specify the source and destination address to allow and deny in specific udp/tep port
number.
Use Strong Password Policy: Passwords are always a security problem because humans are.
People often cannot be bothered to come up with a lot of different passwords, so they use the
same ones in different places or combinations that are easy to remember, like
"password" or "abcde". Basically, a gift to hackers. Make it a requirement that any password
must contain both upper and lower case, be a mix of numbers, letters and symbols and you'll be
way safer.

B) User management:
ï‚· User management includes everything from creating a user to
deleting a user on your system. User management can be done
in three ways on a Linux system.
ï‚· Command line tools include commands like useradd, userdel,
usermod, passwd, etc. These are mostly used by the server
administrators.
Useradd: With useradd commands you can add a user.
Syntax: useradd -m -d /home/<userName> -
c "<userName>" <userName>
Example: useradd -m -d /home/xyz -c "xyz" xyz
File /etc/default/useradd contains some user default options.
The command useradd -D can be used to display this file.
Syntax: useradd -D
Userdel: To delete a user account userdel command is used.
Syntax: userdel -r <userName>
Usermod: The command usermod is used to modify the properties of
an existing user.
Syntax: usermod -c <'newName'> <oldName>
Example: usermod -c 'vppoly' john
Using passwd command
Passwd: A user can set the password with the command passwd. Old
password has to be typed twice before entering the new one.
Syntax: passwd <userName>
Example: passwd vppoly

C) Performance Monitor:
It is very tough job for every system or network administrator to
monitor and debug Linux System Performance problems every day.
The commands discussed below are some of the most fundamental
commands when it comes to system analysis and debugging Linux
server issues such as:
1) vmstat: Virtual memory statistics
The vmstat command reports information about processes, memory,
paging, block IO, traps, and cpu activity.
$ vmstat 3
2)top: Process activity monitoring command top command display Linux processes. It provides
a dynamic real-time
view of a running system i.e. actual process activity. By default, it
displays the most CPU-intensive tasks running on the server and
updates the list every five seconds.
$ top
3) free: Show Linux server memory usage
free command shows the total amount of free and used physical and
swap memory in the system, as well as the buffers used by the kernel.
# free
4) iostat: Montor Linux average CPU load and disk activity
iostat command report Central Processing Unit (CPU) statistics and
input/output statistics for devices, partitions and network filesystems
(NFS).
# iostat
5) netstat Linux network and statistics monitoring tool
netstat command displays network connections, routing tables,
interface statistics, masquerade connections, and multicast
memberships.
# netstat –tulpn

b) Differentiate between process and thread (any two points). Also discuss the benefits of
multithreaded programming.
Ans.
Comparis Process Thread
on Basis
Definition A process is a program under A thread is a lightweight process that can
execution i.e. an active program. be managed independently by a scheduler
Context Processes require more time for Threads require less time for context
switching context switching as they are heavier. switching as they are lighter than
time processes.
Memory Processes are totally independent and A thread may share some memory with its
Sharing don’t share memory. peer threads.
Communic Communication between processes Communication between threads requires
ation requires more time than between less time than between processes.
threads.
Blocked If a process gets blocked, remaining If a user level thread gets blocked, all of
processes can continue execution. its peer threads also get blocked.
Resource Processes require more resources than Threads generally need less resources
Consumpti threads. than processes.
on
Dependen Individual processes are independent Threads are parts of a process and so are
cy of each other. dependent.
Data and Processes have independent data and A thread shares the data segment, code
Code code segments. segment, files etc. with its peer threads.
sharing
Treatment All the different processes are treated All user level peer threads are treated as a
by OS separately by the operating system. single task by the operating system.
Time for Processes require more time for Threads require less time for creation.
creation creation.
Time for Processes require more time for Threads require less time for termination.
terminatio termination.
n

c) Find out the total number of page faults using –


i) Least recently used page replacement
ii) Optimal page replacement
Page replacement algorithms of memory management, if the page
are coming in the order
70120304230321201701
Ans.

6. Attempt any TWO of the following: 12


a) How pre-emptive scheduling is better than non pre-emptive
scheduling by solving following problem using SJF (Solve it
by using pre-emptive SJF and non-pre-emptive SJF also).
Process Arrival time Burst time
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Ans.

b) List free space management technique with the help of neat


diagram, explain any one technique in detail.
Ans.A file system is responsible to allocate the free blocks to the file therefore it has to keep
track of all the free blocks present in the disk.
There are mainly two approaches by using which, the free blocks in the disk are managed.
Following are the free space management technique:
1. Bitmap
2. Linked List
3. Grouping
Bit Vector
The first method that we will discuss is the bit vector method. Also known as the bit map, this is
the most frequently used method to implement the free space list. In this method, each block in
the hard disk is represented by a bit (either 0 or 1). If a block has a bit 0 means that the block is
allocated to a file, and if a block has a bit 1 means that the block is not allocated to any file, i.e.,
the block is free.
For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12,
13 are free and the rest of the blocks are allocated.
The free-space bit map would be : 0011110011111100

We can find the free block number from the bit vector using the following method-
Block number = (Number of bits per word )* (number of 0-value
words) + (offset of first bit)
We will now find the first free block number in the above example.
The first group of 8 bits (00111100) constitutes a non-zero word since all bits are not 0. After
finding the non-zero word, we will look for the first 1 bit. This is the third character of the non-
zero word. Hence,
offset = 3.
Therefore, the first free block number = 8 * 0 + 3 = 3.
Linked List:
Another method of doing free space management in operating systems is a linked list. In this
method, all the free blocks existing in the disk are linked together in a linked list. The address of
the first free block is stored somewhere in the memory. Each free block contains a pointer that
contains the address to the next free block. The last free block points to null, indicating the end
of the linked list.
For example, consider a disk having 16 blocks where block numbers 3, 4, 5, 6, 9, 10, 11, 12, 13,
and 14 are free, and the rest of the blocks, i.e., block numbers 1, 2, 7, 8, 15 and 16 are allocated
to some files. If we maintain a linked list, then Block 3 will contain a pointer to Block 4, and Block
4 will contain a pointer to Block 5.

Grouping: The third method of free space management in operating systems is grouping. This
method is the modification of the linked list method. In this method, the first free block stores the
addresses of the n free blocks. The first n-1 of these blocks is free. The last block in these n free
blocks contains the addresses of the next n free blocks, and so on.
For example, consider a disk having 16 blocks where block numbers 3, 4, 5, 6, 9, 10, 11, 12, 13,
and 14 are free, and the rest of the blocks, i.e., block numbers 1, 2, 7, 8, 15 and 16 are allocated
to some files.
If we apply the Grouping method considering n to be 3, Block 3 will store the addresses of Block
4, Block 5, and Block 6. Similarly, Block 6 will store the addresses of Block 9, Block 10, and Block
11. Block
11 will store the addresses of Block 12, Block 13, and Block 14. This is also represented in the
following figure

c) Draw and explain directory structure of a file system in terms


of single level, two level and tree structure.
Ans.A directory is a container that is used to contain folders and files. It organizes files and
folders in a hierarchical manner. In other words, directories are like folders that help organize
files on a computer. Just like you use folders to keep your papers and documents in order, the
operating system uses directories to keep track of files and where they are stored. Different
structures of directories can be used to organize these files, making it easier to find and manage
them.
Understanding these directory structures is important because it helps in efficiently organizing
and accessing files on your computer. Following are the logical structures of a directory, each
providing a solution to the problem faced in the previous type of directory structure.
1) Single-Level Directory
The single-level directory is the simplest directory structure. In it, all files are contained in
the same directory which makes it easy to support and understand.
A single level directory has a significant limitation, however, when the number of files increases
or when the system has more than one user. Since all the files are in the same directory, they
must have a unique name. If two users call their dataset test, then the unique name rule
violated.

Advantages
 Since it is a single directory, so its implementation is very easy.
 If the files are smaller in size, searching will become faster.
 The operations like file creation, searching, deletion, updating are very easy in such a
directory structure.
 Logical Organization : Directory structures help to logically organize files and
directories in a hierarchical structure. This provides an easy way to navigate and manage
files, making it easier for users to access the data they need.
 Increased Efficiency: Directory structures can increase the efficiency of the file system
by reducing the time required to search for files. This is because directory structures are
optimized for fast file access, allowing users to quickly locate the file they need.
 Improved Security : Directory structures can provide better security for files by allowing
access to be restricted at the directory level. This helps to prevent unauthorized access to
sensitive data and ensures that important files are protected.
 Facilitates Backup and Recovery : Directory structures make it easier to backup and
recover files in the event of a system failure or data loss. By storing related files in the
same directory, it is easier to locate and backup all the files that need to be protected.
 Scalability: Directory structures are scalable, making it easy to add new directories and
files as needed. This helps to accommodate growth in the system and makes it easier to
manage large amounts of data.
Disadvantages
 There may chance of name collision because two files can have the same name.
 Searching will become time taking if the directory is large.
 This can not group the same type of files together.
2) Two-Level Directory
As we have seen, a single level directory often leads to confusion of files names among different
users. The solution to this problem is to create a separate directory for each user.
In the two-level directory structure, each user has their own user files directory (UFD). The
UFDs have similar structures, but each lists only the files of a single user. System’s master file
directory (MFD) is searched whenever a new user id is created.

 The main advantage is there can be more than two files with same name, and would be
very helpful if there are multiple users.
 A security would be there which would prevent user to access other user’s files.
 Searching of the files becomes very easy in this directory structure.
Disadvantages
 As there is advantage of security, there is also disadvantage that the user cannot share
the file with the other users.
 Unlike the advantage users can create their own files, users don’t have the ability to
create subdirectories.
 Scalability is not possible because one user can’t group the same types of files together.
3) Tree Structure/ Hierarchical Structure
Tree directory structure of operating system is most commonly used in our personal
computers. User can create files and subdirectories too, which was a disadvantage in the
previous directory structures.
This directory structure resembles a real tree upside down, where the root directory is at the
peak. This root contains all the directories for each user. The users can create subdirectories and
even store files in their directory.
A user do not have access to the root directory data and cannot modify it. And, even in this
directory the user do not have access to other user’s directories. The structure of tree directory
is given below which shows how there are files and subdirectories in each user’s directory.

Advantages
 This directory structure allows subdirectories inside a directory.
 The searching is easier.
 File sorting of important and unimportant becomes easier.
 This directory is more scalable than the other two directory structures explained.
Disadvantages
 As the user isn’t allowed to access other user’s directory, this prevents the file sharing
among users.
 As the user has the capability to make subdirectories, if the number of subdirectories
increase the searching may become complicated.
 Users cannot modify the root directory data.
 If files do not fit in one, they might have to be fit into other directories.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy