Installing the Ubuntu Server - Getting Started - Ubuntu 15.04 Server with systemd: Administration and Reference (2015)

Ubuntu 15.04 Server with systemd: Administration and Reference (2015)

Part I. Getting Started

Chapter 2. Installing the Ubuntu Server

Installing Ubuntu Linux has become a very simple procedure with just a few screens with default entries for easy installation. A pre-selected collection of software is already installed. Most of your devices, like your monitor and network connection, are detected automatically. The most difficult part would be a manual partitioning of the hard drive, but you can use a Guided partitioning for installs that use an entire hard disk, as is usually the case.

For Server specific installation details be sure to check the Ubuntu Server Guide Installation section at:

For very detailed key installation topics, from obtaining the CD to starting up the system for the first time, as well as appendices on partitioning and automatic installs, check the Ubuntu Installation Guide/Installing Ubuntu 15.04 (Ubuntu documentation | Ubuntu 15.04 | Installing Ubuntu) at:

The Ubuntu Server CD uses a text-based interface. This particular guide does not take you through the steps. Instead, it details key installation topics like booting the install disk and preparing your hard disk.

The basic install procedures are covered in this chapter, though you should consult the Server install and Installation guide for more detailed information.


You can upgrade directly from the Ubuntu 15.04 release. First, install the update-manager-core package, if not installed already. Then edit the /etc/update-manager/release-upgrades file and modify the Prompt option.

sudo nano /etc/update-manager/release-upgrades

Set the Prompt option to normal.

Prompt = normal

Then run the do-release-upgrade command with the -d option. This operation will perform any needed system configuration changes.

sudo do-release-upgrade -d

Ubuntu Server CD

The Ubuntu server CD is designed for hardware servers, systems that will run only servers and not perform any other tasks like desktop applications. The Ubuntu desktops are not installed. You will be presented with just a command line interface and command line tools like the nano editor to manage your server configuration. You will have to know how to edit server configuration files manually, typing in your entries.

Server software, though, does not have to be installed from the Server CD. You can directly download and install any server from the Ubuntu repository. Should you wish, you can install the Ubuntu desktop and then use GNOME based desktop tools like Synaptic Package Manager of the Ubuntu Software Center to install the servers you want. You can also use desktop server configuration tools to manage your servers. These are not available on a direct Server CD install.

The downside of installing from the desktop is that you incur the overhead of running the desktop interface, namely GNOME. Most commercial and professional enterprise servers are time-critical, managing a massive number of transactions. A desktop interface can seriously degrade performance. However, for a simple home or local server, which would have relatively few transactions, the desktop would incur little or no overhead. It would also make managing your server much easier.

Getting the Install Server CD

You can download the Ubuntu Server CD from:

You can also download the Ubuntu Server CD directly from:

The Ubuntu Server CD has both 32 and 64-bit versions. If you want to use the 64-bit version, be sure you have a CPU that is 64-bit compatible (as are most current CPUs). The 64-bit version is faster.

The Ubuntu DVD includes both desktop and server applications. You can download it from:

You can download the Server CD directly, or by using the BitTorrent, Jigdo, Metalinks, or Zsync download methods. The Server CD download files for these methods are located at:

For BitTorrent use a BitTorrent client such as transmission or ktorrent.

See the Jigdo Download HowTo page at for details on using Jigdo.

For information about using metalink with Ubuntu see:

Installing Ubuntu from the Server CD

The server install CD includes all the servers available for use on Linux. These include the Samba Windows network server, mail servers, and DNS servers. All these are also included with the Install DVD. The Server CD is designed for stripped down servers that are used to just run servers, not provide any desktop support. In fact, the GNOME and KDE desktops are not included or installed with the Server CD. This is a very specialized server installation.

The Server CD uses a text based install interface, with TABs, spacebar, and arrow keys used to make selections. Before the software is installed, a Software selection screen is displayed which lets you select the servers you want to install. Use the arrow keys to move to a selection, and the spacebar to make a selection.

When you start up a server installation, you will be using the command line interface. The desktop is not installed. Desktops are considered unnecessary overhead for a server. The user enters a user name at the Ubuntu login prompt, followed by the password at the password prompt.

