Debian Clusters for Education and Research: The Missing Manual

Base Installation of Debian

From Debian Clusters

Jump to: navigation, search

Debian is of course the operating system of choice for this project. For people who work with Linux on a regular basis, installing Debian is a piece of cake, but the process can be a little intimidating for first time users. Follow the guide below to get a base installation of Debian up and running.

Contents

Getting Debian

The first step is obtaining a copy of the Debian installer. Since Debian is open source, this isn't too difficult. Visiting the Debian project's website, http://www.debian.org/, you'll see a few different options under the "Getting Debian" link on the left sidebar. You can download a small network installer image, download the full installer, download the entire current repository (something like 14 different CDs), order CDs... whew. Lots of options. Fortunately the first two are both pretty easy.

I prefer using the network installer, netinst. Since it's network based, however, you'll need to make sure you have a connection to the Internet on the machine you're installing it onto. Next you'll have to decide which of the three distribution lines you want. Debian comes in three flavors - stable, testing, and unstable. Stable Debian consists of packages that are proven to work, and a lot of effort goes into this validation. Because of this, it's also updated less frequently. Testing are packages that have been used for a short amount of time consistently in unstable. Testing is updated frequently. Unstable is bleeding edge current. For a balance between stability and usability, go with testing.

The testing installer images are available here from the Debian.org site. Under the first header, "netinst (generally 135-175 MB) and businesscard (generally 20-50 MB) CD images", choose your architecture. If you don't know what it is, you're probably running i386. Click on the architecture and you'll see a list of files. You want the one called debian-testing-<your architecture>-netinst.iso. Download this file and save it to your desktop.

Next, using your favorite CD burning software, burn the image to a CD. Your software may call this something like "Burn an Image" or "Bootable CD". If you don't have any burning software that supports this option, you can download a 14-day trial of BlindWrite from VSO Software. (I'm not endorsing them, but I've used the trial and it worked fine in my experience.)

Congratulations, you now have a Debian installer CD!

Installing Debian

The Basics

The Debian network installer CD splash screen.
The Debian network installer CD splash screen.

Warning: Installing Debian on the hard drive will erase any operating system and any data you currently have on it. Make sure you've copied off everything you want before you install Debian!

Note to Virtualization Users: If you're trying out Debian as a virtual machine within a host operating system rather than installing it as the base operating system, you may have problems with it detecting the drive. In VMware, you must create a custom build rather than a typical build a choose an IDE hard drive, even though SCSI is recommended. If you're just installing Debian as the base operating system (a "normal" install), this doesn't apply to you, and go ahead and continue below.

Take the CD to the machine you're about to install Debian on. Next, boot up the machine from the CD. You may have to hit a key to boot from CD, or enter the BIOS and enable booting from CD there. The magic keystroke for this varies by distribution - it could be F2, F8, Del, Esc, or something else. Or, you may not have to do anything at all, and you'll automatically boot up into the splash screen shown on the right. Go ahead and hit Enter to begin the installation process.

Choosing the language for the installation
Choosing the language for the installation
First, you'll be prompted for the language to be used during the installation process. Unless you prefer something other than English, hit enter and continue. If you want to choose something else, use the up and down arrows until the one you want is selected, then hit enter.
Choosing the country
Choosing the country
Next, choose your country. If you chose English in the previous step, the United States will automatically be selected for you already. Hit Enter if that's correct, otherwise use the up and down arrow keys until the one you want is selected, then hit enter.
Choosing the keyboard mapping
Choosing the keyboard mapping
Now the installer's asking for the keyboard mapping. This is basically asking, when you hit a certain key on the keyboard, what letter should it be? If you live in the United States, yours is already selected. If that's not correct for your language, scroll down and choose the one that is. Then hit enter.
A few screens will flash by as the installer scans the CD and loads additional modules from it, then detects your hardware and attempts to connect to the network. If it cannot connect to the network, make sure your cable is plugged in correct and connected. If retrying fails, you may have to configure it manually.
 
Setting the hostname for the system
Setting the hostname for the system
The next prompt is for the hostname of the system. The hostname of the system is kind of like the first and last name of a person. It's used to identify the system. For instance, when you SSH into the system, if you're using BASH, you'll see a prompt like this:
kwanous@gyrfalcon:~$

In the above example, my username is kwanous and the hostname of the machine is gyrfalcon. For this project, I'm going to be naming my nodes with a birds of prey theme, but you don't have to be as whimsical. You can use headnode or nodeX if you want, but it must be all lowercase. Delete the default of debian, enter yours, and hit enter. This can be changed later by editing /etc/hostname.

