CSE 265: System and Network Administration

Lab #2: OS Installation

  1. Removable Drives

    Today you will get to use your removable hard drive for use in the Sandbox Lab (PL112) for the semester. You should have previously received email with the locker and combination for where your drive is stored. The drives you are getting are regular 500GB SATA hard drives inside a removable case -- in other words, easily broken -- so be careful with yours. You are responsible for it. You'll need to have your drive whenever you want to work in this lab (e.g., lab sessions, projects, etc.), so fortunately there is a locker space for you to store your drive. As given to you, the drive is effectively empty, waiting for you to install something on it. You'll also want to bring your copy of ULSAH as the lab exercises will sometimes refer to it (and to online materials sometimes).

  2. CentOS Installation

    Once you have your drive, you need to install CentOS 6.7 (the free equivalent to Red Hat Enterprise Linux) onto it. We will be installing using media accessed over the network (since the OS is too large to fit on a single CD). We have an two on-campus CentOS repositories that I know of: http://ftp.cse.lehigh.edu/pub/centos/6.7/os/x86_64/ and http://linux.cc.lehigh.edu/linux/centos/6.7/os/x86_64/. Use the first one (when prompted later) as it is on our local network unless it is unusable for some reason. You'll still need an external DVD drive (there are twelve) and a network install CD to get started (we have burned a stack of them for this lab). Note that after this week, we will only keep one DVD writer in the lab -- in disk locker 97 with combination 965. If you need to use it, please make sure to return it.

    To get started, carefully put your drive into your machine, and lock it in place. Attach your DVD drive (power and USB). Put the CD into the drive and turn on your machine. The system should boot using the CD.

    Once the CD has booted, press Enter to start the OS installation. There are a number of places where the system asks you for a decision. In most cases you will choose the default (or select the obvious choice). Please make the same choices I did, so that we will all have systems configured in the same way.

    • After it boots, you can skip the media test and start the installation.
    • Since English has already been chosen, press OK.
    • Since US has already been chosen for keyboard, press OK.
    • When asked what kind of media access method, choose URL.
    • These machines have two network ports installed; when asked which card, use the default onboard Gigabit ethernet (should be connected directly to the Lehigh LAN with a grey ethernet cable), and is likely listed as eth0. (Note that occasionally the system puts them in the wrong order, so if networking fails you can return to this point and choose eth1 if needed.)
    • When asked about TCP/IP versions, use the defaults (both IPv4 and IPv6).
    • This is when you'll need to type the source of the network installation media, specifying http://ftp.cse.lehigh.edu/pub/centos/6.7/os/x86_64/ but a few of you might choose the other repository to balance the load -- both will work. Click OK.
    • Once the network boot data has loaded successfully, it will start a graphical installation interface. Click Next to continue. At this point you should unplug the DVD and give it to the next person.
    • We will install on "Basic Storage Devices". If it complains that the drive may contain data, tell it to discard any data (since we don't care about what might still be on these drives).
    • Give your machine the name sandbox (nothing more, so you'll have to edit what it provided).
    • The timezone will likely already be correct.
    • Set root password -- I recommend "lehigh" without the quotes.
    • When asked about partitioning, make sure you choose to "Use All Space". Click the "Review and modify partitioning layout" checkbox on the bottom left and then click Next.
    • Now it will show you the way it will partition and format your drive. By default, it uses all available space and thus the /home partition is quite large. Click Next, Format (if prompted), and "Write changes to disk."
    • It will then create the partitions, format them, and create the filesystems. It will then ask to install boot loader on /dev/sda, which is right. Click next. Then it will ask what collection of software to install. Please select Desktop. We can customize and add more packages later as we need them.
    • Network installation (including formatting, downloading and installing) took less than 10 minutes (when there was no competition for the network server). Reboot as directed.
    • Now you are in the first-boot configuration process. You can agree to this license agreement.
    • Choose a non-root username. I recommend using your standard university account name. Choose whatever password you will remember. Don't use network login or advanced buttons.
    • Instead of setting the time, choose the "Synchronize date and time over the network" checkbox, and then click Forward.
    • Disable Kdump.
    • And then a final reboot. It will automatically boot into CentOS.

  3. Logging in

    You should now log in as the non-root user. The system should be similar to that of the machines in the sunlab. As before, make sure you know where to find the Terminal (which opens a window with a shell). You'll often need it in the future, as much of what we do will be at the command line.

    For what I consider to be an interesting feature, take a look at the Connect to Server menu under Places. Choose ssh as the service type, set server=sunlab.cse.lehigh.edu, folder=/home/bdd3/ and user name=bdd3 (put your username instead of bdd3 in both places), and optionally give it a bookmark name to use for this connection. Click Connect. It will ask you for your CSE password. Then it will create an icon on your desktop, a new entry in the Places menu, and open a window with files and folders. This provides you with browser access to your files on the other system. In many cases, you can just double-click and the system will open your file with the default application here on this machine (although it may ask for your password one or more times).

  4. Updates

    After your machine has been on for a little while (i.e., you may need to come back to this step), you should be able to find an orangish eight-pointed star icon in the top menu bar and click on it -- it will open an application to update your OS. (It only appears when it has found that there are updates available for your system.) While CentOS 6.7 is the latest release from the CentOS 6 series, there are already updates that you should install. You'll see a list of updates -- feel free to scroll through the list. In general, some updates may require a reboot before they become effective. This may take a while, so don't do it if you have less than (say) 20 minutes to do this. After you click "Install Updates" you'll find that installing updates naturally requires root priviledges, so type your root password. It will then download the newer packages from CentOS repositories, and when complete will start installing them. It may ask permission to install a GPG key or whether you trust the signature of a source (which in this case is fine). At the end, it may tell you that it recommends a reboot. It is usually OK to wait.

  5. Becoming more comfortable on the command line

    By now you should be comfortable with the ls and cd commands. You should also understand that in a UNIX (or Linux) filesystem, a filename can be comprised of any sequence of characters. And similarly, there really is no concept of an extension (e.g., the .doc, .txt, .xls, extensions of the Windows and to a lesser extent Mac world). Any filename can have any number of periods in it, and any sequence of characters before or after. This means that while filename extensions can be helpful to understand what is likely in the file, it cannot be guaranteed. A JPEG image file might be labelled pic.txt and the image.jpg file might contain plain text. Tip for the day: use the up arrow to bring back the next-most-recent command that you typed previously. You can then edit the previous string to become the command that you want to run now.
  6. Booting into single user mode

    Now to see if you were paying attention in class. Edit your GRUB configuration file (found in /boot/grub/grub.conf) to include a second entry that boots your machine into single user mode. (I suggest also removing the rhgb and quiet options from your single user entry so that you can see what is happening as your machine boots.) Reboot your machine using telinit 6 (which has to be run as root, naturally) and test your new GRUB configuration. You'll need to press a key when grub is getting started to show you the menu. Once you are at the shell, note that using top and ps will only find processes that are part of the kernel, or any command you are running plus your shell. Typing exit will log you out of the shell (indeed, any shell), and let the machine continue to multi-user mode.

  7. Printing

    RHEL supports printing via CUPS, the Common UNIX Printing System. It turns out that CUPS is smart enough to self-configure and will let you print to any advertised local printer automatically. To see the printers that your system already knows about, type lpstat -v. Turns out your system doesn't see any printers, right? This isn't because there are no printers to find, though. Instead, it is because by default you have a firewall protecting your computer.

    For simplicity, let's use the GUI to modify the firewall. Go to System->Administration->Firewall. It brings up the firewall configuration window and asks for your root password. In the configuration window, it lists the services that can be enabled. We want three: Multicast DNS (mDNS), Network Printing Client (IPP), and Network Printing Server (IPP). After choosing them, click Apply. Yes, you are certain you want them to be set up. You can close the firewall now.

    Now you can try lpstat to show the printers that your system knows about, and you'll find a long list. Generally speaking, at Lehigh many of the printers that you see are those that are made available by (un- or mis-configured) CUPS servers on Macs or Linux boxes in various research labs. The printers you want to use are the ones hosted by caxton.

    Some kinds of print servers don't advertise their printers via IPP, and so you would have to tell CUPS about them explicitly. Since the printer in PL122 is already visible, we don't need to do that today.

    Print some file (such as your revised grub configuration) to show me at the end of the lab. I suggest that you NOT use the standard printtool testpages as when you pick it up since you won't be able to tell if it is yours or someone else's. You could create a short text file and print that instead. The way I print from the command line is lpr -Ppl122-ps filename.ps (assuming you have a postscript file called filename.ps in the current directory).

  8. Wrapping Up

    This concludes the second lab. Feel free to explore your system further -- it has lots of interesting and useful packages installed on it (such as MS Office-compatible applications, and much more that can be installed).

    In order to sign the sheet to show that you have completed the lab, you will need to:

    1. demonstrate a running CentOS system,
    2. demonstrate how to scroll through your command line history, and,
    3. show me your revised grub configuration file,
    4. show me a printout from the monochrome laser printer in Packard 122.

Note that while this lab is fairly short, I strongly urge you to go back through last week's tutorials and to explore -- in future weeks some of the labs will be considerably more demanding, and anything you learn today will be one less concept you'll have to figure out next time. (And it is good to realize that you can't really hurt your OS -- the worst that happens is that you have to reinstall using the same process you used today.)


This page can be reached from http://www.cse.lehigh.edu/~brian/course/2016/sysadmin/labs/
Last revised: 3 February 2016.