1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4
<!ENTITY % globalent SYSTEM "../../libs/global.ent">
6
<!ENTITY % gnome-menus-C SYSTEM "../../libs/gnome-menus-C.ent">
8
<!ENTITY % xinclude SYSTEM "../../libs/xinclude.mod">
10
<!ENTITY language "&EnglishAmerican;">
12
<chapter id="installation" status="review">
13
<title>Installation</title>
15
This chapter provides a quick overview of installing Ubuntu &distro-rev; Server Edition. For more detailed instructions,
16
please refer to the <ulink url="https://help.ubuntu.com/&distro-rev-short;/installation-guide/">Ubuntu Installation Guide</ulink>.
18
<sect1 id="preparing-to-install" status="review">
19
<title>Preparing to Install</title>
21
This section explains various aspects to consider before starting the
23
<sect2 id="system-requirements" status="review">
24
<title>System Requirements</title>
25
<para>Ubuntu &distro-rev; Server Edition supports two (2) major architectures: Intel x86 and AMD64. The table below lists recommended hardware specifications. Depending on your needs, you might manage with less than this. However, most users risk being frustrated if they ignore these suggestions.</para>
27
<title>Recommended Minimum Requirements</title>
29
<colspec colname="1"/>
30
<colspec colname="2"/>
31
<colspec colname="3" colwidth="2"/>
32
<colspec colname="4"/>
35
<entry morerows="1" valign="middle"><para>Install Type</para></entry>
36
<entry morerows="1" valign="middle"><para>RAM</para></entry>
37
<entry namest="3" nameend="4" align="center"><para>Hard Drive Space</para></entry>
40
<entry><para>Base System</para></entry>
41
<entry><para>All Tasks Installed</para></entry>
46
<entry><para>Server</para></entry>
47
<entry><para>128 megabytes</para></entry>
48
<entry><para>500 megabytes</para></entry>
49
<entry><para>1 gigabyte</para></entry>
55
The Server Edition provides a common base for all sorts of server applications.
56
It is a minimalist design providing a platform for the desired services, such
57
as file/print services, web hosting, email hosting, etc.
61
The requirements for UEC are slightly different for Front End requirements see <xref linkend="uec-frontend-requirements"/> and for
62
UEC Node requirements see <xref linkend="uec-node-requirements"/>.
67
<sect2 id="intro-server-differences" status="review">
68
<title>Server and Desktop Differences</title>
70
There are a few differences between the <emphasis>Ubuntu Server Edition</emphasis> and the
71
<emphasis>Ubuntu Desktop Edition</emphasis>. It should be noted that both editions use the same
72
<application>apt</application> repositories. Making it just as easy to install a <emphasis role="italic">server</emphasis>
73
application on the Desktop Edition as it is on the Server Edition.
76
The differences between the two editions are the lack of an X window environment in the Server Edition,
77
the installation process, and different Kernel options.
81
<sect3 id="intro-kernel-diffs" status="review">
82
<title>Kernel Differences:</title>
86
The Server Edition uses the <emphasis>Deadline</emphasis> I/O scheduler instead of the
87
<emphasis>CFQ</emphasis> scheduler used by the Desktop Edition.
92
<emphasis>Preemption</emphasis> is turned off in the Server Edition.
97
The timer interrupt is 100 Hz in the Server Edition and 250 Hz in the Desktop Edition.
103
When running a 64-bit version of Ubuntu on 64-bit processors you are not limited by memory addressing space.
108
To see all kernel configuration options you can look through <filename>/boot/config-&linux-kernel-version;-server</filename>.
109
Also, <ulink url="http://www.kroah.com/lkn/">Linux Kernel in a Nutshell</ulink> is a great resource on the options
115
<sect2 id="backing-up" status="review">
116
<title>Backing Up</title>
120
Before installing <application>Ubuntu Server Edition</application> you should make sure all data on the system
121
is backed up. See <xref linkend="backups"/> for backup options.
124
If this is not the first time an operating system has been installed on your
125
computer, it is likely you will need to re-partition your disk to make room for Ubuntu.
128
Any time you partition your disk, you should be prepared to
129
lose everything on the disk should you make a mistake or
130
something goes wrong during partitioning. The programs used in installation are
131
quite reliable, most have seen years of use, but they
132
also perform destructive actions.
138
<sect1 id="installing-from-cd" status="review">
139
<title>Installing from CD</title>
141
The basic steps to install Ubuntu Server Edition from CD are the same for installing any operating system from CD. Unlike
142
the <emphasis>Desktop Edition</emphasis> the <emphasis>Server Edition</emphasis> does not include a graphical
143
installation program. Instead the Server Edition uses a console menu based process.
148
First, download and burn the appropriate ISO file from the <ulink url="http://www.ubuntu.com/getubuntu/download">
149
Ubuntu web site</ulink>.
154
Boot the system from the CD-ROM drive.
159
At the boot prompt you will be asked to select the language.
160
Afterwards the installation process begins by asking for your keyboard layout.
165
From the main boot menu there are some additional options to install Ubuntu Server Edition. You can install a
166
basic Ubuntu Server, or install Ubuntu Server as part of a <emphasis>Ubuntu Enterprise Cloud</emphasis>.
167
For more information on UEC see <xref linkend="uec"/>. The rest of this section will cover the basic
168
Ubuntu Server install.
173
The installer then discovers your hardware configuration, and configures the
174
network settings using DHCP. If you do not wish to use DHCP at the next screen
175
choose "Go Back", and you have the option to "Configure the network manually".
180
Next, the installer asks for the system's hostname and Time Zone.
185
You can then choose from several options to configure the hard drive layout.
186
For advanced disk options see <xref linkend="advanced-installation"/>.
191
The Ubuntu base system is then installed.
196
A new user is setup, this user will have <emphasis>root</emphasis> access
197
through the <application>sudo</application> utility.
202
After the user is setup, you will be asked to encrypt your
203
<filename role="directory">home</filename> directory.
208
The next step in the installation process is to decide how you want to update the system.
209
There are three options:
214
<emphasis>No automatic updates</emphasis>: this requires an administrator to log into
215
the machine and manually install updates.
220
<emphasis>Install security updates Automatically</emphasis>: will install the
221
<application>unattended-upgrades</application> package, which will install security updates without the intervention
222
of an administrator. For more details see <xref linkend="automatic-updates"/>.
227
<emphasis>Manage the system with Landscape</emphasis>: Landscape is a paid service provided
228
by Canonical to help manage your Ubuntu machines. See the
229
<ulink url="http://www.canonical.com/projects/landscape">Landscape</ulink> site for details.
236
You now have the option to install, or not install, several package tasks. See
237
<xref linkend="install-tasks"/> for details. Also, there is an option to launch
238
<application>aptitude</application> to choose specific packages to install. For more
239
information see <xref linkend="aptitude"/>.
244
Finally, the last step before rebooting is to set the clock to UTC.
250
If at any point during installation you are not satisfied by the default setting, use the "Go Back" function at
251
any prompt to be brought to a detailed installation menu that will allow you to modify the default settings.
255
At some point during the installation process you may want to
256
read the help screen provided by the installation system. To
260
Once again, for detailed instructions see the <ulink url="https://help.ubuntu.com/&distro-rev-short;/installation-guide/">
261
Ubuntu Installation Guide</ulink>.
264
<sect2 id="install-tasks" status="review">
265
<title>Package Tasks</title>
267
During the Server Edition installation you have the option of installing additional packages from the CD. The packages
268
are grouped by the type of service they provide.
273
DNS server: Selects the BIND DNS server and its documentation.
278
LAMP server: Selects a ready-made Linux/Apache/MySQL/PHP server.
283
Mail server: This task selects a variety of package useful for a general purpose mail server system.
288
OpenSSH server: Selects packages needed for an OpenSSH server.
293
PostgreSQL database: This task selects client and server packages for the PostgreSQL database.
298
Print server: This task sets up your system to be a print server.
303
Samba File server: This task sets up your system to be a Samba file server, which is
304
especially suitable in networks with both Windows and Linux systems.
309
Tomcat Java server: Installs Apache Tomcat and needed dependencies.
314
Virtual Machine host: Includes packages needed to run KVM virtual machines.
319
Manually select packages: Executes <application>aptitude</application> allowing you to individually select packages.
324
Installing the package groups is accomplished using the <application>tasksel</application> utility.
325
One of the important difference between Ubuntu (or Debian) and other GNU/Linux distribution is that, when
326
installed, a package is also configured to reasonable defaults, eventually prompting you for additional required
327
information. Likewise, when installing a task, the packages are not only installed, but also configured to provided
328
a fully integrated service.
331
Once the installation process has finished you can view a list of available tasks by entering the following from a
335
<command>tasksel --list-tasks</command>
339
The output will list tasks from other Ubuntu based distributions such as Kubuntu and Edubuntu.
340
Note that you can also invoke the <command>tasksel</command> command by itself, which will bring up a menu
341
of the different tasks available.
345
You can view a list of which packages are installed with each task using the <emphasis>--task-packages</emphasis> option.
346
For example, to list the packages installed with the <emphasis>DNS Server</emphasis> task enter the following:
349
<command>tasksel --task-packages dns-server</command>
352
The output of the command should list:
360
Also, if you did not install one of the tasks during the installation process, but for example you decide to make your new LAMP server
361
a DNS server as well. Simply insert the installation CD and from a terminal:
364
<command>sudo tasksel install dns-server</command>
368
<sect1 id="installing-upgrading" status="review">
369
<title>Upgrading</title>
371
There are several ways to upgrade from one Ubuntu release to another. This section gives an overview of the recommended upgrade method.
373
<sect2 id="do-release-upgrade" status="review">
374
<title>do-release-upgrade</title>
376
The recommended way to upgrade a Server Edition installation is to use the <application>do-release-upgrade</application> utility.
377
Part of the <emphasis>update-manager-core</emphasis> package, it does not have any graphical dependencies and
378
is installed by default.
381
Debian based systems can also be upgraded by using <command>apt-get dist-upgrade</command>. However, using
382
<application>do-release-upgrade</application> is recommended because it has the ability to handle system configuration
383
changes sometimes needed between releases.
386
To upgrade to a newer release, from a terminal prompt enter:
389
<command>do-release-upgrade</command>
392
It is also possible to use <application>do-release-upgrade</application> to upgrade to a development version of
393
Ubuntu. To accomplish this use the <emphasis>-d</emphasis> switch:
396
<command>do-release-upgrade -d</command>
400
Upgrading to a development release is <emphasis>not</emphasis> recommended for production environments.
405
<sect1 id="advanced-installation" status="review">
406
<title>Advanced Installation</title>
408
<sect2 id="software-raid" status="review">
409
<title>Software RAID</title>
412
RAID is a method of configuring multiple hard drives to act as one, reducing the
413
probability of catastrophic data loss in case of drive failure. RAID is implemented in either software
414
(where the operating system knows about both drives and actively maintains both of them) or hardware
415
(where a special controller makes the OS think there's only one drive and maintains the drives 'invisibly').
419
The RAID software included with current versions of Linux (and Ubuntu) is based on the <application>'mdadm'</application>
420
driver and works very well, better even than many so-called 'hardware' RAID controllers. This section will guide you
421
through installing Ubuntu Server Edition using two RAID1 partitions on two physical hard drives, one for
422
<emphasis>/</emphasis> and another for <emphasis>swap</emphasis>.
425
<sect3 id="raid-partitioning" status="review">
426
<title>Partitioning</title>
429
Follow the installation steps until you get to the <emphasis>Partition disks</emphasis> step, then:
436
Select <emphasis>Manual</emphasis> as the partition method.
443
Select the first hard drive, and agree to <emphasis>"Create a new empty partition table on this device?"</emphasis>.
447
Repeat this step for each drive you wish to be part of the RAID array.
454
Select the <emphasis>"FREE SPACE"</emphasis> on the first drive then select <emphasis>"Create a new partition"</emphasis>.
461
Next, select the <emphasis>Size</emphasis> of the partition. This partition will be the <emphasis>swap</emphasis> partition,
462
and a general rule for swap size is twice that of RAM. Enter the partition size, then choose <emphasis>Primary</emphasis>,
463
then <emphasis>Beginning</emphasis>.
468
A swap partition size of twice the available RAM capacity may not always be desirable, especially on systems with large amounts of RAM.
469
Calculating the swap partition size for servers is highly dependent on how the system is going to be used.
477
Select the <emphasis>"Use as:"</emphasis> line at the top. By default this is
478
<emphasis role="italic">"Ext4 journaling file system"</emphasis>, change that to <emphasis>"physical volume for RAID"</emphasis>
479
then <emphasis>"Done setting up partition"</emphasis>.
486
For the <emphasis>/</emphasis> partition once again select <emphasis>"Free Space"</emphasis> on the first drive then
487
<emphasis>"Create a new partition"</emphasis>.
494
Use the rest of the free space on the drive and choose <emphasis>Continue</emphasis>, then <emphasis>Primary</emphasis>.
501
As with the swap partition, select the <emphasis>"Use as:"</emphasis> line at the
502
top, changing it to <emphasis>"physical volume for RAID"</emphasis>. Also select the
503
<emphasis>"Bootable flag:"</emphasis> line to change the value to
504
<emphasis>"on"</emphasis>. Then choose <emphasis>"Done setting up partition"</emphasis>.
511
Repeat steps three through eight for the other disk and partitions.
518
<sect3 id="raid-configuration" status="review">
519
<title>RAID Configuration</title>
522
With the partitions setup the arrays are ready to be configured:
529
Back in the main "Partition Disks" page, select <emphasis>"Configure Software RAID"</emphasis> at the top.
536
Select <emphasis>"yes"</emphasis> to write the changes to disk.
543
Choose <emphasis>"Create MD device"</emphasis>.
550
For this example, select <emphasis>"RAID1"</emphasis>, but if you are using a different setup choose the appropriate type
556
In order to use <emphasis>RAID5</emphasis> you need at least <emphasis>three</emphasis> drives. Using RAID0 or RAID1
557
only <emphasis>two</emphasis> drives are required.
565
Enter the number of active devices <emphasis>"2"</emphasis>, or the amount of hard drives you have, for the array. Then
566
select <emphasis>"Continue"</emphasis>.
573
Next, enter the number of spare devices <emphasis>"0"</emphasis> by default, then choose <emphasis>"Continue"</emphasis>.
580
Choose which partitions to use. Generally they will be sda1, sdb1, sdc1, etc. The numbers will usually match and the different
581
letters correspond to different hard drives.
585
For the <emphasis>swap</emphasis> partition choose <emphasis>sda1</emphasis> and <emphasis>sdb1</emphasis>.
586
Select <emphasis>"Continue"</emphasis> to go to the next step.
593
Repeat steps <emphasis>three</emphasis> through <emphasis>seven</emphasis> for the <emphasis>/</emphasis> partition choosing
594
<emphasis>sda2</emphasis> and <emphasis>sdb2</emphasis>.
601
Once done select <emphasis>"Finish"</emphasis>.
609
<sect3 id="raid-formatting" status="review">
610
<title>Formatting</title>
613
There should now be a list of hard drives and RAID devices. The next step is to format and set the mount point for the RAID devices.
614
Treat the RAID device as a local hard drive, format and mount accordingly.
621
Select <emphasis>"#1"</emphasis> under the <emphasis>"RAID1 device #0"</emphasis> partition.
628
Choose <emphasis>"Use as:"</emphasis>. Then select <emphasis>"swap area"</emphasis>, then
629
<emphasis>"Done setting up partition"</emphasis>.
636
Next, select <emphasis>"#1"</emphasis> under the <emphasis>"RAID1 device #1"</emphasis> partition.
643
Choose <emphasis>"Use as:"</emphasis>. Then select <emphasis>"Ext4 journaling file system"</emphasis>.
650
Then select the <emphasis>"Mount point"</emphasis> and choose <emphasis>"/ - the root file system"</emphasis>.
651
Change any of the other options as appropriate, then select <emphasis>"Done setting up partition"</emphasis>.
658
Finally, select <emphasis>"Finish partitioning and write changes to disk"</emphasis>.
665
If you choose to place the root partition on a RAID array, the installer will then ask if you would like to boot in
666
a <emphasis>degraded</emphasis> state. See <xref linkend="raid-degraded"/> for further details.
670
The installation process will then continue normally.
674
<sect3 id="raid-degraded" status="review">
675
<title>Degraded RAID</title>
678
At some point in the life of the computer a disk failure event may occur. When this happens, using Software RAID, the operating
679
system will place the array into what is known as a <emphasis>degraded</emphasis> state.
683
If the array has become degraded, due to the chance of data corruption, by default Ubuntu Server Edition will boot
684
to <emphasis>initramfs</emphasis> after thirty seconds. Once the initramfs has booted there is a fifteen second
685
prompt giving you the option to go ahead and boot the system, or attempt manual recover. Booting to the initramfs
686
prompt may or may not be the desired behavior, especially if the machine is in a remote location. Booting to a
687
degraded array can be configured several ways:
694
The <application>dpkg-reconfigure</application> utility can be used to configure the default behavior, and
695
during the process you will be queried about additional settings related to the array. Such as monitoring, email
696
alerts, etc. To reconfigure <application>mdadm</application> enter the following:
700
<command>sudo dpkg-reconfigure mdadm</command>
707
The <command>dpkg-reconfigure mdadm</command> process will change the <filename>/etc/initramfs-tools/conf.d/mdadm</filename>
708
configuration file. The file has the advantage of being able to pre-configure the system's behavior, and can also be manually
718
The configuration file can be overridden by using a Kernel argument.
726
Using a Kernel argument will allow the system to boot to a degraded array as well:
732
When the server is booting press <keycap>Shift</keycap> to open the <application>Grub</application> menu.
737
Press <keycap>e</keycap> to edit your kernel command options.
742
Press the <keycap>down</keycap> arrow to highlight the kernel line.
747
Add <emphasis>"bootdegraded=true"</emphasis> (without the quotes) to the end of the line.
752
Press <keycombo><keycap>Ctrl</keycap><keycap>x</keycap></keycombo> to boot the system.
761
Once the system has booted you can either repair the array see <xref linkend="raid-maintenance"/> for details, or copy
762
important data to another machine due to major hardware failure.
766
<sect3 id="raid-maintenance">
767
<title>RAID Maintenance</title>
770
The <application>mdadm</application> utility can be used to view the status of an array, add disks to an array, remove
777
To view the status of an array, from a terminal prompt enter:
780
<command>sudo mdadm -D /dev/md0</command>
784
The <emphasis>-D</emphasis> tells <application>mdadm</application> to display <emphasis>detailed</emphasis> information
785
about the <filename>/dev/md0</filename> device. Replace <filename>/dev/md0</filename> with the appropriate RAID device.
790
To view the status of a disk in an array:
793
<command>sudo mdadm -E /dev/sda1</command>
796
The output if very similar to the <command>mdadm -D</command> command, adjust <filename>/dev/sda1</filename> for each disk.
801
If a disk fails and needs to be removed from an array enter:
804
<command>sudo mdadm --remove /dev/md0 /dev/sda1</command>
807
Change <filename>/dev/md0</filename> and <filename>/dev/sda1</filename> to the appropriate RAID device and disk.
812
Similarly, to add a new disk:
815
<command>sudo mdadm --add /dev/md0 /dev/sda1</command>
821
Sometimes a disk can change to a <emphasis>faulty</emphasis> state even though there is nothing physically wrong with the drive.
822
It is usually worthwhile to remove the drive from the array then re-add it. This will cause the drive to re-sync with the array.
823
If the drive will not sync with the array, it is a good indication of hardware failure.
827
The <filename>/proc/mdstat</filename> file also contains useful information about the system's RAID devices:
831
<command>cat /proc/mdstat</command>
832
<computeroutput>Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
833
md0 : active raid1 sda1[0] sdb1[1]
834
10016384 blocks [2/2] [UU]
836
unused devices: <none></computeroutput>
840
The following command is great for watching the status of a syncing drive:
844
<command>watch -n1 cat /proc/mdstat</command>
848
Press <emphasis>Ctrl+c</emphasis> to stop the <application>watch</application> command.
852
If you do need to replace a faulty drive, after the drive has been replaced and synced, <application>grub</application> will need to be
853
installed. To install <application>grub</application> on the new drive, enter the following:
857
<command>sudo grub-install /dev/md0</command>
861
Replace <filename>/dev/md0</filename> with the appropriate array device name.
865
<sect3 id="raid-resources" status="review">
866
<title>Resources</title>
869
The topic of RAID arrays is a complex one due to the plethora of ways RAID can be configured. Please see the following links for
876
<ulink url="https://help.ubuntu.com/community/Installation#raid">Ubuntu Wiki Articles on RAID</ulink>.
881
<ulink url="http://www.faqs.org/docs/Linux-HOWTO/Software-RAID-HOWTO.html">Software RAID HOWTO</ulink>
886
<ulink url="http://oreilly.com/catalog/9781565927308/">Managing RAID on Linux</ulink>
892
<sect2 id="lvm" status="review">
893
<title>Logical Volume Manager (LVM)</title>
896
Logical Volume Manger, or <emphasis>LVM</emphasis>, allows administrators to create <emphasis>logical</emphasis> volumes out of
897
one or multiple physical hard disks. LVM volumes can be created on both software RAID partitions and standard partitions
898
residing on a single disk. Volumes can also be extended, giving greater flexibility to systems as requirements change.
901
<sect3 id="lvm-overview" status="review">
902
<title>Overview</title>
905
A side effect of LVM's power and flexibility is a greater degree of complication. Before diving into the LVM installation process,
906
it is best to get familiar with some terms.
912
<emphasis>Volume Group (VG):</emphasis> contains one or several Logical Volumes (LV).
917
<emphasis>Logical Volume (LV):</emphasis> is similar to a partition in a non-LVM system. Multiple Physical Volumes (PV)
918
can make up one LV, on top of which resides the actual EXT3, XFS, JFS, etc filesystem.
923
<emphasis>Physical Volume (PV):</emphasis> physical hard disk or software RAID partition. The Volume Group can be extended
930
<sect3 id="lvm-installation" status="review">
931
<title>Installation</title>
934
As an example this section covers installing Ubuntu Server Edition with <filename role="directory">/srv</filename> mounted
935
on a LVM volume. During the initial install only one Physical Volume (PV) will be part of the Volume Group (VG). Another
936
PV will be added after install to demonstrate how a VG can be extended.
940
There are several installation options for LVM, <emphasis>"Guided - use the entire disk and setup LVM"</emphasis> which will
941
also allow you to assign a portion of the available space to LVM, <emphasis>"Guided - use entire and setup encrypted LVM"</emphasis>,
942
or <emphasis>Manually</emphasis> setup the partitions and configure LVM. At this time the only way to configure a system with
943
both LVM and standard partitions, during installation, is to use the Manual approach.
950
Follow the installation steps until you get to the <emphasis>Partition disks</emphasis> step, then:
957
At the <emphasis>"Partition Disks</emphasis> screen choose <emphasis>"Manual"</emphasis>.
964
Select the hard disk and on the next screen choose "yes" to <emphasis>"Create a new empty partition table on this device"</emphasis>.
971
Next, create standard <emphasis>/boot</emphasis>, <emphasis>swap</emphasis>, and <emphasis>/</emphasis> partitions with whichever
972
filesystem you prefer.
979
For the LVM <emphasis>/srv</emphasis>, create a new <emphasis>Logical</emphasis> partition. Then change <emphasis>"Use as"</emphasis>
980
to <emphasis>"physical volume for LVM"</emphasis> then <emphasis>"Done setting up the partition"</emphasis>.
987
Now select <emphasis>"Configure the Logical Volume Manager"</emphasis> at the top, and choose <emphasis>"Yes"</emphasis> to write
995
For the <emphasis>"LVM configuration action"</emphasis> on the next screen, choose <emphasis>"Create volume group"</emphasis>. Enter
996
a name for the VG such as <emphasis>vg01</emphasis>, or something more descriptive. After entering a name, select the partition
997
configured for LVM, and choose <emphasis>"Continue"</emphasis>.
1004
Back at the <emphasis>"LVM configuration action"</emphasis> screen, select <emphasis>"Create logical volume"</emphasis>. Select
1005
the newly created volume group, and enter a name for the new LV, for example <emphasis>srv</emphasis> since that is the intended
1006
mount point. Then choose a size, which may be the full partition because it can always be extended later. Choose
1007
<emphasis>"Finish"</emphasis> and you should be back at the main <emphasis>"Partition Disks"</emphasis> screen.
1014
Now add a filesystem to the new LVM. Select the partition under <emphasis>"LVM VG vg01, LV srv"</emphasis>, or whatever name
1015
you have chosen, the choose <emphasis>Use as</emphasis>. Setup a file system as normal selecting <emphasis>/srv</emphasis> as
1016
the mount point. Once done, select <emphasis>"Done setting up the partition"</emphasis>.
1023
Finally, select <emphasis>"Finish partitioning and write changes to disk"</emphasis>. Then confirm the changes and continue
1024
with the rest of the installation.
1031
There are some useful utilities to view information about LVM:
1035
<listitem><para><emphasis>vgdisplay:</emphasis> shows information about Volume Groups.</para></listitem>
1036
<listitem><para><emphasis>lvdisplay:</emphasis> has information about Logical Volumes.</para></listitem>
1037
<listitem><para><emphasis>pvdisplay:</emphasis> similarly displays information about Physical Volumes.</para></listitem>
1041
<sect3 id="lvm-extending" status="review">
1042
<title>Extending Volume Groups</title>
1045
Continuing with <emphasis>srv</emphasis> as an LVM volume example, this section covers adding a second hard disk, creating
1046
a Physical Volume (PV), adding it to the volume group (VG), extending the logical volume <filename role="directory">srv</filename>
1047
and finally extending the filesystem. This example assumes a second hard disk has been added to the system. This hard disk will be
1048
named <filename>/dev/sdb</filename> in our example. BEWARE: make sure you don't already have an existing <filename>/dev/sdb</filename>
1049
before issuing the commands below. You could lose some data if you issue those commands on a non-empty disk. In our example we will
1050
use the entire disk as a physical volume (you could choose to create partitions and use them as different physical volumes)
1057
First, create the physical volume, in a terminal execute:
1061
<command>sudo pvcreate /dev/sdb</command>
1068
Now extend the Volume Group (VG):
1072
<command>sudo vgextend vg01 /dev/sdb</command>
1079
Use <application>vgdisplay</application> to find out the free physical extents - Free PE / size (the size you can allocate).
1080
We will assume a free size of 511 PE (equivalent to 2GB with a PE size of 4MB) and we will use the whole free space available.
1081
Use your own PE and/or free space.
1085
The Logical Volume (LV) can now be extended by different methods, we will only see how to use the PE to extend the LV:
1089
<command>sudo lvextend /dev/vg01/srv -l +511</command>
1093
The <emphasis>-l</emphasis> option allows the LV to be extended using PE.
1094
The <emphasis>-L</emphasis> option allows the LV to be extended using Meg, Gig, Tera, etc bytes.
1101
Even though you are supposed to be able to <emphasis>expand</emphasis> an ext3 or ext4 filesystem without unmounting it first,
1102
it may be a good practice to unmount it anyway and check the filesystem, so that you don't mess up the day you want to reduce
1103
a logical volume (in that case unmounting first is compulsory).
1107
The following commands are for an <emphasis>EXT3</emphasis> or <emphasis>EXT4</emphasis> filesystem. If you are
1108
using another filesystem there may be other utilities available.
1112
<command>sudo umount /srv</command>
1113
<command>sudo e2fsck -f /dev/vg01/srv</command>
1117
The <emphasis>-f</emphasis> option of <application>e2fsck</application> forces checking even if the system seems clean.
1124
Finally, resize the filesystem:
1128
<command>sudo resize2fs /dev/vg01/srv</command>
1135
Now mount the partition and check its size.
1139
<command>mount /dev/vg01/srv /srv && df -h /srv</command>
1146
<sect3 id="lvm-resources" status="review">
1147
<title>Resources</title>
1152
See the <ulink url="https://help.ubuntu.com/community/Installation#lvm">Ubuntu Wiki LVM Articles</ulink>.
1157
See the <ulink url="http://tldp.org/HOWTO/LVM-HOWTO/index.html">LVM HOWTO</ulink> for more information.
1162
Another good article is
1163
<ulink url="http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html">Managing Disk Space with LVM</ulink>
1164
on O'Reilly's linuxdevcenter.com site.
1169
For more information on <application>fdisk</application> see the
1170
<ulink url="http://manpages.ubuntu.com/manpages/&distro-short-codename;/en/man8/fdisk.8.html">fdisk man page</ulink>.