Installing Linux involves several processes, beginning with creating Linux partitions, and then loading the Linux software, selecting a time zone, and creating new user accounts. The installation program used on Ubuntu is a screen-based program that takes you through all these processes, step-by-step, as one continuous procedure. You can use the keyboard to make selections. You can also use TAB, the arrow keys, SPACEBAR, and ENTER to make selections. The TAB key moves you to the GO Back and Continue buttons at the bottom of the screen.

When you finish with a screen, either press ENTER or tab to the Continue button at the bottom, and then press ENTER to move to the next screen. If you need to move back to the previous screen, tab to the Go Back button and press ENTER. You have little to do other than make selections and choose options.

Tip: To boot from a CD-ROM or DVD-ROM, you may first have to change the boot sequence setting in your computer’s BIOS so that the computer will try to boot first from the CD-ROM. This requires some technical ability and knowledge of how to set your motherboard’s BIOS configuration.

Installation Overview

Installation is a straightforward process. A screen-based installation is very easy to use.

Most systems today already meet hardware requirements and have automatic connections to the Internet (DHCP).

They also support booting a DVD-ROM or CD-ROM disc, though this support may have to be explicitly configured in the system BIOS.

Also, if you know how you want Linux installed on your hard disk partitions, or if you are performing a simple update that uses the same partitions, installing Ubuntu is a fairly simple process. Ubuntu features an automatic partitioning function that will perform the partitioning for you.

A preconfigured set of packages are installed, along with the servers you want installed.

For a quick installation you can simply start up the installation process, by placing your Server CD disc in your optical drive and starting up your system. Installation is a simple matter of following the instructions in each window as you progress. Installation follows seven easy steps:

1. Language Selection A default is chosen for you, like English, so you can usually just press ENTER.

2. Location Choose your country

3. Keyboard Layout You can choose to automatically detect the layout by pressing some keys, or choose one from a list, first by country and then by type. A default is chosen for you; you can usually press ENTER.

4. Network Detection. Automatic DHCP configuration or manual configuration. You will be prompted to enter a host name.

5. Time Zone Select your time zone.

6. User name Set up a user name for your computer, as well as a password for that user.

7. Prepare partitions Disks are scanned and the partitioner starts up. For automatic partitioning you have the option of using a Guided partition, which will set up your partitions for you. You can choose to use LVM or LVM encrypted file systems. You have the option to perform manual partitioning, setting up partitions yourself.

8. The base system is then installed.

9. Select server software Choose the server packages you want installed. LAMP includes the Apache Web server and the MySQL database server.

10. Finish the Installation After the install, you will be asked to remove your DVD/CD-ROM. You then press ENTER.

Starting the Installation Program

If your computer can boot from the DVD/CD-ROM, you can start the installation directly from the CD-ROMs or the DVD-ROM. Just place the CD-ROM in the CD-ROM drive, or the DVD-ROM in the DVD drive, before you start your computer. After you turn on or restart your computer, the installation program will start up.

The Ubuntu Server CD is designed for installing the server. The installation program will present you with a menu listing the following options (see Figure 2-1 ):

Install Ubuntu Server
Multiple server install with MAAS
Check disc for defects
Test memory
Boot from first hard disk
Rescue broken system

"Install Ubuntu Server" will start the installation (see the next section).

"Multiple server install with MAAS" enlists a server with a Metal on a Service (MAAS), which can be used to manage the server. See Provides cloud support of networked servers.

"Check disc for defects" will check if your CD burn was faulty.

"Test Memory" will check your memory.

"Boot from first hard disk" will let your CD work as boot loader, starting up an operating system on the first hard disk, if one is installed. Use it to boot a system that the boot loader is not accessing for some reason.

"Rescue a broken system" will start Ubuntu and let you mount a broken system. You can then make changes to the system configuration.

Figure 2-1: Install disk start menu for Server CD

Along the bottom of the screen are options you can set for the installation process. These are accessible with the function keys, 1 through 6.

F1 Help F2 Language F3 Keymap F4 Vga F5 Accessibility F6 Other Options

A description of these options is listed here:

Help Boot parameters and install prerequisites

Languages List of languages, popup menu

Keymap Languages for keyboard, popup menu

Modes Lists possible install modes: Normal.

Accessibility Contrast setting, Magnifier, On screen keyboard, and Braille support

Otheroptions, Opens an editable text line listing the options of the current selected menu choice. You can add other options here, or modify or remove existing ones. The menu lists several specialized options like Expert mode, acpi=off, noapic, nolapic, edd=on, nodmraid (no hardware RAID), nomodeset, and Free Software only. Press ESC to activate to the main menu. The Expert mode will provide more detailed control over your installation.

