9
9
<para><emphasis role="strong">Objectives</emphasis></para>
10
10
<para>In this lesson, you will learn:
12
<listitem><para>The benefits of partitioning (having more than one operating system on your computer)</para></listitem>
12
<listitem><para>The benefits of partitioning</para></listitem>
13
13
<listitem><para>How to create partitions</para></listitem>
14
14
<listitem><para>How to configure start-up options</para></listitem>
20
20
<para>Simply broken down, a new hard disk is similar to the foundations of a house - it needs some structure and walls before you can start
21
21
putting things (like furniture) into it. The partition is the first level of foundation on the disk. Once the disk is logically carved up
22
22
into partitions, it can be thought of as a house with rooms. Each partition (room) is of a specific size which could potentially
23
be resized after you move it, but would cause some disruption as objects get moved to make room. Once a partition (room) is created it can then be formatted using the filesystem of your choice. Once the filesystem has been
24
layed down, it's possible to start populating the partition with data in the form of files and folders (furniture).</para>
23
be resized again after you move it, but would cause some disruption as objects get moved to make room. Once a partition (room) is created it can then be formatted using the filesystem of your choice. Once the filesystem has been
24
laid down, it's possible to start populating the partition with data in the form of files and folders (furniture).</para>
25
25
<para>So, a partition is a logical chunk of space allocated out of the entire disk.
26
26
Depending on how a system is configured at installation time, there maybe one or more partitions on a disk.
27
27
In some instances, it is also possible to modify the layout, number and size of partitions,
28
28
but this is often considered an expert's function.</para>
29
29
<para>Many Microsoft Windows users will have just one large partition - often known as "C: drive", however
30
it is also common for Microsoft Windows users to have multiple partitions which are lablled with successive alphabetic
30
it is also common for Microsoft Windows users to have multiple partitions which are labelled with successive alphabetic
31
31
characters (D:, E: and so on).</para>
32
<para>Similarly, in Ubuntu it's possible to install the system in exactly one partition on the disk, or
32
<para>Similarly, with Ubuntu it's possible to install the system in exactly one partition on the disk, or
33
33
spread data and applications over multiple partitions. </para>
34
34
<figure id="fig:partioning"><title><emphasis role="italic">Partitioning</emphasis></title>
35
35
<mediaobject><imageobject>
43
43
<para>If you accept all the defaults when installing Ubuntu, you will end up with a system comprising
44
44
two logical partitions on the disk you install to. One contains all files, the other is known as swap which
45
45
can simply be thought of as an extension to the memory in your computer.</para></note>
46
<para>Alternatively it's possible to create multiple partitions of differing sizes into which different types of
46
<para>Alternatively, it is possible to create multiple partitions of differing sizes into which different types of
47
47
applications, libraries and data can be placed. This is often used in a multi-user or server environment where user data
48
48
is kept separate from system programs, log files and configuration files. A significant benefit to this can be seen
49
49
when there is a problem on the system and log files start to grow. The log files (in one partition) will not consume
53
53
is quite an advanced topic.</para>
54
54
<note><title><emphasis role="strong">Note:</emphasis></title>
55
55
<para>Whilst it is possible to change the disk partitioning layout after the system has been installed, it is important
56
to take backups before making any changes to the partitions.</para></note>
57
<para><emphasis role="strong">A word about filesystems.</emphasis></para>
56
to make backups before making any changes to the partitions.</para></note>
57
<para><emphasis role="strong">About filesystems</emphasis></para>
58
58
<para>Partitioning a disk is only the beginning. Once the disk has been logically divided up, those partitions need to be
59
59
formatted so that the operating system can place files on the disk in a structured manner. There are many different filesystem
60
types, each with their own advantages. Under Microsoft Windows the two main filesystems are FAT (File Allocation Table) and NTFS
61
(New Technology File System). Under Ubuntu there are many options including ext2, ext3, reiserfs, xfs and many others. The Ubuntu
60
types, each with their own advantages. With Microsoft Windows the two main filesystems are FAT (File Allocation Table) and NTFS
61
(New Technology File System). With Ubuntu there are many options including ext2, ext3, reiserfs, xfs and many others. The Ubuntu
62
62
installer chooses ext3 by default, but of course it is possible to override this.</para>
63
63
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
64
64
<para>ext3 is a great general purpose journalling filesystem. It is well suited to most tasks, however some users have
72
72
<para>"Mount" is the term used when referring to a filesystem being made available for access. CD and DVDs are usually
73
73
automatically mounted when they are inserted. The same goes for USB connected devices such as memory sticks and hard disks
75
<para>With Ubuntu, files and folders reside within a partition as they do under Microsoft Windows. However the partition is not
75
<para>On Ubuntu, files and folders reside within a partition as they do with Microsoft Windows. However the partition is not
76
76
normally referenced directly by the user. The user would normally say that files are "in my home directory" (when referring
77
77
to /home/< username>), or "in the root directory" (when referring to / ) without specifying which partition on the disk
78
78
those directories reside in.</para>
79
79
<para>Under most standard installations of Ubuntu there will be only one partition where all files and folders
80
80
reside. However if a user plugs in an external USB-connected memory stick or USB hard disk, Ubuntu will mount the
81
81
partition(s) on that device under mount point(s) within the directory tree. For example a USB attached memory stick or
82
hard disk will usually appear under /media/disk (unless the device has partitions which are labelled in which case they
82
hard disk will usually appear under /media/disk (unless the device has partitions which are labelled, in which case they
83
83
will appear under /media/<labelname> )</para>
84
84
<para><emphasis role="strong">Further considerations</emphasis></para>
85
85
<para>As previously mentioned, resizing partitions is not a trivial task. Under most circumstances it requires
86
86
that all filesystems involved are unmounted, this means they must not be in use. Typically then to resize partitions
87
87
the system should be booted to an unused filesystem - such as a bootable Live CD. Considerable thought should therefor be given before partitioning a disk with regards to the number
88
and sizes of partitions to be created to prevent later uncessesary resizing.</para>
88
and sizes of partitions to be created to prevent later unnecessary resizing.</para>
89
89
<caution><title><emphasis role="strong">Caution:</emphasis></title>
90
90
<para>You may run out of hard drive space in your home partition due to the
91
91
sub-division of the drive into fixed-size partitions. This may occur even if
92
the other partitions have plenty of usable space. A good implementation of
93
partitioning requires you to predict how much space each partition needs.</para></caution>
92
the other partitions have plenty of usable space. Good and logical partitioning requires you to predict how much space each partition needs.</para></caution>
94
93
<para>For new users, home users and other single-user set-ups, a single root
95
94
(/) partition with a swap partition would be the easiest and the most convenient
96
95
to create and use. However, for multi-user systems or computers with lots of disk
129
128
<listitem><para>/tmp: This directory contains temporary data created by programs.
130
129
Some applications, including archive manipulators, CD/DVD authoring tools and
131
130
multi-media software also use this directory to temporarily store image files.
132
Based on your usage of these applications, you need to plan space allocation
131
You need to plan space allocation for this directory based on your usage of these applications.
133
132
for this directory.</para></listitem>
134
133
<listitem><para>/usr: This directory contains all user programs (binaries),
135
134
their documentation and supporting libraries. This directory tends to use the
148
147
<title>Creating a Partition</title>
149
148
<para>As mentioned earlier, multiple partitions are very useful especially in cases
150
149
where a partition is corrupted, as it enables you to boot into GNU/Linux to fix the system,
151
without having to reinstall the system. To so this, a root partitionis required. This partition should contain
150
without having to reinstall the system. To do this, a root partition is required. This partition should contain
152
151
the essential components of the system.</para>
153
152
<caution><title><emphasis role="strong">Caution:</emphasis></title>
154
153
<para>The hard disk drive that you are formatting should not contain any
162
161
new operating systems, reorganising disk usage, copying data residing
163
162
on hard disks and mirroring one partition with another (disk
164
163
imaging).</para></listitem>
165
<listitem><para>Command Line: Command Line Interface (CLI) is a method
166
of interacting with an operating system by using a command-line interpreter.
167
The command line is faster and more powerful than GParted. When navigating
164
<listitem><para>Command Line: The command line is faster and more powerful than GParted. When navigating
168
165
through the file system, you can use the command line to jump from one
169
166
directory to another in a split second. Use the command-line interface if
170
167
you are comfortable using the Terminal.</para></listitem>
200
197
<para>Click the <emphasis role="strong">Search</emphasis> button to
201
198
search the package you want to install. The
202
199
<emphasis role="strong">Find</emphasis> dialogue box appears.</para>
203
<instructornote><title>Instructor Notes:</title>
204
<para><emphasis role="italic">If students want to know more about software repositories, you can give them the following information:</emphasis></para>
205
<para><emphasis role="italic">A software repository is a location from where users can download and install packages over the Internet. The Ubuntu software repository contains thousands of packages that are freely available for installation over the Internet. It is easy to install these packages because they are specially built for Ubuntu.</emphasis></para>
207
200
<para>In the <emphasis role="strong">Search</emphasis> field
208
201
of the <emphasis role="strong">Find</emphasis> dialogue box, type the
209
202
name of the package, <emphasis role="strong"> Partition Editor</emphasis>,
433
426
<listitem><para>You can create multiple partitions at this stage by
434
427
following the above-mentioned procedure and then clicking
435
428
<emphasis role="strong">Apply</emphasis> to add them to the hard drive.
436
The <emphasis role="strong">Apply operations to harddisk</emphasis>
429
The <emphasis role="strong">Apply operations to hard disk</emphasis>
437
430
dialogue box appears.</para>
438
431
<figure><title><emphasis role="italic">Applying Pending Operations Box</emphasis></title>
439
432
<mediaobject><imageobject>
441
434
</imageobject></mediaobject>
444
<listitem><para>The <emphasis role="strong">Apply operations to harddisk
437
<listitem><para>The <emphasis role="strong">Apply operations to hard disk
445
438
</emphasis> dialogue box recommends that you back up data before
446
439
performing the changes and seeks your final confirmation before applying
447
440
the changes to the hard disk. Click the <emphasis role="strong">Apply
518
511
<listitem><para>After making the required changes in the
519
512
<emphasis role="strong">Removable Drives and Media Preferences</emphasis>
520
dialogue box, you will notice that Ubuntu does not automount all the
513
dialogue box, you will notice that Ubuntu does not auto-mount all the
521
514
partitions and drives at boot-up.</para>
528
<title>Bootup Options</title>
521
<title>Boot-up Options</title>
529
522
<para>Booting up is a process through which the operating system is loaded into the
530
523
computer's main memory or random access memory (RAM). The boot-up process
531
524
starts when you turn on your computer. During this process, the BIOS takes control of
532
525
your computer and decides where to look for software on the computer and in which
533
526
order. Based on the BIOS settings of your computer, it is decided whether your
534
computer will first check the hard disk or a floppy disk, CD, DVD or flash memory to
527
computer will first check the hard disk or a floppy disc, CD, DVD or flash memory to
535
528
start the booting-up process. In case you have multiple operating systems installed on
536
529
your computer, the BIOS configuration decides which operating system will be loaded
537
530
first at boot-up.</para>
550
543
settings because a wrong setting can prevent your computer from booting-up
552
545
<para>You can also perform these configuration changes by using a command line on your
553
computer's Terminal.</para>
546
computer's terminal.</para>
555
548
<title>Running a System Command Automatically at Start-Up</title>
556
549
<para>At times, you may wish to add a custom command for the start-up process so