1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://docbook.org/xml/4.2/docbookx.dtd">
<chapter>
<title>Partitioning and Booting</title>
<note><title><emphasis role="strong">Note:</emphasis></title>
<para>Partitioning and Booting is an additional section and not an integral part of the desktop course. Many
users, especially corporate desktop users who have system administrators to set up their computers for them
will find this section irrelevant. Home users, or advanced Ubuntu users may find this extremely useful.</para></note>
<para><emphasis role="strong">Objectives</emphasis></para>
<para>In this lesson, you will learn:
<itemizedlist>
<listitem><para>The benefits of partitioning</para></listitem>
<listitem><para>How to create partitions</para></listitem>
<listitem><para>How to configure start-up options</para></listitem>
</itemizedlist>
</para>
<sect1>
<title>What is Partitioning</title>
<para><emphasis role="strong">Analogy Time</emphasis></para>
<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
putting things (like furniture) into it. The partition is the first level of foundation on the disk. Once the disk is logically carved up
into partitions, it can be thought of as a house with rooms. Each partition (room) is of a specific size which could potentially
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
laid down, it's possible to start populating the partition with data in the form of files and folders (furniture).</para>
<para>So, a partition is a logical chunk of space allocated out of the entire disk.
Depending on how a system is configured at installation time, there maybe one or more partitions on a disk.
In some instances, it is also possible to modify the layout, number and size of partitions,
but this is often considered an expert's function.</para>
<para>Many Microsoft Windows users will have just one large partition - often known as "C: drive", however
it is also common for Microsoft Windows users to have multiple partitions which are labelled with successive alphabetic
characters (D:, E: and so on).</para>
<para>Similarly, with Ubuntu it's possible to install the system in exactly one partition on the disk, or
spread data and applications over multiple partitions. </para>
<figure id="fig:partioning"><title><emphasis role="italic">Partitioning</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/partitioning.png" format="PNG" />
</imageobject></mediaobject>
</figure>
<para>There are valid arguments for both scenarios. Having one
single partition with all applications, libraries and data will result in a simple to manage system. It also provides
flexibility as installing applications or adding data will use space from a common "pool". </para>
<note><title><emphasis role="strong">Note:</emphasis></title>
<para>If you accept all the defaults when installing Ubuntu, you will end up with a system comprising
two logical partitions on the disk you install to. One contains all files, the other is known as swap which
can simply be thought of as an extension to the memory in your computer.</para></note>
<para>Alternatively, it is possible to create multiple partitions of differing sizes into which different types of
applications, libraries and data can be placed. This is often used in a multi-user or server environment where user data
is kept separate from system programmes, log files and configuration files. A significant benefit to this can be seen
when there is a problem on the system and log files start to grow. The log files (in one partition) will not consume
all available disk space in this scenario because they will be confined to their own (small) partition of the physical disk. </para>
<para>Which ever partitioning scheme has been chosen, this is not set in stone. It is possible to use a partition editing
utility to resize partitions (subject to sufficient spare space either inside or either side of partitions), however this
is quite an advanced topic.</para>
<note><title><emphasis role="strong">Note:</emphasis></title>
<para>Whilst it is possible to change the disk partitioning layout after the system has been installed, it is important
to make backups before making any changes to the partitions.</para></note>
<para><emphasis role="strong">About filesystems</emphasis></para>
<para>Partitioning a disk is only the beginning. Once the disk has been logically divided up, those partitions need to be
formatted so that the operating system can place files on the disk in a structured manner. There are many different filesystem
types, each with their own advantages. With Microsoft Windows the two main filesystems are FAT (File Allocation Table) and NTFS
(New Technology File System). With Ubuntu there are many options including ext2, ext3, reiserfs, xfs and many others. The Ubuntu
installer chooses ext3 by default, but of course it is possible to override this.</para>
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
<para>ext3 is a great general purpose journalling filesystem. It is well suited to most tasks, however some users have
chosen xfs instead on their media-centre systems as xfs performs better than ext3 when handling very large files - such
as music and video files.</para></tip>
<para><emphasis role="strong">Mount points</emphasis></para>
<para>A mount point is a place in the directory hierarchy where a filesystem could be presented. There is no real Microsoft Windows
equivalent to this. With Microsoft Windows the partitions C:, D: and so on, are seen as entirely separate entities so the operating system,
applications and data is often referred to by a user as being "on the C: drive" or "in a folder on the D: drive".</para>
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
<para>"Mount" is the term used when referring to a filesystem being made available for access. CD and DVDs are usually
automatically mounted when they are inserted. The same goes for USB connected devices such as memory sticks and hard disks
</para></tip>
<para>On Ubuntu, files and folders reside within a partition as they do with Microsoft Windows. However the partition is not
normally referenced directly by the user. The user would normally say that files are "in my home directory" (when referring
to /home/< username>), or "in the root directory" (when referring to / ) without specifying which partition on the disk
those directories reside in.</para>
<para>Under most standard installations of Ubuntu there will be only one partition where all files and folders
reside. However if a user plugs in an external USB-connected memory stick or USB hard disk, Ubuntu will mount the
partition(s) on that device under mount point(s) within the directory tree. For example a USB attached memory stick or
hard disk will usually appear under /media/disk (unless the device has partitions which are labelled, in which case they
will appear under /media/<labelname> )</para>
<para><emphasis role="strong">Further considerations</emphasis></para>
<para>As previously mentioned, resizing partitions is not a trivial task. Under most circumstances it requires
that all filesystems involved are unmounted, this means they must not be in use. Typically then to resize partitions
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
and sizes of partitions to be created to prevent later unnecessary resizing.</para>
<caution><title><emphasis role="strong">Caution:</emphasis></title>
<para>You may run out of hard drive space in your home partition due to the
sub-division of the drive into fixed-size partitions. This may occur even if
the other partitions have plenty of usable space. Good and logical partitioning requires you to predict how much space each partition needs.</para></caution>
<para>For new users, home users and other single-user set-ups, a single root
(/) partition with a swap partition would be the easiest and the most convenient
to create and use. However, for multi-user systems or computers with lots of disk
space, it is best to have the /home, /tmp, /usr and /var directories as individual
partitions separate from the root (/) partition.</para>
<para>Before partitioning your hard drive, you should consider the following:
<itemizedlist>
<listitem><para>root: Also called the slash directory, it is the highest
directory of the directory tree. When creating the root partition, you
need to ensure that the root should contain the /etc, /bin, /sbin, /lib
and /dev directories; else, you will not be able to boot-up the system.
You also need to ensure that the root partition is allocated at least
150-250 MB of disk space.</para></listitem>
<listitem><para>/home: This directory contains all user-specific files and data.
On a multi-user system, every user will store personal data in a subdirectory
of this directory. The size of this directory would depend on the number of users
using the system and the files they store in this directory. Ideally, you should
plan the disk space for this partition based on your planned usage. In general,
about 100-MB disk space can be allocated for each user. However, you may need to
reserve a lot more space if you are planning to save a lot of multi-media files
in your home directory.</para></listitem>
</itemizedlist>
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
<para>It is good practice to have /home on a separate partition because
it allows for a smoother transition from one distribution to another.</para></tip>
<itemizedlist>
<listitem><para>/var: This directory contains variable data, such as news
chapters, e-mails, Web sites, databases and the packaging system cache. The
size of this directory also depends on system usage. Most probably, the size
of this directory would be dictated by your usage of the Ubuntu package
management utilities. If you plan to install all the packages that Ubuntu
offers, you need to allocate 2 to 3 GB of space for the /var directory. However,
if you want to save hard disk space and do not plan any major software updates,
you can get by with as little as 30- or 40-MB disk space for the /var
directory.</para></listitem>
<listitem><para>/tmp: This directory contains temporary data created by programmes.
Some applications, including archive manipulators, CD/DVD authoring tools and
multi-media software also use this directory to temporarily store image files.
You need to plan space allocation for this directory based on your usage of these applications.
for this directory.</para></listitem>
<listitem><para>/usr: This directory contains all user programmes (binaries),
their documentation and supporting libraries. This directory tends to use the
maximum space on the hard disk. Therefore, you should provide at least 500-MB
disk space for this directory. But, you need to increase this space depending
on the number and types of software packages you plan to install. Based on your
planned usage and the available disk space, you may allocate 1.5 to 6 GB of disk
space for this directory.</para></listitem>
</itemizedlist>
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
<para>The /usr partition is sometimes referred to as User System
Resources and not user as was originally intended.</para></tip>
</para>
</sect1>
<sect1>
<title>Creating a Partition</title>
<para>As mentioned earlier, multiple partitions are very useful especially in cases
where a partition is corrupted, as it enables you to boot into GNU/Linux to fix the system,
without having to reinstall the system. To do this, a root partition is required. This partition should contain
the essential components of the system.</para>
<caution><title><emphasis role="strong">Caution:</emphasis></title>
<para>The hard disk drive that you are formatting should not contain any
data. If you have already formatted the drive and it contains data, skip
the partitioning step and move to the next step - mounting.</para></caution>
<para>If the hard disk drive that you want to format is blank and unformatted,
you can use either of the following tools to partition it:
<itemizedlist>
<listitem><para>Partition Editor (GParted): GParted is the
Partition Editor application. GParted is useful for creating space for
new operating systems, reorganising disk usage, copying data residing
on hard disks and mirroring one partition with another (disk
imaging).</para></listitem>
<listitem><para>Command Line: The command line is faster and more powerful than GParted. When navigating
through the file system, you can use the command line to jump from one
directory to another in a split second. Use the command-line interface if
you are comfortable using the Terminal.</para></listitem>
</itemizedlist>
</para>
<para>If you want to create a partition using GParted, you need to first install
GParted by using <emphasis role="strong">Add/Remove Applications</emphasis> or
<emphasis role="strong">Synaptic Package Manager</emphasis>.</para>
<sect2>
<title>Installing GParted by Using Synaptic Package Manager</title>
<para>To install GParted by using Synaptic Package Manager:
<orderedlist numeration="arabic">
<listitem><para>On the <emphasis role="strong">System</emphasis> menu,
point to <emphasis role="strong">Administration</emphasis> and then click
<emphasis role="strong">Synaptic Package Manager</emphasis>. The
<emphasis role="strong">Synaptic Package Manager</emphasis> window
opens.</para>
<figure id="fig:synaptic-loc"><title><emphasis role="italic">Synaptic Package Manager Location</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_001.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>When the <emphasis role="strong">Synaptic Package
Manager</emphasis> window opens for the first time, it displays a
list of all the software packages available in the Ubuntu software
repositories. The left pane lists the various software categories.
You can select a specific category to view the available software
packages listed in that category. Alternatively, you can use the
<emphasis role="strong">Search</emphasis> functionality provided in
the <emphasis role="strong">Synaptic Package Manager</emphasis> to
locate specific software in the list.</para>
<para>Click the <emphasis role="strong">Search</emphasis> button to
search the package you want to install. The
<emphasis role="strong">Find</emphasis> dialogue box appears.</para>
<para>In the <emphasis role="strong">Search</emphasis> field
of the <emphasis role="strong">Find</emphasis> dialogue box, type the
name of the package, <emphasis role="strong"> Partition Editor</emphasis>,
and click the <emphasis role="strong">Search</emphasis> button. The
package, gparted, is now displayed in the right pane of the
<emphasis role="strong">Synaptic Package Manager</emphasis> window.</para>
<para>Right-click the package name to select an action that
you want to perform on it. Notice that various options are available
to perform a number of actions on the selected package. If the selected
package is not installed currently, you can mark it for installation.
Inversely, if the selected package is already marked for installation,
you can unmark it to clear the selection. Similarly, if the package is
already installed, you may select <emphasis role="strong">Upgrade</emphasis>
to upgrade the package and <emphasis role="strong">Mark for Removal</emphasis>
or <emphasis role="strong">Mark for Complete Removal</emphasis> to delete
the package from your computer.</para>
<para>To install the package, select the <emphasis role="strong">Mark for
Installation</emphasis> check box.</para>
<para>The gparted package is now selected for installation.
To continue with the installation, click <emphasis role="strong">Apply</emphasis>.
This displays the <emphasis role="strong">Summary</emphasis> dialogue
box.</para>
<para>The <emphasis role="strong">Summary</emphasis> dialogue
box prompts you to perform a final check before implementing the marked
changes. Click the <emphasis role="strong">Apply</emphasis> button to
apply the marked changes. The <emphasis role="strong">Downloading package
files</emphasis> window opens.</para>
<para>Wait for all the required files to download.
After all the required files in the package are downloaded,
the <emphasis role="strong">Changes applied</emphasis> dialogue
box appears.</para>
<para>The <emphasis role="strong">Changes applied</emphasis>
dialogue box notifies you that all the requested changes have been
applied. Click <emphasis role="strong">Close</emphasis> to exit the
dialogue box.</para>
<figure id="fig:synaptic"><title><emphasis role="italic">Synaptic Package Manager</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_002.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>In the <emphasis role="strong">Search</emphasis> field
of the <emphasis role="strong">Find</emphasis> dialogue box, type the
name of the package, <emphasis role="strong"> Partition Editor</emphasis>,
and click the <emphasis role="strong">Search</emphasis> button. The
package, gparted, is now displayed in the right pane of the
<emphasis role="strong">Synaptic Package Manager</emphasis> window.</para>
<figure id="fig:synaptic-find"><title><emphasis role="italic">Finding a Package in Synaptic</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_003.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>Right-click the package name to select an action that
you want to perform on it. Notice that various options are available
to perform a number of actions on the selected package. If the selected
package is not installed currently, you can mark it for installation.
Inversely, if the selected package is already marked for installation,
you can unmark it to clear the selection. Similarly, if the package is
already installed, you may select <emphasis role="strong">Upgrade</emphasis>
to upgrade the package and <emphasis role="strong">Mark for Removal</emphasis>
or <emphasis role="strong">Mark for Complete Removal</emphasis> to delete
the package from your computer.</para>
<para>To install the package, select the <emphasis role="strong">Mark for
Installation</emphasis> check box.</para>
<figure id="fig:synaptic-mark"><title><emphasis role="italic">Marking a Package for installation</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_004.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The gparted package is now selected for installation.
To continue with the installation, click <emphasis role="strong">Apply</emphasis>.
This displays the <emphasis role="strong">Summary</emphasis> dialogue
box.</para>
<figure><title><emphasis role="italic">Summary Dialog Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_005.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The <emphasis role="strong">Summary</emphasis> dialogue
box prompts you to perform a final check before implementing the marked
changes. Click the <emphasis role="strong">Apply</emphasis> button to
apply the marked changes. The <emphasis role="strong">Downloading package
files</emphasis> window opens.</para>
<figure><title><emphasis role="italic">Applying Changes Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_006.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>Wait for all the required files to download.
After all the required files in the package are downloaded,
the <emphasis role="strong">Changes applied</emphasis> dialogue
box appears.</para>
<figure><title><emphasis role="italic">Changes Applied Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_007.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The <emphasis role="strong">Changes applied</emphasis>
dialogue box notifies you that all the requested changes have been
applied. Click <emphasis role="strong">Close</emphasis> to exit the
dialogue box.</para>
<figure><title><emphasis role="italic">Synaptic Package Manager after Installation</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_008.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The partition editor is installed on your computer.
You can now partition the hard disk drive.</para>
<figure><title><emphasis role="italic">Opening Partition Editor</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_009.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
</orderedlist>
</para>
</sect2>
<sect2>
<title>Partitioning Using Gparted</title>
<para>To partition the hard drive by using GParted:
<orderedlist numeration="arabic">
<listitem><para>On the <emphasis role="strong">System</emphasis> menu,
point to <emphasis role="strong">Administration</emphasis> and then click
<emphasis role="strong"> Partition Editor</emphasis>. The
<emphasis role="strong">GParted</emphasis> window opens.</para>
<tip><title><emphasis role="strong">Nice to Know:</emphasis></title>
<para>GParted is also available from the Live CD.</para></tip>
<figure><title><emphasis role="italic">GParted Window</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_010.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>In the top-right corner of the <emphasis role="strong">GParted</emphasis>
window is the drive drop-down box. You can use this box to select the hard
drive that you need to partition by specifying the logical name you noted
earlier. The Gparted window refreshes and shows you a representation of
the selected drive.</para>
<para>If the existing partitions on the drive have not yet been used, a
white bar would run across the window. However, if the existing
partitions contain some data, the data will be represented by a pale
yellow area.</para>
<instructornote><title>Instructor Notes:</title>
<para><emphasis role="italic">Explain how to read the specifications of the current partitions and file systems.</emphasis></para>
</instructornote>
<para>You can either resize an existing partition or create a
new partition in the unallocated space of the hard drive. Before resizing
an existing partition, you must make sure that you unmount it by
right-clicking the partition and then selecting <emphasis role="strong">Unmount</emphasis>.
Remember that you cannot resize a partition to be smaller than the yellow
area, which represents the data on the partition.</para>
<para>To create a new partition in the unallocated drive space,
right-click the area and select <emphasis role="strong">New</emphasis>
on the short-cut menu. The <emphasis role="strong">Create new
Partition</emphasis> dialogue box appears.</para>
<para>The <emphasis role="strong">Create new Partition</emphasis>
dialogue box allows you to select specifications for the new partition.
Apart from defining the size of the new partition, you can also select
the partition type, whether primary or logical, for the new partition.
In addition, you can even define the file system to be used on the new
partition. By default, Ubuntu uses the ext3 partitions. However, if you
want the new drive to be readable by both Microsoft Windows and Ubuntu without
installing anything extra, you can format it as Fat 32.</para>
<figure><title><emphasis role="italic">Creating a New Partition</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_011.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>You can either resize an existing partition or create a
new partition in the unallocated space of the hard drive. Before resizing
an existing partition, you must make sure that you unmount it by
right-clicking the partition and then selecting <emphasis role="strong">Unmount</emphasis>.
Remember that you cannot resize a partition to be smaller than the yellow
area, which represents the data on the partition.</para>
<para>To create a new partition in the unallocated drive space,
right-click the area and select <emphasis role="strong">New</emphasis>
on the short-cut menu. The <emphasis role="strong">Create new
Partition</emphasis> dialogue box appears.</para>
<figure><title><emphasis role="italic">Create New Partition Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_012.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The <emphasis role="strong">Create new Partition</emphasis>
dialogue box allows you to select specifications for the new partition.
Apart from defining the size of the new partition, you can also select
the partition type, whether primary or logical, for the new partition.
In addition, you can even define the file system to be used on the new
partition. By default, Ubuntu uses the ext3 partitions. However, if you
want the new drive to be readable by both Microsoft Windows and Ubuntu without
installing anything extra, you can format it as Fat 32.</para>
<note><title><emphasis role="strong">Note:</emphasis></title>
<para>If you are creating a partition on a new hard drive, select
Primary Partition. A SCSI or S-ATA hard disk can have a maximum of
4 primary partitions and 11 logical partitions while an integrated
development environment (IDE) hard drive can have up to 63 partitions
overall. The primary partition used to house the logical partitions
is called an extended partition. Unlike primary partitions, logical
partitions must be contiguous: the blocks in the partition are following each other without any gap.</para></note>
<figure><title><emphasis role="italic">Confirmation Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_013.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>In the <emphasis role="strong">New Size (MiB)</emphasis>
field, specify the size of the partition by using the up or down arrow
key. You can also define the size by dragging the black bold arrows on
the top white bar.</para></listitem>
<listitem><para>Select Primary, Logical or Extended partition from the
<emphasis role="strong">Create as</emphasis> drop-down list.</para>
</listitem>
<listitem><para>Next, specify the file system by selecting from the
<emphasis role="strong">Filesystem</emphasis> drop-down list.</para>
</listitem>
<listitem><para>Click the <emphasis role="strong">Add</emphasis> button
to complete the partition. The white bar updates to show a new partition
on the disk.</para></listitem>
<listitem><para>You can create multiple partitions at this stage by
following the above-mentioned procedure and then clicking
<emphasis role="strong">Apply</emphasis> to add them to the hard drive.
The <emphasis role="strong">Apply operations to hard disk</emphasis>
dialogue box appears.</para>
<figure><title><emphasis role="italic">Applying Pending Operations Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_014.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The <emphasis role="strong">Apply operations to hard disk
</emphasis> dialogue box recommends that you back up data before
performing the changes and seeks your final confirmation before applying
the changes to the hard disk. Click the <emphasis role="strong">Apply
</emphasis> button to partition and format the hard disk according to
your specifications.</para>
<figure><title><emphasis role="italic">GParted with New Partition</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_015.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>The system starts applying the changes to the hard disk.
The duration of the operation will depend on the size of the new
partition. When the operation is still running, you can click the
<emphasis role="strong">Details</emphasis> button to view more information
about where and how the changes are being made.</para>
<figure><title><emphasis role="italic">Deleting a Partition</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_016.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>After you receive a message that all the specified
operations have been successfully completed, you can safely close
the window by clicking the <emphasis role="strong">Close</emphasis>
button. However, if something goes wrong and the process does not
complete successfully, you can save the process output for future
reference by clicking the <emphasis role="strong">Save Details</emphasis>
button.</para></listitem>
<listitem><para>The newly created partition is now visible in the
<emphasis role="strong">GParted</emphasis> window. You will also
notice that your system automounts the newly created partition.</para>
<para>Mounting refers to the process of attaching the newly created
partition or drive to an existing directory to make it accessible.
The directory where the new partition is attached is called the mount
point. After the partition is mounted, you can access the files on
that partition by accessing the mount point for the new partition.
Early Linux distributions did not allow the auto-mounting of new partitions
or drives. However, Ubuntu 7.04 and above allow you to easily access
the new partitions by auto-mounting the partitions. When you create a new
partition, the new partition opens as a separate window and the
partition appears as a disk icon on the desktop.</para>
<figure><title><emphasis role="italic">Removable Drives and Media Preferences Dialogue Box</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_017.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>When you no longer want to access the new partitions,
you can unmount them by right-clicking the <emphasis role="strong">disk</emphasis>
icon on the desktop and selecting the <emphasis role="strong">Unmount
Volume</emphasis> option from the short-cut menu.</para>
<figure><title><emphasis role="italic">RC.Local File</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_018.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>If you want to stop Ubuntu from auto-mounting all
the partitions when you boot into your operating system, you can do
so by changing the default configuration settings. To access the
configuration settings for the partitions, on the System menu, point
to <emphasis role="strong">Preferences</emphasis> and click
<emphasis role="strong">Removable Drives and</emphasis>
<emphasis role="strong">Media</emphasis>. The
<emphasis role="strong">Removable Drives and Media Preferences</emphasis>
dialogue box opens.</para>
</listitem>
<listitem><para>To prevent Ubuntu from auto-mounting all the drives,
clear the first three check boxes on the <emphasis role="strong">Removable
Drives and Media Preferences</emphasis> dialogue box and click
<emphasis role="strong">Close</emphasis>.</para>
</listitem>
<listitem><para>After making the required changes in the
<emphasis role="strong">Removable Drives and Media Preferences</emphasis>
dialogue box, you will notice that Ubuntu does not auto-mount all the
partitions and drives at boot-up.</para>
</listitem>
</orderedlist>
</para>
</sect2>
</sect1>
<sect1>
<title>Boot-up Options</title>
<para>Booting up is a process through which the operating system is loaded into the
computer's main memory or random access memory (RAM). The boot-up process
starts when you turn on your computer. During this process, the BIOS takes control of
your computer and decides where to look for software on the computer and in which
order. Based on the BIOS settings of your computer, it is decided whether your
computer will first check the hard disk or a floppy disc, CD, DVD or flash memory to
start the booting-up process. In case you have multiple operating systems installed on
your computer, the BIOS configuration decides which operating system will be loaded
first at boot-up.</para>
<para>Only after all system files have been loaded into the main memory, is the
operating system given control of the computer. The operating system performs the
requested initial commands and then waits for the first interactive user input.</para>
<para>However, as a superuser or user with administrative privileges, it is possible
for you to change the boot-up configuration to define the computer's boot order,
change the default operating system to boot-up or make a system command run
automatically at boot-up.</para>
<para>One way to change or check your BIOS setting is to restart your computer, and
press a key to enter the setup function before it starts to load any operating system.
Generally, you can do this by pressing F1, F2, ESC or DELETE. Once you are inside the
BIOS setup, you can make the desired changes by following the instructions for using
the setup. However, you need to be very cautious when making any changes in the BIOS
settings because a wrong setting can prevent your computer from booting-up
properly.</para>
<para>You can also perform these configuration changes by using a command line on your
computer's terminal.</para>
<sect2>
<title>Running a System Command Automatically at Start-Up</title>
<para>At times, you may wish to add a custom command for the start-up process so
that your computer executes this command every time it boots up. To run a system
command automatically at start-up:
<orderedlist numeration="arabic">
<listitem><para>On the Terminal, type the following command to open the
rc.local file:</para>
<screen>$ sudo nano /etc/rc.local</screen>
<figure><title><emphasis role="italic">Terminal Window</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_019.png" format="PNG" />
</imageobject></mediaobject>
</figure>
<para>The rc.local file contains a script that is executed after all the
other initial scripts. You can insert your own initialisation scripts in
this file if you want some services to be executed automatically during
the start-up process.</para>
</listitem>
<listitem><para>The rc.local file opens in the Terminal window.
Type the command that you want to run at system start-up before
the line, exit 0.</para>
<screen>$ date > /home/oem/newbackup</screen>
<figure><title><emphasis role="italic">Making Settings for rc.local File</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_020.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>After you enter the command you want executed at system
start-up, press CTRL+X to save and exit the edited file.</para>
<figure><title><emphasis role="italic">Services Window</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_021.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
<listitem><para>When you reboot the system, the rc.local file executes.
If you want to display the output of the above command, type the
following command in the Terminal:</para>
<screen>$ cat newbackup</screen>
<para>The following image shows the output of the above command:</para>
</listitem>
</orderedlist>
</para>
</sect2>
<sect2>
<title>Changing the Default Operating System at Boot</title>
<para>When multiple operating systems are installed on a computer, this is
referred to as a multi-boot configuration. Typically, the operating system
that is listed on top in the configuration file is loaded on the computer.
To choose the operating system that starts when you turn on your computer,
edit the grub configuration file.
<orderedlist numeration="arabic">
<listitem><para>Back up the configuration file, and open it in a text
editor, as follows:</para>
<screen>
$ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
$ sudo gedit /boot/grub/menu.lst</screen>
</listitem>
<listitem><para>Find the line written below to change the default sequence:</para>
<screen>
...
default 0
...</screen>
<para>Replace this line with the following line:</para>
<screen>default X</screen>
<para>Replace X with a number based on the order in which your operating
systems appear in the configuration file. You should start counting from
0. For example, if you wish the default operating system to be the first
in the list, replace X with 0; and if you wish the default operating
system to be the second in the list, replace X with 1.</para>
</listitem>
<listitem><para>Point to saved and save default to reboot the last OS
chosen.</para></listitem>
</orderedlist>
</para>
</sect2>
<sect2>
<title>Configuring Start-Up Services</title>
<para>When Ubuntu starts up, many services are started for your convenience. Some
services are mandatory for Ubuntu to work properly on your computer. Others can
include services that you'll probably never need or want, either because you just
do not want them (for example, ntpdate, which sets your system time from a time
server) or you simply don't have the device (for example, the HP printing and
scanning system, which is of no use if you don't own a HP device).</para>
<para>Although these services are harmless, they increase your computer's start-up
time. By de-activating some of these services, you should get a slightly faster
start-up time.</para>
<caution><title><emphasis role="strong">Caution:</emphasis></title>
<para>Read the service information before you disable any service because
disabling some services may stop your system from booting-up or running
properly.</para></caution>
<para>To configure the start-up services, you need to have administrative
privileges. Then, perform the following steps:
<orderedlist numeration="arabic">
<listitem><para>On the <emphasis role="strong">System</emphasis> menu,
point to <emphasis role="strong">Administration</emphasis> and then
click <emphasis role="strong">Services</emphasis>.</para></listitem>
<listitem><para>Type your administrative password. The
<emphasis role="strong">Services settings</emphasis> window
opens.</para></listitem>
<listitem><para>Select the services you want running by selecting or
clearing the respective check boxes and click <emphasis role="strong">OK</emphasis>.
</para>
<figure><title><emphasis role="italic">Services Settings Window</emphasis></title>
<mediaobject><imageobject>
<imagedata fileref="images/Lesson11_images_022.png" format="PNG" />
</imageobject></mediaobject>
</figure>
</listitem>
</orderedlist>
</para>
<instructornote><title>Instructor Notes:</title><para><emphasis role="italic">If you want greater control over the boot-up
services, install Boot-up Manager (bum). You can install bum from the Universe
repository. You need to click the <emphasis role="strong">System</emphasis> menu,
point to <emphasis role="strong">Administration</emphasis> and click
<emphasis role="strong">Boot-up Manager</emphasis>.</emphasis></para>
</instructornote>
</sect2>
</sect1>
<sect1>
<title>Lesson Summary</title>
<para>In this lesson, you learned that:
<itemizedlist>
<listitem><para>Partitioning your hard disk is similar to splitting rooms with walls in a house.</para></listitem>
<listitem><para>You can run Ubuntu on a single or multiple partitions or drives.</para></listitem>
<listitem><para>Before partitioning the hard drive, you should make sure
that there is no data on the hard drive. If the hard drive on which you
are creating a partition contains data and you wish to preserve it, it
will be safer to back up the data before proceeding.</para></listitem>
<listitem><para>You can create a partition by using both the partition
editor and the command-line interface.</para></listitem>
<listitem><para>It is possible for you to change the boot-up configuration
to define the computer's boot order, change the default operating system to
boot or make a system command run automatically at boot-up.</para></listitem>
<listitem><para>To run a set of commands each time the system boots up, you
need to include the commands in the /etc/rc.local file so that the computer
executes them automatically at every boot-up.</para></listitem>
<listitem><para>You can change the default operating system at boot by making
changes in the configuration file.</para></listitem>
<listitem><para>You must read the service information before disabling any
service because disabling some services may stop your system from booting-up
or running properly.</para></listitem>
</itemizedlist>
</para>
</sect1>
<questions>
<sect1>
<title>Review Exercise</title>
<para><emphasis role="strong">Question 1</emphasis></para>
<para>What are the advantages of partitioning?</para>
<answer>
<para><emphasis role="strong">Answer 1</emphasis></para>
<para>The following are the advantages of partitioning:
<orderedlist numeration="loweralpha">
<listitem><para>Minimises data loss</para></listitem>
<listitem><para>Enhances security</para></listitem>
<listitem><para>Enhances performance</para></listitem>
</orderedlist>
</para>
</answer>
<para><emphasis role="strong">Question 2</emphasis></para>
<para>Why do you need to use the sudo command?</para>
<answer>
<para><emphasis role="strong">Answer 2</emphasis></para>
<para>In Unix-based operating systems, you need to use the sudo command to run
programmes that require administrative privileges.</para>
</answer>
<para><emphasis role="strong">Question 3</emphasis></para>
<para>Which of these file systems does Ubuntu use by default?</para>
<orderedlist numeration="loweralpha">
<listitem><para>Fat 32</para></listitem>
<listitem><para>NTFS</para></listitem>
<listitem><para>Ext3</para></listitem>
</orderedlist>
<answer>
<para><emphasis role="strong">Answer 3</emphasis></para>
<para>b) ext2</para>
</answer>
<para><emphasis role="strong">Question 4</emphasis></para>
<para>If you want to run a system command automatically at start-up,
where should you add the command?</para>
<answer>
<para><emphasis role="strong">Answer 4</emphasis></para>
<para>The command needs to be added to the /etc/rc.local file.</para>
</answer>
<para><emphasis role="strong">Question 5</emphasis></para>
<para>Is it possible to disable all the start-up services? Why?</para>
<answer>
<para><emphasis role="strong">Answer 5</emphasis></para>
<para>No, it is not possible to disable all start-up services because
disabling some services will stop your system from booting-up or running
properly.</para>
</answer>
</sect1>
</questions>
<sect1>
<title>Lab Exercise</title>
<para><emphasis role="strong">Exercise 1</emphasis></para>
<para>As a previous Microsoft Windows user, you want to have a dual-boot configuration
on your computer and create a separate partition to run Microsoft Windows on it. To
perform this task, you need to create a 5-GB primary partition and
format it with a Microsoft Windows-compatible file system.</para>
<para>Option a: To create a Partition using Partition Editor:
<orderedlist numeration="arabic">
<listitem><para>On the <emphasis role="strong">System</emphasis> menu,
point to <emphasis role="strong">Administration</emphasis> and then click
<emphasis role="strong"> Partition Editor</emphasis>.</para></listitem>
<listitem><para>In the drive drop-down box, select the hard drive you need
to partition by specifying its logical name. The window refreshes and shows
you a representation of the drive.</para></listitem>
<listitem><para>Right-click the white bar and click
<emphasis role="strong">New</emphasis> to create a new partition.
The <emphasis role="strong">Create new Partition</emphasis> dialogue box
appears, in which you choose the specifications of the new
partition.</para></listitem>
<listitem><para>In the <emphasis role="strong">New Size</emphasis> dialogue
box, select the size of the new partition.</para></listitem>
<listitem><para>In the <emphasis role="strong">Create as</emphasis> box,
select <emphasis role="strong">Primary Partition</emphasis>.</para></listitem>
<listitem><para>Next, specify the file system. Select ntfs.</para></listitem>
<listitem><para>Click <emphasis role="strong">Add</emphasis> to compute the
partition. The graphical display updates to show a new partition on the disk.
</para></listitem>
<listitem><para>If you are sure about the specification of the new partition,
click <emphasis role="strong">Apply</emphasis>. The disk will be partitioned
and formatted.</para></listitem>
</orderedlist>
</para>
</sect1>
</chapter>
|