Use the arrow keys to move from one menu entry to another, and then press ENTER to select the entry. Should you need to add options, press the F6 key A command line is displayed where you can enter the options. Current options will already be listed. Use the backspace key to delete and arrow keys to move through the line. Press the ESC key to return to the menu.

Starting the Ubuntu Installation

Your system then detects your hardware, providing any configuration specifications that may be needed. For example, if you have an IDE CD-RW or DVD-RW drive, it will be configured automatically.




Move to Continue, OK, Yes, No, and Go Back buttons


Execute a selected button

Arrow, up and down

Move to selections on a menu

Arrow, left and right

Move between Go Back and Continue buttons on some screens

PageUp and PageDown

Move through listings a page at a time

Table 2-1: Installation Keys

Figure 2-2: Installer main menu

As each screen appears in the installation, default entries will be already selected, usually by the auto-probing capability of the installation program. Selected entries will appear highlighted. If these entries are correct, you can simply press ENTER to accept them and go on to the next screen. Some screens will display a Continue button. Use the Tab key to move to that button. Many screens will also have a Go Back button. The Tab key will cycle through to the Continue and Go Back buttons. On some screens you can also use the arrow keys to move between the Go Back and Continue buttons. The install keys are listed in Table 2-1 .

At any time during the install process, you can Tab to the Go Back key and press ENTER to display the "Ubuntu installer main menu" listing a complete set of install tasks (see Figure 2-2 ). This menu will include added tasks like installing the Grub boot loader.

Language and Keyboard

First, you select your Language (see Figure 2-3 ). Use the up/down arrow keys and PageUp/PageDown keys to move through the list. Press the ENTER key when you have reached your selection. The detected default will already be selected. If correct, just press ENTER.

Figure 2-3: Language

Figure 2-4: location

Then, select your location, country or region (see Figure 2-4 ). Use up/down arrow keys to move to a selection. Press the ENTER key to make your selection and move on to the next screen.

You will then be asked to select a keyboard. First you are asked if you want to detect it automatically by typing keys. The default response is NO and you can press ENTER to move to a manual selection screen. The default keyboard will be selected already, such as U.S. English (seeFigure 2-5 ).

If there is more than one keyboard layout for your region, another screen lists them and you are prompted to select one. The USA keyboard will have several keyboard selections such as Macintosh, Dvorak, or International, as well as the standard. Your hardware is then detected.

Figure 2-5: Keyboard Layout

Network Configuration and Cobbler

You then configure your network interface. If you have multiple hardware network connections, you are asked to choose one (usually the Ethernet connection, eth0). If you are using a DCHP server to configure your network information, you will be prompted just to enter a host name for your server (see Figure 2-6 ).

Figure 2-6: Network Configuration

If you are using a fixed IP address for your server, select Go Back and select the "Configure network manually" entry to configure your network information manually. Screens that follow prompt for:

IP address for the server

Your network netmask

IP address for the network gateway (address for router connected to the Internet)

IP addresses for the name servers (DNS servers)

Your server's host name

If you choose to install using the "Multiple server install with MAAS ", you will be prompted to enter the connection and access information for your MAAS server.

Create administrative user

On the following screens you will enter the user's full name, the user login name and that user's password (see , 2-8, and 2-9). The user you are creating will have administrative access, allowing you to change your system configuration, add new users and printers, and install new software. You are also asked if you want to encrypt your home directory, adding a further level of security (see Figure 2-10 ).

Figure 2-7: create user

Figure 2-8: create user name

Figure 2-9: create user password

Figure 2-10: Encrypted private directory

Time Zone

You then choose your time zone (see Figure 2-11 ). The time zone is detected from the network time server, and you are prompted to confirm. If it is not correct, you can choose No to select from a list of time zones.

Figure 2-11: Time Zone


Then you are asked to designate the Linux partitions and hard disk configurations you want to use on your hard drives. For LVM partitions, an LVM Group has to be set up before you can configure any partitions. This means that the partition table is written to before you configure your partitions. This action cannot be reversed. This is true for both Guided LVM and manual LVM partitioning.

If you are setting up standard partitions manually, instead of LVM partitions, partitions will be changed or formatted at the end of the partitioning process. At the end of the partitioning procedure, you will be asked explicitly to write the partition changes to your disk. You can opt out of the installation at any time until that point, and your original partitions will remain untouched.

