~gumara/ubuntu-desktop-course/ubuntu-desktop-course-th-gumara

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
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://docbook.org/xml/4.3/docbookx.dtd">
<chapter>
  <title>Partitioning and Booting</title>

  <note>
    <title>Note:</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>

  <formalpara>
    <title>Objectives</title>

    <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>
  </formalpara>

  <sect1>
    <title>What is Partitioning</title>

    <formalpara>
      <title>Analogy Time</title>

      <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>
    </formalpara>

    <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 may be 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 float="0" id="fig-partioning">
      <title>Partitioning</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/partitioning.png" width="4cm" 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>Note:</title>

      <para>If you accept all the defaults when installing Ubuntu, you will
      end up with a system comprising of two logical partitions on the disk.
      One contains all files, the other is known as "swap" which can be
      thought of as an extension to your computer memory.</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 free space in each partition), however
    this is quite an advanced topic.</para>

    <note>
      <title>Note:</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>

    <formalpara>
      <title>About filesystems</title>

      <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>
    </formalpara>

    <tip>
      <title>Nice to Know:</title>

      <para>ext3 is a great general purpose journalling filesystem. It handles
      most tasks well however, xfs is sometimes chosen instead on media-centre
      systems as it performs better when handling very large files - such as
      music and video files.</para>
    </tip>

    <formalpara>
      <title>Mount points</title>

      <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>
    </formalpara>

    <tip>
      <title>Nice to Know:</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 typically say that files are "in my
    home directory" (when referring to /home/&lt; username&gt;), 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/&lt;labelname&gt;
    )</para>

    <formalpara>
      <title>Further considerations</title>

      <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>
    </formalpara>

    <caution>
      <title>Caution:</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, otherwise 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 sub-directory 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>Nice to Know:</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>Nice to Know:</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>Caution:</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 useful for creating
          space for new operating systems, re-organising 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>

      <procedure>
        <title>To install GParted by using Synaptic Package Manager:</title>

        <step performance="required">
          <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 float="0" id="fig-synaptic-loc">
            <title>Synaptic Package Manager Location</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_001.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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. 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 float="0" id="fig-synaptic">
            <title>Synaptic Package Manager</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_002.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0" id="fig-synaptic-find">
            <title>Finding a Package in Synaptic</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_003.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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. 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 float="0" id="fig-synaptic-mark">
            <title>Marking a Package for installation</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_004.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Summary Dialog Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_005.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Applying Changes Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_006.png" width="7cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Changes Applied Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_007.png" width="7cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Synaptic Package Manager after Installation</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_008.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <para>The partition editor is installed on your computer. You can
          now partition the hard disk drive.</para>

          <figure float="0">
            <title>Opening Partition Editor</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_009.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>
      </procedure>
    </sect2>

    <sect2>
      <title>Partitioning Using Gparted</title>

      <procedure>
        <title>To partition the hard drive by using GParted:</title>

        <step performance="required">
          <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>Nice to Know:</title>

            <para>GParted is also available from the Live CD.</para>
          </tip>

          <figure float="0">
            <title>GParted Window</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_010.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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>

          <note userlevel="instructor">
            <title>Instructor Notes:</title>

            <para>Explain how to read the specifications of the current
            partitions and file systems.</para>
          </note>

          <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 enables 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 float="0">
            <title>Creating a New Partition</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_011.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Create New Partition Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_012.png" width="8cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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>Note:</title>

            <para>If you are creating a partition on a new hard drive, select
            Primary Partition. An 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 float="0">
            <title>Confirmation Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_013.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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>
        </step>

        <step performance="required">
          <para>Select Primary, Logical or Extended partition from the
          <emphasis role="strong">Create as</emphasis> drop-down list.</para>
        </step>

        <step performance="required">
          <para>Next, specify the file system by selecting from the <emphasis role="strong">Filesystem</emphasis> drop-down list.</para>
        </step>

        <step performance="required">
          <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>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Applying Pending Operations Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_014.png" width="7cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>GParted with New Partition</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_015.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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. You can click the <emphasis role="strong">Details</emphasis> button to view more information
          about where and how changes are being made, whilst the operation is
          running.</para>

          <figure float="0">
            <title>Deleting a Partition</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_016.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <para>Once 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>
        </step>

        <step performance="required">
          <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, from Ubuntu 7.04, you can
          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 float="0">
            <title>Removable Drives and Media Preferences Dialogue Box</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_017.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>RC.Local File</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_018.png" width="8cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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>
        </step>

        <step performance="required">
          <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>
        </step>

        <step performance="required">
          <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>
        </step>
      </procedure>
    </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.Your computer's BIOS settings determine
    whether your computer will first check the hard disk or a floppy disc, CD,
    DVD or flash memory to start the booting-up process. If you have multiple
    operating systems installed on your computer, the BIOS configuration
    determines 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.</para>

      <procedure>
        <title>To run a system command automatically at start-up:</title>

        <step performance="required">
          <para>On the Terminal, type the following command to open the
          rc.local file:</para>

          <screen format="linespecific">$ sudo nano
          /etc/rc.local</screen>

          <figure float="0">
            <title>Terminal Window</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_019.png" width="8cm" 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>
        </step>

        <step performance="required">
          <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 format="linespecific">$ date &gt;
          /home/oem/newbackup</screen>

          <figure float="0">
            <title>Making Settings for rc.local File</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_020.png" width="9cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 float="0">
            <title>Services Window</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_021.png" width="11cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>

        <step performance="required">
          <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 format="linespecific">$ cat newbackup</screen>

          <para>The following image shows the output of the above
          command:</para>
        </step>
      </procedure>
    </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.</para>

      <procedure>
        <step performance="required">
          <para>Back up the configuration file, and open it in a text editor,
          as follows:</para>

          <screen format="linespecific">$ sudo cp
          /boot/grub/menu.lst /boot/grub/menu.lst_backup $ sudo
          gedit /boot/grub/menu.lst</screen>
        </step>

        <step performance="required">
          <para>Find the line written below to change the default
          sequence:</para>

          <screen format="linespecific">... default 0 ...</screen>

          <para>Replace this line with the following line:</para>

          <screen format="linespecific">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>
        </step>

        <step performance="required">
          <para>Point to saved and save default to reboot the last OS
          chosen.</para>
        </step>
      </procedure>
    </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 are services that you'll probably never need,
      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 an 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>Caution:</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:</para>

      <procedure>
        <step performance="required">
          <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>
        </step>

        <step performance="required">
          <para>Type your administrative password. The <emphasis role="strong">Services settings</emphasis> window opens.</para>
        </step>

        <step performance="required">
          <para>Select the services you want running by selecting or clearing
          the respective check boxes and click <emphasis role="strong">OK</emphasis>.</para>

          <figure float="0">
            <title>Services Settings Window</title>

            <mediaobject>
              <imageobject>
                <imagedata fileref="images/Lesson11_images_022.png" width="6cm" format="PNG"/>
              </imageobject>
            </mediaobject>
          </figure>
        </step>
      </procedure>

      <note userlevel="instructor">
        <title>Instructor Notes:</title>

        <para>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>.</para>
      </note>
    </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>

  <sect1 role="questions">
    <title>Review Exercise</title>

    <qandaset>
      <qandaentry>
        <question>
          <para>What are the advantages of partitioning?</para>
        </question>

        <answer>
          <para>The following are the advantages of partitioning:</para>

          <itemizedlist>
            <listitem>
              <para>Minimises data loss</para>
            </listitem>

            <listitem>
              <para>Enhances security</para>
            </listitem>

            <listitem>
              <para>Enhances performance</para>
            </listitem>
          </itemizedlist>
        </answer>
      </qandaentry>

      <qandaentry>
        <question>
          <para>Why do you need to use the sudo command?</para>
        </question>

        <answer>
          <para>In Unix-based operating systems, you need to use the sudo
          command to run programmes that require administrative
          privileges.</para>
        </answer>
      </qandaentry>

      <qandaentry>
        <question>
          <para>Which of these file systems does Ubuntu use by default?</para>

          <itemizedlist>
            <listitem>
              <para>Fat 32</para>
            </listitem>

            <listitem>
              <para>NTFS</para>
            </listitem>

            <listitem>
              <para>Ext3</para>
            </listitem>
          </itemizedlist>
        </question>

        <answer>
          <para>b) ext2</para>
        </answer>
      </qandaentry>

      <qandaentry>
        <question>
          <para>If you want to run a system command automatically at start-up,
          where should you add the command?</para>
        </question>

        <answer>
          <para>The command needs to be added to the /etc/rc.local
          file.</para>
        </answer>
      </qandaentry>

      <qandaentry>
        <question>
          <para>Is it possible to disable all the start-up services?
          Why?</para>
        </question>

        <answer>
          <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>
      </qandaentry>
    </qandaset>
  </sect1>

  <sect1>
    <title>Lab Exercise</title>

    <formalpara>
      <title>Exercise 1</title>

      <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>
    </formalpara>

    <procedure>
      <title>Option a: To create a Partition using Partition Editor:</title>

      <step performance="required">
        <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>
      </step>

      <step performance="required">
        <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>
      </step>

      <step performance="required">
        <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>
      </step>

      <step performance="required">
        <para>In the <emphasis role="strong">New Size</emphasis> dialogue box,
        select the size of the new partition.</para>
      </step>

      <step performance="required">
        <para>In the <emphasis role="strong">Create as</emphasis> box, select
        <emphasis role="strong">Primary Partition</emphasis>.</para>
      </step>

      <step performance="required">
        <para>Next, specify the file system. Select ntfs.</para>
      </step>

      <step performance="required">
        <para>Click <emphasis role="strong">Add</emphasis> to compute the
        partition. The graphical display updates to show a new partition on
        the disk.</para>
      </step>

      <step performance="required">
        <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>
      </step>
    </procedure>
  </sect1>
</chapter>