Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Department of Information Technology

A Micro-Project Report On

“Free Space Management Techniques And Paging Write

Shell Script To Find Out Whether Given Exits”

Submitted for

Diploma in Information Technology

MSBTE, MUMBAI

Vidyavardhini Charitable Trust’s

Abhaysinhraje Bhonsle Institute of Technology (Polytechnic)

Shahunagar-Shendre, Tal/Dist. - Satara, 415519 (MS)


Institute Code: 0983

Academic Year
(2023-24)

1
Department of Information Technology

Vidyavardhini Charitable Trust’s

Abhaysinhraje Bhonsle Institute of Technology (Polytechnic)

Shahunagar-Shendre, Tal/Dist. - Satara, 415519 (MS)


Institute Code :0983

CERTIFICATE

This is certified that Micro-Project Report submitted by following members of


Information Technology Third Year students

Roll No. Enrolment Student Full Name


Number
34 2209830316 Suryawanshi Rohit Krushnat
35 2209830302 Devrukhe Rohit Chandrakant
36 2209830307 Kadam Prem Vaibhav
37 2209830312 Patil parth Pandurang

Diploma in Information Technology has satisfactorily completed the project


work under micro project report on, “Free space management techniques and
paging. write shell script to find out whether-Given file exits” under my
guidance and supervision, this is part of partial fulfillment of the requirement for
submission of Maharashtra State Board of Technical Education, Mumbai during
Semester Fifth of Academic year 2023-2024.

Guide H.O.D. Principal


(Ms.Shaikh.A.J ) (Mr.Kazi A.D. ) (Mr. Dhumal.S.U.)

2
Department of Information Technology

TABLE OF CONTENTS

Sr. Index Page. No


No.
1 Abstract 4

2 5
Introduction

3 Action Plan: 6

4 Course Outcome Addressed 7

5 Actual Procedure Followed 7

6 Actual Resources Required 8

7 Free space management in Operating 9


System

8 write shell script to find out whether-Given file exits 12

9 Program 14

10 Output 15

12 Skill Development of Micro project 16

13 Conclusion 17

14 References 18

3
Department of Information Technology

Abstract (AIM)

In this micro project we were given the task to display Linux Utilities With its output and we learn the
Free space management techniques. We have attempted to use the most basic Linux utilities to
make this project successful. We can do the basic work and advanced work thought its terminal.

Aim of the micro project:

In this micro project we were given the task to display Linux utilities with its output and we learn the the
Free space management techniques. We have attempted to use the most basic Linux utilities to make this
project successful.

1) Study about Linux Utilities.


2) Learn Linux commands.

4
Department of Information Technology

Introduction

Free space management is a critical aspect of operating systems as it involves managing the available
storage space on the hard disk or other secondary storage devices. The operating system uses various
techniques to manage free space and optimize the use of storage devices. Here are some of the
commonly used free space management techniques:
1. Linked Allocation: In this technique, each file is represented by a linked list of disk blocks. When
a file is created, the operating system finds enough free space on the disk and links the blocks of
the file to form a chain. This method is simple to implement but can lead to fragmentation and
wastage of space.
2. Contiguous Allocation: In this technique, each file is stored as a contiguous block of disk space.
When a file is created, the operating system finds a contiguous block of free space and assigns it to
the file. This method is efficient as it minimizes fragmentation but suffers from the problem of
external fragmentation.
3. Indexed Allocation: In this technique, a separate index block is used to store the addresses of all
the disk blocks that make up a file. When a file is created, the operating system creates an index
block and stores the addresses of all the blocks in the file. This method is efficient in terms of
storage space and minimizes fragmentation.
4. File Allocation Table (FAT): In this technique, the operating system uses a file allocation table to
keep track of the location of each file on the disk. When a file is created, the operating system
updates the file allocation table with the address of the disk blocks that make up the file. This
method is widely used in Microsoft Windows operating systems.
5. Volume Shadow Copy: This is a technology used in Microsoft Windows operating systems to
create backup copies of files or entire volumes. When a file is modified, the operating system
creates a shadow copy of the file and stores it in a separate location. This method is useful for data
recovery and protection against accidental file deletion.
Overall, free space management is a crucial function of operating systems, as it ensures that storage
devices are utilized efficiently and effectively.
The system keeps tracks of the free disk blocks for allocating space to files when they are created.
Also, to reuse the space released from deleting the files, free space management becomes crucial. The
system maintains a free space list which keeps track of the disk blocks that are not allocated to some
file or directory. The free space list can be implemented mainly as:

5
Department of Information Technology

Action Plan

Sr.No. Details of activity Start Date Finish Date Responsible


Team
member
1 Selected the topic for micro- 27-7-2023 8-8-2023
project Rohit
2 We organised things required 10-8-2023 19-8-2023
for our project Rohit
3 We browsed the internet for 22-8-2023 31-08-2023
information and raw data Prem
4 We attended extra lectures 7-9-2023 16-9-2023
for our project topic Prath
5 We made points/notes on the 21-9-2023 3-10-2023
information we collected Rohit
6 We created a word document 5-10-2023 14-10-2023
with help of our teacher Rohit
7 We made corrections by 17-10-2023 28-10-2023
discussing with our teacher Prem
8 We also created a PDF 31-10-2023 9-11-2023
document to make a hard Prath
copy of the report

6
Department of Information Technology

Course Outcome Addressed

a) Perform Basic Linux utilities on Ubuntu.


b) Implement basic Utilities of Linux.

Actual Procedure Followed

 First we created an action plan by discussing among ourselves about the project.
 By applying our logic we learn the Free space management techniques
 Next we runs the basic Linux utilities on the ubuntu terminal.
 We implemented the designed of this project with our logic.

7
Department of Information Technology

Actual Resources Required

Sr. Name of the Resource Specification Quantity Remark


No.
-
Software Requirements
1
Operating System Windows 7/10 -

2
Compiler Linux -

-
Hardware Requirements
3 Processor
Desktop PC/Laptop Pentium IV 1

4
RAM 512 MB 1 module

5 VGA 256/16 bit


Graphics adapter color 1

6
Hard-Disk 40 GB 1

7 AT & T
Mouse compatible 1
mouse
8 Standard
Keyboard QWERTY 1
keyboard

8
Department of Information Technology

Free space management in Operating System

There are four me methods of doing free space management in opearating


system. These are as follows-

 Bit Vector
 Linked list

1. Bit map

A Bitmap or Bit Vector is series or collection of bits where each bit corresponds to a disk block. The
bit can take two values: 0 and 1: 0 indicates that the block is allocated and 1 indicates a free block.
The given instance of disk blocks on the disk in Figure 1 (where green blocks are allocated) can be
represented by a bitmap of 16 bits as: 0000111000000110.

9
Department of Information Technology

Advantages

The advantages of the bit vector method are-

 It is simple to understand.
 It is an efficient method.
 It occupies less memory.

Disadvantages

The disadvantages of the bit vector method are-

 For finding a free block, the operating system may need to search the entire bit vector.
 To detect the first 1 in a word that is not 0 using this method, special hardware support is needed.
 Keeping the bit vector in the main memory is possible for smaller disks but not for larger ones.
For example, a 1.3 GB disk with 512-byte blocks would need a bit vector of over 332 KB to
track its free blocks. Giving away 332 KB just to maintain its free block space is not so efficient
in the long run.

1. Linked List

In this approach, the free disk blocks are linked together i.e. a free block contains a pointer to the next
free block. The block number of the very first disk block is stored at a separate location on disk and is
also cached in memory.

In Figure, the free space list head points to Block 5 which points to Block 6, the next free block and so
on. The last free block would contain a null pointer indicating the end of free list. A drawback of this
method is the I/O required for free space list traversal.
10
Department of Information Technology

Here are some advantages and disadvantages of free space management techniques in operating
systems:

Advantages:

1. Efficient use of storage space: Free space management techniques help to optimize the use of
storage space on the hard disk or other secondary storage devices.
2. Easy to implement: Some techniques, such as linked allocation, are simple to implement and
require less overhead in terms of processing and memory resources.
3. Faster access to files: Techniques such as contiguous allocation can help to reduce disk
fragmentation and improve access time to files.

Disadvantages:

1. Fragmentation: Techniques such as linked allocation can lead to fragmentation of disk space,
which can decrease the efficiency of storage devices.
2. Overhead: Some techniques, such as indexed allocation, require additional overhead in terms of
memory and processing resources to maintain index blocks.
3. Limited scalability: Some techniques, such as FAT, have limited scalability in terms of the number
of files that can be stored on the disk.
4. Risk of data loss: In some cases, such as with contiguous allocation, if a file becomes corrupted or
damaged, it may be difficult to recover the data.
5. Overall, the choice of free space management technique depends on the specific requirements of
the operating system and the storage devices being used. While some techniques may offer
advantages in terms of efficiency and speed, they may also have limitations and drawbacks that
need to be considered.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech
landscape, Geeks for Geeks Courses are your key to success. We provide top-quality content at
affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the
millions we've already empowered, and we're here to do the same for you. Don't miss out - .

11
Department of Information Technology

write shell script to find out whether-Given file exits

Shell Returns true if

-a file True if file exists.


-b FILE True if it is block special.
-c FILE True if it is character special.
-d File True if file exists and is directory.
-e file True file if exists.
-f file True if file exists and is a regular file.
-s file True if file exists and has a sixe greater then zero.

1. Ordinary files

An ordinary file is a file on the system that contains data, text, or program instructions.

 Used to store your information, such as some text you have written or an image you have
drawn. This is the type of file that you usually work with.
 Always located within/under a directory file.
 Do not contain other files.
 In long-format output of ls -l, this type of file is specified by the “-” symbol.

2. Directories

Directories store both special and ordinary files. For users familiar with Windows or Mac OS, UNIX
directories are equivalent to folders. A directory file contains an entry for every file and subdirectory
that it houses. If you have 10 files in a directory, there will be 10 entries in the directory. Each entry
has two components. (1) The Filename (2) A unique identification number for the file or directory
(called the in ode number)

 Branching points in the hierarchical tree.


 Used to organize groups of files.
 May contain ordinary files, special files or other directories.
 Never contain “real” information which you would work with (such as text). Basically, just
used for organizing files.
 All files are descendants of the root directory, ( named / ) located at the top of the tree.
 In long-format output of ls –l , this type of file is specified by the “d” symbol.

3. Special Files

12
Department of Information Technology

Used to represent a real physical device such as a printer, tape drive or terminal, used for Input/Output
(I/O) operations. Device or special files are used for device Input/Output(I/O) on UNIX and Linux
systems. They appear in a file system just like an ordinary file or a directory. On UNIX systems there
are two flavors of special files for each device, character special files and block special files :

 When a character special file is used for device Input/Output(I/O), data is transferred one
character at a time. This type of access is called raw device access.
 When a block special file is used for device Input/Output(I/O), data is transferred in large
fixed-size blocks. This type of access is called block device access.

For terminal devices, it’s one character at a time. For disk devices though, raw access means
reading or writing in whole chunks of data – blocks, which are native to your disk.

13
Department of Information Technology

Program

Factorial of a number using while loop - Shell Script

Positive or Negative - Shell Script

14
Department of Information Technology

Output

15
Department of Information Technology

Skill Development of this Micro project

 This project is well suited for the Linux utilities. We here by conclude that where able
to perform the micro-project task assigned by our teacher.

 Out of the many features available, the project demonstrates some popular and
commonly used Linux commands. In this project we learn Linux basic Commands
with its output.

Result:

Displayed the Linux utilities with its output Free Space Management Techniques And Paging.
Also understood the Commands of it.

16
Department of Information Technology

Conclusion

In this article, we studied free space management in operating systems. We discussed four methods of
doing free space management in the operating system. These are - bit vector or bit map, linked list,
grouping, and counting. This article thoroughly discusses all the methods along with their advantages
and disadvantages. You can also find other articles on the operating system topics on
Coding Ninjas Studio.

17
Department of Information Technology

Reference

 https://www.geeksforgeeks.org/shell-program-to-calculate-the-factorial-of-a-number/
 https://www.log2base2.com/shell-script-examples/loop/shell-script-to-find-factorial-of-a-
number.html
 https://www.codingninjas.com/studio/library/free-space-management#:~:text=free%20space
%20list.-,Commonly%20used%20free%20space%20management%20techniques,contiguous
%20block%20in%20disk%20space.
 https://bash.cyberciti.biz/file-management/find-file-permission-script/

18

You might also like