Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

Operating Systems- Homework

Purpose

The purpose of this exercise is to understand how creating files affects the available disk space and the available i-nodes on a disk partition on Linux/UNIX.

Assignment

Create and leave a copy of your C program for this assignment on Pond under cs351/hw4.

1) Write a C program on Pond that:

a. Accepts 2 command line inputs: number of files to create, size of each file (in bytes). For example run your program as ./hw4 10 20 will create 10 files of size 20 bytes each. Your program should check and report not only incorrect # of arguments, but also invalid argument values, such as zero or negative.

b. Creates that many files named after your first name (yourname0, yourname1, yourname2... ) and writes the required number of bytes to each file. One simple strategy is to write that many number of characters since each character is one byte. The content of the files isn't important, just the size. Use ls -l to see the result and verify files of correct size were created.

c. After your program is debugged, delete all files created by your program on Pond before moving to next steps. Use command rm command to delete all files. For example rm crystal* will delete all fines whose name start with crystal.

If you think step 1 is too hard, request a copy of the C code from instructor and directly start from step 2 for this assignment. Of course you will receive 0 pts for the C code part of this assignment.

Before moving on to the next steps, do some research on the UNIX/Linux command df. Understand what df does, its usage, and what it outputs.

2) Run the commands
df .; df -i .

to find out how many disk blocks and i-nodes are in use. Save the results (and future results) to document your answers. Be aware that that 1K-blocks is for display purpose only and is not the real block size of Pond file system. The actual block size is bigger.

1110_Screen_Shot.jpg

Read question (a) in step 12 before proceeding to step 3.

3) Run your program and create 10 files, each with 7 characters. Repeat step 2.

4) Run your program again and create 10 files, each with 13 characters. These 10 files will overwrite the 10 files you created in last step as they have the same names. So you still get 10 files under your working directory. Repeat step 2.

5) Run your program again and create 10 file, each with 25 characters. Repeat step 2.

6) You should be able to answer question (a) below now.

7) Delete the 10 files you just created. Repeat step 2.

8) Run your program and create 10 files, each with 8,192 characters.

9) Repeat step 7.

10) Run your program and create 10 files, each with 8,193 characters.

11) Repeat step 7.

12) Using your results, write a few paragraphs explaining each question below. Be specific. For example if list the numbers in comparison or examples involved to support any statement you make.

a. How creating the same files over and over (steps 3-5) affects disk block usage. Do you think the directory entry is reused when a new file overwrites an existing file of the same name? What about i-nodes? What about data blocks? How can you tell?

b. What difference you see when creating 8,192 byte files vs. 25 byte files. Be specific.

c. What difference you see when creating 8,193 byte files vs. 25 byte files. Be specific.

d. How creating any new file affects i-node usage. How can you tell?

e. What is the block size for this disk partition? How can you tell? If necessary try creating more files of different sizes.

f. How is it possible for a program to fail to create a new file on a file system using i-node, even though there are many free blocks still available? Hint, if your answer doesn't include the word i-node, it's not getting full credit

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M91976895

Have any Question?


Related Questions in Operating System

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

Question 1answer the following questions 10 marks a

Question 1 Answer the following questions: 10 marks a. Consider the following page reference string: 3, 1, 4, 1, 2, 3, 5, 3, 2, 1, 2,5, 4, 3, 5, 2, 4,2, 5,3 Using the above page reference string display the contents of t ...

Question what do you see as the major differences between

Question : What do you see as the major differences between UNIX/Linux and other operating systems, such as Windows and Mac OS X? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

Foundation of information technologyresearch types of

Foundation of Information Technology Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Expl ...

Taskyour job in this assignment is to create two virtual

Task Your job in this assignment is to create two Virtual machines each running a different but the latest distribution of Linux e.g. Ubuntu Server and CentOS. Each of these VM's is to offer services to a user base. The ...

Question note apa format 250 words and three reference

Question: Note: APA format 250 words and three reference without plagarism Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Consider a computer embedded in the control of a manned spacecraft. Would it require an ...

Question topic computerized operating systems os are almost

Question: Topic: Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use our phone or tablet. Find articles that describes the diff ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As