The partition options will change according to the number of hard disks on your system. If you have several hard disks, they will be listed. You can also select the disk on which to install Ubuntu.

Guided Partitioning with LVM

Ubuntu provides automatic partitioning options if you just want to use available drives and free space for your Linux system. LVM, RAID, and encrypted file systems are supported.

The Ubuntu Server provides guided options, setting up default configurations for an entire disk. You will have to have an entire blank disk free for use for your Ubuntu server (see Figure 2-12 ). Each is preceded with the term Guided. These are:

Guided - use the entire disk

Guided - use the entire disk and set up LVM

Guided - use the entire disk and set up encrypted LVM.

Figure 2-12: Partition options

If your disk is already partitioned, and the partitions have significant unused space, another option is displayed that allows you to resize the disk. The partition to be resized will be listed, usually the last partition. Be warned that resizing can take a very long time.

Guided - resize SCSI1 (0,0,0), partition #5 (sda) and use freed space

If you already have a Linux partition set up on your hard disk, and want to overwrite that existing Linux partition, an option is displayed that allows you to reuse that partition.

Guided - reuse partition SCSI1 (0,0,0), partition #5 (sda)

If you disk has a large amount of continuous unused (free) space, you are given the option to use it.

Guided - use the largest continuous free space

Windows and Linux /home partitions will not be overwritten in a Guided partition. The Guided option, though, requires free space on your hard disk on which to install your system.

If you are not sure exactly how your partitions will be formatted, and you have several partitions on your system that you want to preserve, you may want to select the Manual option so you can choose the specific partitions you want to use, designating them for formatting and installation.

If you selected a Guided option, you are then asked to select the disk to set up the partitions on (see Figure 2-13 ).

Figure 2-13: Selecting hard disk for partitioning

The default Guided partitioning will set up two partitions, one as the swap partition and an ext4 partition for the entire file system (/).

A default LVM partitioning will set up an ext2 file system for the boot directory, and then an LVM file system (Group) with two LVM volumes, one for the swap partition and one for the root (the Ubuntu system except for the boot directory).

Figure 2-14: LVM partition size

Encrypted LVM will add a further prompt for the password for your encrypted file systems. Your LVM root and swap files systems will be encrypted, but not your boot file systems. Whenever your systems boots up, you will be prompted to enter the passphrase for your encrypted file systems. Encryption adds a further level of security, especially for publicly accessed file systems like those used for servers. The effect on performance is negligible.

Figure 2-15: Creating partitions

With LVM Guided partitions, you also will be given the option to set the size for your overall partition use. This option is designed to let you leave free space on a large hard drive. This allows you to use that space for partitions that you can later add to the LVM group, expanding your space as needed. The default size will be set to use the entire hard disk (see Figure 2-14 ).

Before the partitions are created, the partition configuration is displayed and you are prompted to accept them. This is your last chance to back out of the partitioning (see Figure 2-15 ). The No button will be selected by default. If the listed changes are correct, tab to the Yes button and press ENTER to make your changes.

Tip: If you already have a Linux system, you will most likely have several Linux partitions already. Some of these may be used for just the system software, such as the boot and root partitions. These should be formatted. Others may have extensive user files, such as a /home partition that normally holds user home directories and all the files they have created. You should not format such partitions.

Manual Partitioning

To manually configure your hard drive, first plan what partitions you want to set up and what their size should be. You can set up different partitions for any directory on your system. Many systems set up separate partitions for /home, /var, /srv, as well as / (root) and /boot. You will, of course, need a swap partition.

/var directory holds data that constantly changes like printer spool files.

/srv directory holds server data, like Web server pages and FTP sites

/home directory holds users files along with any user data.

/ the root directory is the system directory. All other file systems and partitions attach to it.

/boot the boot directory holds the Linux kernel and the boot configuration. You will need a separate boot partition if you are using LVM partitions for your root partition. The boot directory cannot be on an LVM partition.

Figure 2-16: Selecting disk to partition

Except for the boot partition, all of these can be LVM volumes. LVM volumes may work better than ordinary ext4 partitions, since you can expand or replace them easily. With a standard ext4 partition you are limited to the size you specify when you first set up your partition. The following example sets up two basic partitions, one swap partition and another for the root system. First you select the disk on which to create the partition (see Figure 2-16 ).

