230258_1_Lab-5 - Transtutors

richnessokahumpkaΔιακομιστές

9 Δεκ 2013 (πριν από 4 χρόνια και 23 μέρες)

110 εμφανίσεις



C
I
S
1
40U


LAB #5



FALL

2012



NAME: _______________
_______________

Ch.

5



File System
Administration

Enter your answers into this document in
bold
, and then upload it to the instructor via Moodle.


PART ONE:
Textbook

Answer each question posed in these
projects and insert the answers in order into this document directly under
the project description. No need to enter the questions, only the answers. If asked to login to user1, use your
personal account instead. When asked for passwords, use the ones
you created on your system.


1.

Do Project 5
-
1
, pg
.

245
.

In step 5, if you receive an SELinux error message just continue with step 6.
In
step 8, recall that the units output for du are blocks unless one uses

h.



2.

Additional Project


S
witch to command
-
line


terminal (tty2) by using
Ctrl+Alt+F2

and login to root.
Enter this command
ls
-
l

/dev/sr0
. Is the device file sr0 pres
ent? ______

Insert the
CentOS

installation
DVD

or the Fedora DVD that came with your text
.

Go back to the GUI with
Ctrl+Alt+F1
. D
id the DVD

automount? _______ Enter the command
mount

without arguments from the
command line. What is the device file shown for the DVD? _________________ What is the mount point
(give absolute pathname)? _________________________________________ What

is the type
_______________________? Now, enter
umount /dev/sr0

from the command line. Does the DVD
unmount? _____
Now, try to mount it manually by entering
mount
-
t iso9660 /dev/sr0 /media/dvd

(be
sure you are logged into root at this point)
. What is

the message you get?
____________________________________________________________ Create the mount point
directory with the command
mkdir /media/dvd
, then re
-
execute the above mount command. Is it
successful? _____ Now, try to eject the DVD with the ej
ect button on the drive. Does it eject? ____ Enter
umount /dev/sr0

then press the eject button. Does it now eject? _____ Is the mount point directory still
present? _____


3.

Additional
Project


From the GUI terminal window, enter
df
-
h
.
Screen print

th
e display and include it
immediately below
.
What does the

h option do for us?
____________________________________________________________________
___
_____________

Do a Google search for /dev/shm. What is /dev/shm used for?
______________________________
____

_______________
_____________________
____________________________
___
___
___
___________


4.

Additional Project


From the GUI terminal window give yourself root permission with the command


su
-

root
, then enter
du

h /var/log
. Enter
du

hs /var/log
.
Scre
en print

the window and include it
immediately below. What does the

s option do for us?
_______________________________________________________________________


5.

Additional Project


How many partitions did we create on our hard drive when we installed Li
nux in Lab
1? ________
Recall that these partitions had names. Fill in the missing partition names here: Boot
partition, ______________________, and ______________________
Let’s create another partition on our
hard drive
. Recall that we left some free
space when we did the install in Lab 1.

We will use the procedure
described on pp.
212
-
218 as a guide, but follow the
steps

here:

a.

Use
Ctrl+Alt+F2

to login to the terminal using the root account.


b.

Enter
fdisk /dev/sda
to launch the fdisk utility.

c.

Enter
m

to view the fdisk commands.

d.

Enter
p

to list the partition table on your hard disk.

e.

Enter
n

to create a new partition .

f.

Enter
e

for an extended partition.

g.

Enter
4

for the partition number.

h.

Enter the default cylinder

for your first cylinder number
.

i.

For the l
ast cylinder, enter a number about half way between the first and last cylinder numbers
shown.



j.

Enter
p

to list the partition table again. You should see your new extended partition.

k.

Enter
n

to create a new logical partition in the extended partition.

l.

Enter

l
for logical partition. (That is the letter l.)

m.

Enter the default cylinder for the first cylinder.

n.

For the last cylinder, enter a size that is less than the size of the extended partition you created
above and which was shown as a result of the p comman
d, for example, enter
+3
G
.
Alternatively,
enter a cylinder number somewhat less than the last cylinder number shown.

o.

Enter
p

to list the partition table. You should now see your new logical partition.

p.

Enter
w

to write the changes to the hard disk and att
empt to reload the new partition table into
RAM.

q.

Reboot your computer.

r.

After the reboot, use mkfs to format the new
logical partition using the ext4

filesystem as follows:
mkfs
-
t

ext4


/dev/sda5

s.

Now, create a directory you will use as a mount point for t
he new partition as follows:
mkdir /data

t.

Make sure that /data has permissions for all users to access it:
chmod

a=rwx


/data

u.

Mount the partition to the newly created mount point with the command:

mount

-
t

ext4


/dev/sda5

/data

v.

Go back to your GUI wit
h
Ctrl+Alt+F1

then from a terminal window
d
isplay your mounted
filesystems with the command:
mount
Do you see sda5
? ______

Enter the
df

command. Do you
see sda5? _______
Screenprint

the mount
and df
commands


output and insert it immediately
below.

w.

Tr
y creating some files in the new partition by storing them in /data. Can you do that? __________

x.

We won’t have the system automatically mount this new partition at boot time.


6.

Additional Project


Refer to pp. 50
-
51
and pp. 208
-
209
in the text and to thes
e sites:

http://www.pcguide.com/ref/hdd/file/structPartitions
-
c.html

http://www.tech
-
faq.com/hard
-
disk
-
partition.
html

http://en.wikipedia.org/wiki/Serial_ATA


and possibly other websites to answer the following questions (your answers may be brief).

a.

Compare and contrast primary partitions, extended partitions,
and logical partitions.

b.

Describe/compare PATA and SATA drives.


7.

Do Discovery Exercise 2, pg. 253.



Upload this document
with your answers in
bold

and the screen shots included
through Moodle.