CS 4513 Distributed Computing Systems | WPI, B Term 2005 |
Craig E. Wills | Project 0 (10 pts) |
Assigned: Tuesday, Tuesday 25, 2005 | Due: Tuesday, November 1, 2005 |
Note, you must have formed groups and received your machine name and password from the TAs before starting this project.
The purpose of this project is two-fold. The first is to get you familiar with the Linux system: how to create and add users, how to use some common Unix tools, where the kernel (the operating system) source code is located, how to reboot and how to save your work onto the Fossil server. The set of commands is not intended to be exhaustive. Rather, it is to get you started on the kinds of work you will need to do for future projects. The second purpose is to install WPI File System, which is identical with Linux's Minix file system. This part of the project will both help you understand what is needed to create and install a file system under Linux as well as serve as a basis for future projects.
As you work the project below, feel free to explore further than the basic commands below, if you so desire. Refer to the Hotlinks section for more information on Linux and the Fossil lab. You may also send questions to the TA mailing list at cs4513-staff@cs.wpi.edu.
This project primarily involves running the following commands in a
"cookbook-like" fashion and then answering some simple questions.
When you are asked to use a command you are not familiar with, use
the man
command to learn about the command. You should consider getting familiar
with reading Linux man
pages as one of the goals of this
project, too.
Administrative
You will be the system administrator for your Linux machine for the entire term. Here, you will create some user accounts and give them the ability to access system-private stuff as
root
.Carry out following steps:
- Log into your machine as user
root
.- Create a new user account with the command
useradd
. You may want to use the-m
flag, too.- Create a password for the new account using the
passwd
command.- Give
sudo
permissions to the new account by editing the file/etc/sudoers
with your favorite editor (emacs
,vi
orpico
, say). If you likevi
, you might consider running the commandvisudo
. Add a line to the end of thesudoers
file that looks like:newuser ALL=(ALL) ALLreplacing "newuser" with your new account name.- Add the new account to the group "root" (in /etc/group). You'll need this to get access to linux kernel sources.
- Login to the new account to be sure it works. From the same machine use
login
orsu
. From a different Fossil machine useslogin
orssh
. From a different WPI machine, you must first login to the Fossil server (fossil.wpi.edu
) usingslogin
orssh
.- As a user, you may use
passwd
to change your password orchsh
to change your shell as desired.- Repeat the above steps for each person in your group.
- Note, to delete an account use the command
userdel
, with a-r
option to remove home directories. Please note that the user accounts "guest" and "admin" should never be deleted. If you ever find a machine with the "guest" account not working, please report it to the TA mailing list (cs4513-staff@cs.wpi.edu).After the above steps, you will typically log into your machine as a normal user and then use the
sudo
command to perform any commands that requireroot
access. This is the preferred method used below.Tools
Here, you will find where the Linux source code is located, how many lines of code it is, how large the "core" part of the kernel is and locate some specific kernel modules.
- Go to the main directory of the Linux source code by doing a
cd /usr/src/linux
.- Run the command
find
to see how many files there are.- Run the command
find | wc -l
to count how many files there are.- Run the command
find -name '*.c'
to see how many.c
files there are.- Count the lines of source code.
- Find how many source code files have been copyrighted (at one time, at least) in the kernel (in
/usr/src/linux/kernel
, the core part of the Linux operating system) by Linus Torvalds using:grep -l Linus `find -name '*.c'` | wc -lFossil Lab Use
All the client machines are on a private network. The only remote access to the rest of WPI (and the rest of the Internet) is through the Fossil server (
fossil.wpi.edu
), which is a Firewall.
Your client machines are not backed up. You should save your source code and any other class-specific files by copying the files to the Fossil server, which is backed up nightly.
- From your assigned machine, type
ssh ccc.wpi.edu
and login to a CCC machine (ccc1
,ccc2
...).- From the CCC machine, ping (using
ping
, of course) your assigned machine.- Type
slogin fossil.wpi.edu
and log into the server (using the account given to you by the TAs).- Use
slogin
to log into your assigned machine.- Type
scp /usr/src/linux/.config fossil:/home/newuser/config.save
to save the linux kernel configuration to the fossil server, replacing "newuser" with your login name. In general, you should usescp
to backup your work to the fossil server.
The WPI file system is identical with the Minix file system provided with Linux, just named differently and made as a separate module for the kernel. You will add the WPI file system source files to existing default kernel source, modify the existing kernel codes slightly to register the WPI file system and re-compile the kernel image and the module. You will only need to compile the kernel image once. However, you will need to frequently compile and load WPI file system module as projects go on.
Refer to "Building Linux Kernel" and "Installing WPI File System Module" section of the Fossil Howto page for detailed information on how to install the file system module. The following are the general steps you will need to follow.
/boot/vmlinuz.wpi
.
/etc/lilo.conf
(using sudo
) and add the following
lines to the end of the file:
image = /boot/vmlinuz.wpi
root = /dev/hda5
label = wpi
append = "idebus=66"
sudo
/sbin/lilo
.
who
command. If there
is, ask them to log out (use talk
or write
or something similar). Once they log out, use sudo
/sbin/reboot
to reboot the machine. Note, in general, if you
cannot reach a remotely logged in user and need to reboot, you may try
using sudo /sbin/shutdown -r +5
to reboot it in 5
minutes, sending out warning messages.
wpi
to select the new kernel you
have for booting. You can use /sbin/reboot
to reboot and then
select "linux" to get back to the original kernel.
insmod /lib/modules/2.2.14/fs/wpi.o
. You can verify if the
module is loaded by typing lsmod
. To unload the module, type
rmmod wpi
mkfs.minix /dev/fd0
. This
will format the disk using Minix file system format.
/mnt
directory by typing:
mount -t wpi /dev/fd0 /mnt
/mnt
(ex:
cp /etc/fstab /mnt
and do cat /mnt/fstab
.
Also, make a directory on the floppy: mkdir /mnt/tmp
.
umount /mnt
.
Answer the following questions:
.c
are there in the WPI file system source tree?
ping
your assigned machine
from a CCC machine?
Type up answers to your questions and turn them in via turnin.
The main Fossil home page is at http://fossil.wpi.edu/. It has additional information on the Lab itself, system administration, and Linux.
Send all project questions to the TA
mailing list.
Send all Fossil administrative questions to the Fossil mailing list.