Figure 2-17: Choosing to create a partition

Then you choose the method of partitioning. You can create a partition manually, or just automatically partition the free space (see Figure 2-17 ).

Upon choosing to create a new partition, you are prompted to enter the size. The remaining free space will be selected by default. Specify the size of the partition in either MB or GB. The term max will use all remaining free space. Then choose whether it should be primary or logical, and then at the end or beginning of the disk. (see Figure 2-18 ).

Figure 2-18: Selecting the partition size

On the partition settings screen you will specify the mount point, file system type (Use as), and the label. Pressing the ENTER key on the Use as entry will display a dialog listing file system types from which to choose. A standard Linux partition would use ext4, a swap partition would use swap area, and an LVM partition would use "Physical volume for LVM".

In Figure 2-19 , a root system partition is set up. The type is ext4, mount point is the root, /, and the label is minute.

Figure 2-19: Partition configuration

Note: With manual partitioning you can also set up software RAID devices. First create RAID partitions, then on the Partition Disks page an entry will be listed to Configure RAID devices. Choose this entry and then create an MD drive, selecting the RAID partitions to use for the drive, as well as the RAID type.

Figure 2-20: Manually created partitions

If you are setting up an LVM partition, select "physical volume for LVM" for the Use as option. The Partitions disk screen will then have an added entry for "Configure the Logical Volume Manager." Choose this to set up your volume group and its logical volumes. You are first prompted to create a volume group, specifying its device and a label. Then create the logical volumes (Create a logical volume). Enter a label and the size for each. You then return to the partitioner, which will list all your logical volumes. Select and press enter on each to then select a file system type and mount point (a swap partition will not have a mount point).

For the mount point, a dialog will list common mount points, like / for the root file system, /home for users, and /boot for a boot partition.

When you are ready, move to the last option and press ENTER, "Done setting up the partition."

When finished, your partitions will be displayed under your disk entry (see Figure 2-20 ). To actually create the partitions, move to the last entry and press ENTER, "Finish partitioning and write changes to disk." A dialog is displayed showing the partitions that will be formatted, similar to Figure 2-15 . Tab to the Yes button and press ENTER to make your partition changes.

Reuse existing Linux partitions on a hard drive

If you already have a hard drive with Linux partitions that you want to reuse, choose the "Manual" option on the "Partition disks" screen. In this case, you have a hard disk you are already using for Linux, with partitions already set up on the hard drive for your Ubuntu systems. However, you do not want to keep any of the data on those partitions. In effect, you just want to reuse those partitions for the new release, creating an entirely new install, but with the old partitions. With this action, all current data on those partitions will be destroyed. This procedure avoids having to change the partition table on the hard drive. You just keep the partitions you already have. In this case, you wish to overwrite existing partitions, erasing all the data on them.

This procedure is used often for users that have already backed up their data, and just want to create a fresh install on their hard disk with the new release. Also, a Linux system could be configured to save data on a partition separate from the root partition, like a separate partition for the/home directories. In this case, you would only need to overwrite the root partition, leaving the other Linux partitions alone.

The Manual "Partition Disks" screen will list your current partitions, showing each partition's number, size, and file system type. Use the arrow key to move the partition you want to reuse, and press ENTER. The "Partition settings" screen is displayed for this partition (see Figure 2-19). The Use as: entry will be set to "do not use." Press ENTER to display a list of file system types, for the root system use Ext4. To overwrite the partition, move to the next entry for "Format the partition" and press ENTER to toggle to the "yes, format it" option. Move to the Mountpoints entry and press ENTER, then select the root file system entry on the list displayed, and press ENTER. Then move to the "Done setting up the partition" entry and press ENTER to return to the list of partitions. You will see the partition entry for your root partition shown the ext4 file system type and / as the mount point.

Then move to the last entry, "Finish partitioning and write changes to the disk" and press ENTER. A final warning screen is displayed prompting you to write the changes to the disk and listing the changes to be made (see Figure 2-15 ). If correct, tab to the Yes button and press ENTER.

Select server software: Package Tasks

The base system is then installed (see Figure 2-21 ).

Figure 2-21: install base system

For access to the Ubuntu online repository, you are prompted to enter an http proxy server, should your network connection require it.

