• No results found

Input / Output Subsystem and File System Lab

N/A
N/A
Protected

Academic year: 2022

Share "Input / Output Subsystem and File System Lab"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

Input / Output Subsystem and File System Lab

Linux

The Linux operating system provides excellent opportunities for interacting with the File System and I/O Subsystem. This lab aims to provide students with some practical experience using Linux.

Basic File Commands in Linux

pwd – print working directory

Where is your home directory? _____________________________________________________

mkdir – make a new directory Example: $ mkdir test Create a directory called io_fs_lab Change directory into io_fs_lab

What is in an empty directory? _____________________________________________________

What is the size of a directory? _____________________________________________________

Does the size of the directory change if more data is added to it? _________________________

Can you explain why? ____________________________________________________________

Hint: type the command: $ ls -al Create a few more directories.

Remove one of your directories with the rmdir command.

rmdir – remove a directory touch – creates an empty file Create a few files for testing rm – remove a file

Remove some files with the rm command.

What does the –r option do when used with the rm command? __________________________

(2)

How do you create a hidden file in Linux? _____________________________________________

What does the command ls –al do? _______________________________________________

Symbolic Links

A symbolic link is roughly the equivalent of a shortcut in Windows, but symbolic links are much more powerful than shortcuts.

Create a directory called folder.

Create a symbolic link to folder with the following command:

ln –s ./folder ./link

What can symbolic links be used for? ________________________________________________

Disk Usage Commands

Use the df -m command to answer the following question.

How much available disk space do you have on /dev/sda1? ______________________________

What does the du command do? ___________________________________________________

What does the mount command do? ________________________________________________

Open Files

Every process maintains a list of open files. The command lsof allows users to view the open file table.

What does the lsof command show you? ______________________________________________

File Metadata

Using the commands you know so far, what metadata does the Linux file system provide for each file and directory?

What default permissions are assigned to each file? ___________________________________

(3)

Why are these default permissions assigned? _______________________________________

Hint: examine the umask command Linux File Permissions

Use the commands chmod, chown, and chgrp to change the permissions, owner, and group of a file.

Devices in Linux

Everything in Linux is represented as a file including devices. Device files have some special types of metadata including major and minor numbers. The major number tells the operating system what type of device the file represents: disk, terminal, etc. The minor number tells the kernel the special

characteristics of the device to be accessed. The device files in Linux are stored in the /dev folder.

Change directories into the /dev folder.

Use the commands you know and the file command to identify each type of file listed below.

Examine the metadata of the files in the /dev directory. Find an example for each type of record as described below.

Find files that start with the metadata descriptions b, c, l, d, p, and s.

b: ________________________________________________

What kind of a file is b? ______________________________________________________________

Provide an example of this kind of file. __________________________________________________

c: ________________________________________________________________________________

What kind of a file is c? _______________________________________________________________

Provide an example of this kind of file. __________________________________________________

l: ________________________________________________________________________________

What kind of a file is l? _______________________________________________________________

Provide an example of this kind of file. __________________________________________________

d: _______________________________________________________________________________

What kind of a file is d? ______________________________________________________________

Provide an example of this kind of file. __________________________________________________

(4)

p: _________________________________________________________________________________

What kind of a file is p? _______________________________________________________________

Provide an example of this kind of file. ___________________________________________________

s: _________________________________________________________________________________

What kind of a file is s? ________________________________________________________________

Provide an example of this kind of file.____________________________________________________

Linux Internals and System Calls

Linux provides us with a way of viewing system calls. Type the following command and review the output.

$ strace echo test >> test.txt

What does the output from the strace command tell us?

Absolute vs. Relative Reference

Review the meanings of the symbols: ., .., and / for the operating system.

Use each of these symbols with the cd command to explore file system navigation.

Linux References

General Overview of the Linux File System

http://www.faqs.org/docs/linux_intro/sect_03_01.html Major Numbers and Minor Numbers

http://www.linux-tutorial.info/modules.php?name=MContent&pageid=94

(5)

Windows

Many Windows concepts are roughly the same as those in Linux. Use the commands below to explore the file system and I/O subsystem of Windows.

Windows GUI Tools

Diskmon – displays read and write activity to your disk.

Diskview – maps specific files to locations on your hard disk.

LoadOrder – displays the load order for drivers and services.

PageDefrag – permits users to defragment system files such as the page file.

Process Monitor – displays the open files and registry entries for each process.

Command Line Tools

The handle command allows users to review open file handles. In essence, you can look at the open file table.

The defrag command will display or defragment fragmented files.

The contig command allows a user to defragment a specific file.

The junction command allows a user to create what is essentially a symbolic link in the NTFS file system.

The sigcheck checks a file’s metadata to confirm that it is an authentic file version signed by the appropriate authority.

The ntfsinfo command displays some general characteristics of an ntfs file system.

The du command displays disk usage characteristics similar to the du command in Linux.

The listdlls command shows all dlls used in the system.

The cacls command shows the access control list information for Windows files.

The streams command tells a user if a file has an alternate stream in its metadata.

(6)

Summary Questions

What file metadata does Windows support?

What are the differences between the metadata Windows supports and that of Linux?

Where are most of the dlls stored in the Windows operating system?

How would you compare the file system layouts of Linux and Windows?

Which system, Linux or Windows, would be easier to manage for a single user and why?

Which system, Linux or Windows, would be easier to manage for 100 users and why?

(7)

Find a file on the Windows system that is fragmented and try to defrag it with contig.

Look at disk view and identify a few files on your system. What do you notice about the distribution of blocks allocated to files?

Why must we restart the computer to defrag the pagefile? How is this issue related to file system mounting?

References NTFS Streams

http://www.forensicfocus.com/dissecting-ntfs-hidden-streams

References

Related documents

Other characteristics of informal settlements include: (i) lack of secure tenure; (ii) housing that contradicts city by-laws; (iii) housing built on land not owned by the

bargaining unit employees who are employed as of August 15, 2014 shall be eligible for a wage increase on their individual appointment renewal date occurring between August 16,

• 0-19 points for students who show no active participation, who do not participate in group discussions, are

We will discuss the special challenges related to empirical research, interdisciplinary approaches and different legal methodologies.. The first day (8 th of June) will be

A well-conceived internal organisation design is absolutely necessary for achieving organisational objectives and delivering quality services to clients. Against this backdrop

The means used by CNPC to purchase AktobeMunaiGas illustrates the crucial role of the Kazakh leadership, namely President Nazarbayev and his family, in approving major

In England and Wales this campaign resulted in the 2011 introduction of the domestic violence disclosure scheme (Clare’s Law), a scheme aimed at preventing the