Setting the domain name for the system
Setting the domain name for the system
The domain name should be the one this machine will be on. For instance, you might have an internal domain for your cluster (more about this in Network Topology. You may have gotten one already from your DHCP server. Enter one if you know it, otherwise leave it. This can be changed later by editing /etc/resolv.conf.
Selecting the correct timezone
Selecting the correct timezone
Move the selection up and down with the arrow keys until it's on the correct timezone for your location, then hit enter.

Partitioning

So far, installation has been pretty easy. The most difficult thing you had to choose was your keyboard mapping. You might be wondering if I just wrote this guide because I had too much free time on my hands.  : ) This is the part where it begins to get a bit tricker. Now we partition the drive, meaning we split it up into different sections that will be used differently. Most typical Windows installations only have one partition on the hard drive. Everything is kept in one file system. Linux is different in that it needs a minimum of two partitions: one for the file system, and one for the swap space.

Swap space is like virtual RAM in Windows. It's an area of the drive that Linux sets aside specifically to use when RAM gets full. The size of it will never shrink or grow; we're setting it right now. There are lots of varying opinions on how much swap space to set; I typically use two times the amount of RAM I have. For instance, in a machine with 1 GB of RAM, I will set 2 GB of swap space.

Choosing how to partition the disk
Choosing how to partition the disk
To get into this process, select Manual and hit enter.
Select the correct hard drive
Select the correct hard drive
Even if you only have one hard drive, Debian will create a list of hard drives for you and ask you to select which one you want to set up. You can see in the screenshot that I'm using VMWare for this installation and so my hard drive is called VMWare Virtual IDE Hard Drive. Select your hard drive and hit enter.
Creating a new partition table
Creating a new partition table
If you're installing a hard drive with an existing operating system, you'll need to delete the previous partitions first. Unfortunately, I don't have screen shots on that. However, once you've deleted them, you'll get back to this same point. The installer asks whether it should create a new partition table. Even though the default is no, hit Tab twice to get to Yes and hit enter.
Returned to selecting a hard drive, but with a FREE SPACE section
Returned to selecting a hard drive, but with a FREE SPACE section
You'll be returned to a previous screen, but this time it has a nice FREE SPACE section under the hard drive. Select with the arrow keys, then hit enter.
Choosing how to use the free space
Choosing how to use the free space
You'll be prompted as to how you'd like to use this space. Keep the default entry, "Create a new partition", and hit enter.
Setting the partition size
Setting the partition size
Now you need to set the size of the partition. By default, the Debian installer enters the full size of your hard drive. You don't want to use the full size, because you need to same some for swap. Enter the full size of your drive (you'll see it listed at the top as well, mine is 6.4 GB in the picture) minus the size the swap space will be. (See the beginning of this section for a discussion on how much swap space to use.) Then hit enter.
Choosing the type of partition
Choosing the type of partition
You'll be prompted for the type of partition. There can only be four primary partitions, but you can have as many logical partitions as you want. We're only using two partitions, so we won't need any logical partitions. Keep the default of "Primary" and hit enter.
Choosing the location for the partition
Choosing the location for the partition
You can put the partition at the beginning of the hard drive or the end. Keep the default of "Beginning" and hit enter.
Viewing the partition
Viewing the partition
Whew, now the partition has been set up. You'll notice that the installer has set this up as a file system partition by default, which is what we want. (That's the "Use as: Ext3 journaling file system" part.) The "Mount Point: /" means that this will be the root file system, where all of the files will go. This is what we want. There's one small addition to this we need to make, not because it's necessary, but because it's better in principle: use the arrow keys to select "Bootable flag: off" and hit enter. It will set it to bootable, then return you to the same screen. Key down to "Done setting up the partition and hit enter.
Viewing the new state of the hard drive
Viewing the new state of the hard drive
You'll be returned to the familiar partitioning window that shows you the state of your hard drive. Now you'll see the partition you just created, followed by the FREE SPACE line again. Select the FREE SPACE line and hit enter. Again, choose to keep the "create a new partition" default. This time, when it enters the rest of the space on the hard drive for you, hit enter. (Unless you messed up on the first partition and need to go back and "Delete a partition" to start partitioning over again.) Keep the default of a "primary" partition type, too. You won't be prompted for where to put the partition since you're using the rest of the free space on the hard drive. When see the partition settings window, we'll need to set this as swap space. Key down to "Use as: Ext3 journaling file system" and hit enter.
Selecting the partition format
Selecting the partition format
You'll see a list of different formats this partition could be used for. Key down to "swap area" and hit enter.
Once it returns you to the previous window, you'll see you have quite a few options fewer now that it's swap not a file system partition. That's ok, we're done with it anyway. Select "Done setting up the partition" and hit enter.
Viewing the finished state of the partition table
Viewing the finished state of the partition table
You'll be return once again to viewing the state of the partition table. By now, it should have two proud partitions like mine on the left does: a file system partition, and a significantly smaller swap area partition. Key down to select "Finish partitioning and write changes to disk" and hit enter.
Writing out the changes to the partition table
Writing out the changes to the partition table
It will ask you to be sure that you're really ready to write out the changes to the disk. This is the step where it becomes permanent. Hit tab twice to select "Yes" and hit enter. Depending on the machine, it may take a while for this to finish. Then it will go straight into installing the base system. Yay! Done partitioning!