You are then prompted to select options for managing upgrades (see Figure 2-22 ). You can choose no automatic updates, install security updates automatically, or to use Ubuntu's Landscape service to perform automatic updates. The "No automatic updates" option will require that an administrator log in and choose to perform updates. The "Install security updates automatically" option will install the unattended-upgrades package, which will automatically perform security updates.

Figure 2-22: Select software upgrade options

On a Software Selection screen, you are prompted to select the servers you want installed (see Figure 2-23 ). Use the Arrow keys to move to a selection and press the spacebar to select it. The options are listed here.

DNS server This is the BIND Domain Name Service server (see Chapter 15).

Lamp server The LAMP server sets up a Web server with supporting software. It includes the Apache Web server, MySQL database server, and the PHP server for Web support (Linux, Apache, MySQL, and PHP) (see Chapters 8 and 9).

Mail server This is the Postfix mail server. (see Chapter 6).

OpenSSH server This is the SSH (Secure SHell) server used for secure encrypted transmissions.

PostgreSQL database This is an optional database server (see Chapter 9).

Print server This is the CUPS print server (see Chapter 10).

Samba file server This is the SAMBA file server which provides access to shared directories and printers on a Windows network (see Chapter 12).

Tomcat Java server This is the Tomcat implementation of the JAVA Servlet and Java Server Pages (JSP) support for Web applications.

Virtual Machine host This is the kernel-based virtual machine server, KVM (libvirt).

Ubuntu Desktop USB This is USB image for installing the Ubuntu Desktop on a USB drive.

Manual package selection Select the particular packages you want. You can select additional packages you want installed.

Figure 2-23: Select server packages

The "Manual package selection" entry will start up the Aptitude package manager and let you select individual packages to be installed, rather than using the server and meta package categories. See Chapter 4 for a description of how to use Aptitude. Use the + sign to mark a package for installation, and - to remove it. Use the ENTER and arrow keys to navigate the package lists, and q to close a tab. ? lists all commands. You will see a package entry change to green with an i character, indicating that it is marked for installation. When you are ready, press g to display a preview screen listing your selections, then press g again to perform all the package installs. When finished, press q to return to the install program.

After selecting your server packages, tab to the Continue button and press ENTER. Your system and the selected software is then installed

During installation, for MySQL (LAMP), you are prompted for a password. For Postfix (Mail server), you are prompted to select the type of configuration. For the Internet option, you will need to enter the domain name for your server's network.

If other operating systems are present on your system, they will be detected and listed in the "Configure grub-pc" screen. If all the other operating systems are listed correctly, you can install the boot loader. The Yes button will be selected, press ENTER to continue. If you wish to use the older LILO boot loader instead or not to use any boot loader, tab to the Go Back button and press ENTER to list the "Ubuntu installer main menu" (see Figure 2-2 ). Here you can choose to install LILO or not to install any boot loader.

Figure 2-24: Finishing install

Remaining configuration and boot loader installation is performed for you. If another operating system is detected on your disk (like Windows), you will be prompted to install the boot loader on the master boot record. The installation then finishes. The server disk is ejected and you are prompted to reboot (see Figure 2-24 ).

Note: JeOS is no longer supported. Instead press F4 at the Ubuntu Server install screen.

Recovery, rescue, and boot loader re-install

Ubuntu provides the means to start up systems that have failed for some reason. A system that may boot but fails to start up, can be started in a recovery mode, already set up for you as an entry on your boot loader menu. A system that you cannot even boot may require work that is more advanced. You can access such a broken system using the Server CD.


If for some reason your system is not able to start up, it may be due to conflicting configurations, libraries, or applications. On the GRUB menu first choose the "Advanced options or Ubuntu" to open the advanced options menu. Then select the recovery mode entry, the Ubuntu kernel entry with the (recovery mode) label attached to the end, as shown here.

This will start up a menu where you can use the arrow and ENTER keys to select from several recovery options (see Figure 2-25 ). These include resume, fsck, remount, and root. Short descriptions for each item are displayed on the menu.

The root option will start up Ubuntu as the root user with a command line shell prompt. In this case, you can boot your Linux system in a recovery mode and then edit configuration files with a text editor such as Vi and nano, remove the suspect libraries, or reinstall damaged software with apt-get.

If you forget your password, you can select the Recovery mode from the GRUB menu, then choose the "Drop to root shell prompt" entry. Then run the passwd command with the user name. You will be prompted to re-enter the password for that user. You can then run the halt command to shut down the system. When you restart, the new password will work.

The resume entry will start up Ubuntu normally, but in the command line mode.

Figure 2-25: Recovery menu

To rescue a broken system, choose the root entry. Your broken system will be mounted and made accessible with a command line interface. You can then use command line operations and editors to fix configuration files.

Rescue a broken system with the Ubuntu Server CD

If you are not able to start up your system from your hard disk install, you can boot up with the Server CD and choose "Rescue a broken system" from the Start up menu (see Figure 2-1 ). Follow the prompts to start up your system, choosing a language, location, keyboard, hostname, and time zone. Select the file system when requested. The "Enter rescue mode" screen appears which provides options to mount your system (see Figure 2-26 ). Your broken system will be mounted and made accessible with a command line interface. You can then use command line operations and editors to fix configuration files.

Figure 2-26: Server CD rescue mode choices

Re-Installing the Boot Loader

If you have a multiple-boot system, that runs both Windows and Linux on the same machine, you may run into a situation where you have to re-install your GRUB boot loader. This problem occurs if your Windows system completely crashes beyond repair and you have to install a new version of Windows, if you added Windows to your machine after having installed Linux, or if you upgraded to a new version of Windows. A Windows installation will automatically overwrite your boot loader (alternatively, you could install your boot loader on your Linux partition instead of the master boot record, MBR). You will no longer be able to access your Linux system.

You can manually reinstall your boot loader, using your Ubuntu Desktop DVD. The procedure is more complicated, as you have to mount your Ubuntu system. On the Ubuntu LiveCD, you can use GParted to find out what partition your Ubuntu system uses (Applications | Other | Partition). In a terminal window (Applications | Accessories | Terminal), create a directory on which to mount the system.

sudo mkdir myubuntu

Then mount it, making sure you have the correct file system type and partition name (usually /dev/sda5 on dual boot systems).

sudo mount -t ext4 /dev/sda5 myubuntu

Then, use grub-install and the device name of your first partition to install the boot loader, with the --root-directory option to specify the directory where you mounted your Ubuntu file system. The --root-directory option requires a full path name, which for the Ubuntu LiveCD would be /home/ubuntu for the home directory. Using the myubuntu directory this example, the full patch name of the Ubuntu file system would be /home/ubuntu/myubuntu. You would then enter the following grub-install command.

sudo grub-install --root-directory=/home/ubuntu/myubuntu /dev/sda

This will re-install your current GRUB boot loader. You can then reboot, and the GRUB boot loader will start up.

Metal as a Service (MAAS)

MAAS allows you to manage hardware servers as if they were virtual servers (physical provisioning). You can find out more about MASS at:

Check the Ubuntu MAAS page for information on how to set up a MAAS service.

MAAS uses a DHCP server to connect to your hardware machines (nodes). To set up MAAS, you install it using the Ubuntu Server CD, choosing the second install option.

Ubuntu MAAS Installation or Enlistment.

You will be prompted to either create a new MAAS server or connect to one you already have running (enlistment). Upon creating a new MAAS server, a dialog notifies you that the MAAS server is installed on your system, and displays the IP address with /MAAS as the URL.

When you first restart your system with MAAS installed, you will have to set up a MAAS administrative user, using the following command.

maas createsuperuser

You then have to setup either a dedicated MAAS DHCP server, or modify your current DHCP server to support MAAS. For a dedicated MAAS DCHP server, install the mass-dhcp package. You will have to specify the IP address range for your nodes, the gateway they use, and the network domain.

You can then use the mass-import-isos command to import Ubuntu images. Then add nodes to your MAAS service using the Ubuntu Server CD to enlist the node, or use PXE to enlist them from the MAAS dashboard (Web interface). For more information see:

From the MAAS administration account, you then accept and commission the nodes.


You can then use JuJu with MAAS to deploy and manage cloud services

First, you create a MAAS API key for JuJu (MAAS Preferences dialog, Add Key entry). Create a JuJu directory (.juju) and configure in it an envronments.yaml file. The Ubuntu example is shown here.

type: maas
maas-server: 'http:// maas.server.ip:80/MAAS'
maas-oauth: '${maas-api-key}'
admin-secret: 'nothing'
default-series: vivid

You will then generate an SSH key for the JuJu node (ssh-keygen) and then run the JuJu bootstrap command to allocate a node to the JuJu environment.

juju bootstrap