Installing the System

Now the installer gets to go to town and install Debian.

The Debian installer chugging away installing the base system
The Debian installer chugging away installing the base system
Depending on your Internet connection and computer speed, it may take a while for it to install everything. Expect at least five minutes and possibly a lot longer.
Choosing the root password
Choosing the root password
On most flavors of Linux, with Ubuntu being a little strange about this, the root account is the administrative account. The root account has absolute power. There can be lots of user accounts, but only one root... "one root to rule them all." Pick a nice, secure password. You can change it later by signing into the root account and issuing passwd. Once you enter it and hit enter, you'll be prompted to type it again, just to make sure you typed what you really thought you did.
Enter the full name of the person you're creating the first user account for
Enter the full name of the person you're creating the first user account for
Next you'll create a normal user account. First, it asks you for the full name of the person who will use this account. This information isn't used as much anymore as it used to be. You can leave it blank or enter a full name, which ever you want. This is not the name of the account they will use to log in as.
Entering the account name for the first user account
Entering the account name for the first user account
This is the step where you choose the important part - the user/account name. This will be used as the identifier for the user all of over the system, and the username they will use to log in as. You'll see mine as kwanous in all of my examples.
Entering the password for the user account
Entering the password for the user account
Like the root account, this account also needs a password. As a security measure, don't use the same password as the root account! After you enter it and hit enter, you'll be prompted for it again.
Selecting the correct country for the apt repository
Selecting the correct country for the apt repository
Next, the installer will prompt you to help it set up apt, the packaging system used to update and install software ("packages"). Select your country and hit enter. (Or, if you're lucky enough to know someone who manages a repository, or you run one yourself, scroll up to the top of the list to choose "enter information manually" and enter your own.)
Choosing an apt mirror
Choosing an apt mirror
Now you'll select the specific mirror, or source, that you want to use. Your choice may be hit or miss - I'd go with their recommendation for ftp.<your country>.debian.org.
Entering a proxy for the apt mirror
Entering a proxy for the apt mirror
Unless you know for your mirror that you specifically need a proxy, you probably don't. Leave it blank and hit enter. It will attempt to connect to the mirror just to make sure everything's in order.
Popularity contests aren't just for people
Popularity contests aren't just for people
You'll be asked if you want to allow your statistics to be counted for popularity contests among the packages. You can if you want. I usually keep the default of "No" and hit enter. You'll notice the next screen flashes by that it at least says that it installs and configures the survey regardless of what you choose.  :P
Choosing the software to install
Choosing the software to install
This next step is very important. For the cluster, you'll want as little software as possible, because you want it streamlined rather than bulky. That said, my tutorials will walk you through everything you need to install, so you don't need to install a bunch of preselected software now. You don't need a print server, a windowing manager, or anything else along those lines. In fact, they'll just take up space and slow your system down, and maybe even create some security holes. That would be a "bad thing".

It's unfortunately very easy to accidentally hit the wrong thing in this step. Use the arrow keys like normal, highlight the two options that have asterisks by default ("Desktop environment" and "Standard system"), and hit space to deselect them. Once you have no asterisks in any of the entries, hit enter to continue.

Installing the Boot Loader, GRUB

GRUB is the boot loader of choice for this installer. In fact, it's the only choice for this installer. (The other common boot loader is LILO. There are other Debian installer CD images that contain both or just LILO.) Boot loaders are responsible for jump starting your operating system when you boot the computer up. You definitely want one.

Prompt for installing grub
Prompt for installing grub
When you're asked whether you want to install grub, keep the default of "Yes" and hit enter.
Done!
Done!
After it finishes installing grub, you're done! It will give you a prompt telling you that it's done installing. After you hit enter, it will reboot the system. Like it says, be sure to take out the CD so it doesn't boot back into the installer.

Updating

The first thing you'll want to do is update your software. Log in as root using the password you supplied earlier. You won't be greeted with a congratulatory installation message, unfortunately, just the prompt. To update all your installed packages, first run

apt-get update

This updates the cache local on your computer about what versions packages are as well as what packages are available. Then, to automatically upgrade everything you have installed to the newest version, run

apt-get dist-upgrade

Most packages will take care of upgrading without any input from you. However, there will be an occasional one that prompts. Usually, if you don't understand what the prompt is asking, go with the default option.

My "Base" Software to Install

Finally, since (if you followed my recommendation), you installed the barest bones necessary to get the system up and running, there are three helpful packages you'll want to install that weren't installed as part of the installation.

First, you'll want the ability to SSH into the system, as well as out of it. You'll get both abilities with

apt-get install ssh

Second, at some point, you'll want rsync. It's used to intelligently copy files around. Get it with

apt-get install rsync

Third, I always pipe long files to less to make them easier to read. It's installed with

apt-get install less

Then you're done!

Personal tools