0% found this document useful (0 votes)
50 views28 pages

Linux Chapter 6

Uploaded by

jamespromiii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views28 pages

Linux Chapter 6

Uploaded by

jamespromiii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Book Title: eTextbook: COMPTIA Linux Guide to Linux Certification

Chapter 6. Linux Server Deployment


Hands-On Projects

Hands-On Projects
These projects should be completed in the order given. The hands-on projects

presented in this chapter should take a total of three hours to complete. The

requirements for this lab include:

A computer with Fedora 28 installed according to Hands-On Project 2-1

The ISO image for Ubuntu Server 18.04 installation media (ubuntu-
18.04.1-live-server-amd64.iso)

The ISO image for Ubuntu Server 14.04 LTS installation media (ubuntu-

14.04.5-server-amd64.iso)

Project 6-1
In this hands-on project, you install Ubuntu Server 18.04 Linux within a virtual
machine on a Windows computer and examine the LVM partition

configuration afterwards.
In your virtualization software, create a new virtual machine
1
called Ubuntu Server 18 that has the following characteristics:

a. 2GB of memory

b. An Internet connection via your PC’s network card

(preferably using an external virtual switch or bridged


mode)

c. A 50GB SATA/SCSI/SAS virtual hard disk (dynamically


allocated)

d. The virtual machine DVD drive attached to the ISO file for
the Ubuntu Server 18.04 installation media (ubuntu-
18.04.1-live-server-amd64.iso)

Start and then connect to your Ubuntu Server Linux virtual


2
machine using your virtualization software.

Note

The Ubuntu Server Linux installation program does not use a graphical
desktop. As a result, you must switch between buttons shown on the

screen using the Tab key and then press Enter to make your selections.

At the Welcome screen, ensure that English is selected and press


3
Enter.

At the Keyboard configuration screen, select the correct keyboard


4
layout and select Done. For most keyboards this layout will be

English (US).
At the Ubuntu 18.04 welcome screen, examine the options. Note
5
that Ubuntu allows you the option to install in a small footprint

Type 1 hypervisor configuration designed to host virtual machines


within a cloud environment that they’ve called Metal as a Service
(MaaS); you will install a full Ubuntu Server installation instead.

Ensure that Install Ubuntu is selected and press Enter.

326
At the Network connections screen, note that your network
6
interface is set to obtain an IP address from a DHCP server by
default and select Done.

At the Configure proxy screen, optionally supply the URL address


7
of your classroom proxy (if your classroom uses one), and select
Done.

At the Configure Ubuntu archive mirror screen, select Done.


8
At the Filesystem setup screen, select Use Entire Disk And Set Up
9
LVM, and then select your 50GB virtual hard disk. Note that the

installation program will create a partition for the /boot filesystem


(as well as a GPT BIOS boot partition, or partition for the /boot/efi
filesystem, if applicable), as well as an LVM PV for the remainder
of the hard drive that is part of the ubuntu-vg VG. Also note that
there is a single 4GB ubuntu-lv LV created for the / filesystem.

a. Navigate to the ubuntu-lv LV, press Enter, and select Edit.


Change the name of this LV to ubuntu-lv-root and the size
to 44.000G, and then select Save.

b. Navigate to the ubuntu-vg VG, press Enter, and select

Create Logical Volume. Change the name of this LV to


ubuntu-lv-swap and the size to 4.000G. Select a format of
swap and then select Create.

c. Select Done and then select Continue when prompted to


complete the disk configuration.

At the Profile setup screen, supply the following information and


10
select Done when finished:

a. Your name = supply your real name

b. Your server’s name = ubuntu18

c. Username = user1

d. Password = LINUXrocks!

At the Featured Server Snaps screen, select Done.


11
At the Install complete screen, select Reboot Now. When
12
prompted to remove your installation medium, use your
virtualization software to disconnect your Ubuntu Server 18 ISO

(ubuntu-18.04.1-live-server-amd64.iso) from the virtual DVD drive


and press Enter.

After the system has booted, note that a graphical login is not
13
available. Log into tty1 as user1 with the password LINUXrocks!.

At the command prompt, type sudo passwd root and press Enter
14
to set the root user password. When prompted, enter your

password (LINUXrocks!), and then enter the desired root


password of LINUXrocks! twice to set the root user password to
LINUXrocks!.

At the command prompt, type su - and press Enter to switch to the


15
root user. Supply the root user password (LINUXrocks!) when

prompted.
At the command prompt, type the following commands in turn
16
and press Enter. Examine the output of each one:

a. df -hT

b. fdisk -l

c. lvdisplay

d. lsblk

e. blkid

f. ls -l /dev/disk/by-uuid

g. ls -l /dev/disk/by-partuuid

h. ls -l /dev/disk/by-id

i. ls -l /dev/disk/by-path

j. cat /etc/fstab

327
Type exit and press Enter to log out of your shell.
17

Project 6-2
In this hands-on project, you add hard disks to your Ubuntu Server 18 virtual
machine, configure a software RAID 5 volume, and simulate a hard disk failure
and recovery. At the end of this project, you will remove your RAID
configuration.

On your Ubuntu Server 18 virtual machine, log into the command-


1
line terminal (tty1) using the user name of root and the password
of LINUXrocks!.
At the command prompt, type poweroff and press Enter to power
2
down your virtual machine. In your virtualization software, add
four new 1GB dynamically allocated SATA/SAS virtual hard disks
to your virtual machine configuration. When finished, boot your
Ubuntu Server 18 virtual machine.

After your Ubuntu Server 18 virtual machine has booted, log into
3
the command-line terminal (tty1) using the user name of root and
the password of LINUXrocks!.

At the command prompt, type lsblk and press Enter. Note that the
4
names of the additional disk devices are sdb, sdc, sdd, and sde.

At the command prompt, type mdadm --create /dev/md0 --level=5


5
--raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sdd --verbose

and press Enter.

At the command prompt, type cat /proc/mdstat and press Enter.


6
Was your RAID 5 volume created successfully?

At the command prompt, type cat /etc/mdadm/mdadm.conf and


7
press Enter. Is your RAID 5 volume listed within this configuration
file by default?

At the command prompt, type mdadm --detail --scan --verbose


8
>/etc/mdadm/mdadm.conf and press Enter. Next, type cat
/etc/mdadm/mdadm.conf and press Enter and view your startup
configuration.

At the command prompt, type mkfs -t ext4 /dev/md0 and press


9
Enter to format your RAID 5 volume with the ext4 filesystem.
At the command prompt, type mkdir /data and press Enter to
10
create a mount point for your RAID 5 volume, and then type

mount /dev/md0 /data and press Enter to mount your RAID 5


volume to it.

328
At the command prompt, type cp /etc/hosts /data and press Enter.
11
Next, type ls -F /data and press Enter to verify that the hosts file
was copied to your filesystem. What other directory was created
on this filesystem and why?

At the command prompt, type df -hT and press Enter. What is the
12
total size of your RAID 5 volume? Why is it not 4GB (4 x 1GB
disks)?

At the command prompt, type lsblk and press Enter. Note the md0
13
device associations for each of your disks. Next, type blkid and
press Enter. Does /dev/md0 have a filesystem UUID that can be
used within /etc/fstab to automount the RAID volume at boot time?

At the command prompt, type mdadm --detail /dev/md0 and


14
press Enter. Are all of your four devices within the RAID volume
active and working?

At the command prompt, type mdadm --manage --set-faulty


15
/dev/md0 /dev/sdc and press Enter to simulate disk corruption on
/dev/sdc. Next, type mdadm --detail /dev/md0 and press Enter to
view the failed device. Also note that the state of the RAID volume
is listed as clean (working) and degraded (not fully functional).

Type ls -F /data and press Enter. Are your files still available and
16
accessible? Why?
At the command prompt, type mdadm --manage /dev/md0 -r
17
/dev/sdc and press Enter to remove the /dev/sdc device from the
RAID volume. In a production environment, this is when you
would physically remove the hard disk from the server and
replace it with a working one.

At the command prompt, type mdadm --manage /dev/md0 -a


18
/dev/sdc and press Enter to add the /dev/sdc device to the RAID

volume again. Next, type mdadm --detail /dev/md0 and press


Enter. Note that the state of the drive is listed as spare rebuilding
as the RAID volume is rebuilding the data on this drive. After a few
minutes, rerun your previous command. The state should list
active sync, which indicates that the newly added device is now
fully functional and part of your RAID volume.

At the command prompt, type umount /data and press Enter to


19
unmount your RAID volume. Next, type mdadm --stop /dev/md0
and press Enter to remove your RAID volume.

At the command prompt, type fdisk /dev/sdb and press Enter.


20
Next, type w and press Enter to save your changes, which will
remove the existing RAID signature from the /dev/sdc device file.
Repeat this step three more times for /dev/sdc, /dev/sdd, and
/dev/sde.

Finally, type rm -f /etc/mdadm/mdadm.conf to remove the RAID


21
configuration file.

Type exit and press Enter to log out of your shell.


22

Project 6-3
In this hands-on project, you install and configure the ZFS filesystem on your
Ubuntu Server 18 virtual machine. At the end of this project, you will remove
your ZFS configuration.

On your Ubuntu Server 18 virtual machine, log into the command-


1
line terminal (tty1) using the user name of root and the password
of LINUXrocks!.

329
At the command prompt, type the following commands (in order)
2
to add software repositories and install ZFS support on your
Ubuntu system:

a. apt-get update

b. add-apt-repository main

c. add-apt-repository restricted

d. add-apt-repository universe

e. add-apt-repository multiverse

f. apt-get install zfsutils-linux

Note

Ubuntu Server Linux uses a different package manager than Fedora Linux.
The apt-get command is functionally equivalent to the dnf command that

you used in previous chapters to download and install software from


Internet repositories. Both apt-get and dnf are discussed in Chapter 11.
At the command prompt, type zpool create data /dev/sdb -f and
3
press Enter to create a simple ZFS volume called data from the
space on /dev/sdb (the -f option is necessary because /dev/sdb still
has a RAID signature from Project 6-2). Next, type zpool list at the
command prompt and press Enter to view your configuration.

At the command prompt, type df -hT and press Enter. Note that
4
the data ZFS volume was mounted to /data automatically. Next,
type lsblk at the command prompt and press Enter. Note that ZFS
created a single partition for the data (/dev/sdb1) as well as a

partition for the ZFS configuration (/dev/sdb9).

At the command prompt, type cp /etc/hosts /data and press Enter


5
to copy the /etc/hosts file to the new ZFS filesystem. Next, type ls -F
/data to verify that the hosts file was copied successfully.

At the command prompt, type zpool destroy data and press Enter
6
to remove the data volume.

At the command prompt, type zpool create data mirror /dev/sdb


7
/dev/sdc -f and press Enter to create a mirrored ZFS volume called
data from the space on /dev/sdb and /dev/sdc that is mounted to
the /data directory. Next, type zpool list at the command prompt
and press Enter to view your configuration. Following this, type

zpool status data at the command prompt and press Enter. Does
your mirror have any problems listed?

At the command prompt, type lsblk at the command prompt and


8
press Enter. Note that ZFS created partitions for the data on each
hard disk (/dev/sdb1 and /dev/sdc1) as well as partitions for the
ZFS configuration (/dev/sdb9 and /dev/sdc9).
At the command prompt, type dd if=/dev/zero of=/dev/sdb1
9
count=100 and press Enter to overwrite a portion of /dev/sdb1
using the dd command, simulating disk corruption. Next, type
zpool scrub data at the command prompt and press Enter to
update the status of the ZFS filesystem, and then type zpool status
data at the command prompt and press Enter. Does your mirror
have any problems listed?

330
At the command prompt, type zpool detach data /dev/sdb and
10
press Enter to remove the bad disk (/dev/sdb) from the mirror.

Type zpool status data at the command prompt and press Enter
to verify that it is no longer listed.

At the command prompt, type zpool attach data /dev/sdc


11
/dev/sdd -f and press Enter to mirror the data on /dev/sdc to a new
disk (/dev/sdd), and then type zpool status data at the command
prompt and press Enter. Is the mirror fully functional using
/dev/sdc and /dev/sdd?

At the command prompt, type zpool iostat -v data and press


12
Enter to view the input and output statistics for your mirror. Next,
type zpool destroy data and press Enter to remove the data
mirror.

At the command prompt, type zpool create data raidz /dev/sdb


13
/dev/sdc /dev/sdd /dev/sde -f and press Enter to create a RAID-Z
volume called data using /dev/sdb, /dev/sdc, /dev/sdd, and /dev/sde,
and then type zpool status data at the command prompt and
press Enter to verify the results. Next, type zpool iostat -v data
and press Enter to view the input and output statistics for your
RAID-Z volume.
At the command prompt, type each of the following commands in
14
turn and press Enter to create three subdirectories under /data:

mkdir /data/webstorage

mkdir /data/databases

mkdir /data/filestorage

At the command prompt, type zfs list and press Enter. Are the
15
webstorage, databases, and filestorage directories listed? Why?
Next, type each of the following commands in turn and press Enter
to create three subfilesystems for each of these directories:

zfs create data/webstorage

zfs create data/databases

zfs create data/filestorage

At the command prompt, type zfs list and press Enter. Are the
16
webstorage, databases, and filestorage directories listed? Why?

At the command prompt, type zfs get all data/webstorage and


17
press Enter to view the available options for the webstorage
subfilesystem. Next, type zfs set quota=1G data/webstorage at
the command prompt and press Enter to set a quota of 1GB for the
subfilesystem. Next, type zfs set compression=lz4
data/webstorage at the command prompt and press Enter to
enable automatic lz4 compression for files stored within the
subfilesystem. Finally, type zfs get all data/webstorage and press
Enter to verify that your settings were changed.

At the command prompt, type zpool destroy data and press Enter
18
to remove the data volume.
At the command prompt, type fdisk /dev/sdb and press Enter.
19
Next, type d and press Enter and Enter again to delete the ZFS
configuration partition. Next, type d and press Enter to delete the
ZFS data partition. Finally, type w and press Enter to save your
changes. Repeat this step three more times for /dev/sdc, /dev/sdd,
and /dev/sde.

331
Type exit and press Enter to log out of your shell.
20

Project 6-4
In this hands-on project, you configure the BTRFS filesystem on your Ubuntu
Server 18 virtual machine. At the end of this project, you will remove your
BTRFS configuration.

On your Ubuntu Server 18 virtual machine, log into the command-


1
line terminal (tty1) using the user name of root and the password
of LINUXrocks!.

At the command prompt, type mkfs.btrfs -m raid0 -d raid0


2
/dev/sdb /dev/sdc /dev/sdd -f and press Enter to create a RAID 0
BTRFS volume that spans the three disks (the -f option is necessary
because /dev/sdb, /dev/sdc, and /dev/sdd still have a ZFS signature
from Project 6-3). Note from the output that the system
configuration, data, and filesystem metadata are not fault tolerant
(RAID 0). Next, type btrfs filesystem show /dev/sdb and press
Enter. Note the output.

At the command prompt, type mount /dev/sdb /data and press


3
Enter to mount your new BTRFS volume to the /data directory.
At the command prompt, type df -hT and press Enter. Note that
4
the volume size is 3GB. Next, type lsblk and press Enter. Note that,
while the BTRFS filesystem spans the three 1GB sdb, sdc, and sdd
devices, only sdb is shown to be mounted to the /data directory.
Finally, type btrfs filesystem df /data and press Enter. Note the
output.

At the command prompt, type btrfs device add -f /dev/sde /data


5
and press Enter to add /dev/sde to your BTRFS volume. Next, type
btrfs filesystem balance /data and press Enter to extend the
existing data, system and metadata structures to the new device.

At the command prompt, type df -hT and press Enter. Note that
6
the volume size is 4GB. Next, type btrfs filesystem df /data and
press Enter. Note the output.

At the command prompt, type btrfs subvolume list /data and


7
press Enter. Are any subvolumes listed? Next, type btrfs
subvolume create /data/archive and press Enter to create a
subvolume and subdirectory under /data called archive. Finally,
type btrfs subvolume list /data and press Enter to view your new
subvolume.

At the command prompt, type cp /etc/hosts /data/archive and


8
press Enter to create a copy of the hosts file within the archive
subvolume.

At the command prompt, type mkdir /archive and press Enter.


9
Next, type mount -o subvol=archive,compress=lzo /dev/sdb

/archive and press Enter to mount your archive subvolume to the


/archive directory with automatic compression enabled.
At the command prompt, type df -hT and press Enter. Next, type ls
10
-F /archive and press Enter. Is your hosts file listed?

Next, type umount /archive ; umount /data and press Enter to


11
unmount your BTRFS subvolume and volume.
332
At the command prompt, type mkfs.btrfs -m raid1 -d raid1
12
/dev/sdb /dev/sdc /dev/sdd /dev/sde -f and press Enter to create a
RAID 1 BTRFS volume that spans the four disks. Note from the
output that the system configuration, data, and filesystem
metadata are fault tolerant (RAID 1). Next, type btrfs filesystem
show /dev/sdb and press Enter. Note the output.

At the command prompt, type mount /dev/sdb /data and press


13
Enter to mount your new BTRFS volume to the /data directory.

At the command prompt, type the following commands in turn


14
and press Enter. Compare the output to the output you saw earlier
in Step 4:

a. df -hT

b. lsblk

c. btrfs filesystem df /data

Next, type umount /data and press Enter to unmount your BTRFS
15
volume.

At the command prompt, type mkfs.btrfs -m raid5 -d raid5


16
/dev/sdb /dev/sdc /dev/sdd /dev/sde -f and press Enter to create a
RAID 5 BTRFS volume that spans the four disks. Note from the
output that the system configuration, data, and filesystem
metadata are fault tolerant (RAID 5). Next, type btrfs filesystem
show /dev/sdb and press Enter. Note the output.
At the command prompt, type mount /dev/sdb /data and press
17
Enter to mount your new BTRFS volume to the /data directory.

At the command prompt, type the following commands in turn


18
and press Enter. Compare the output to the output you saw earlier
in Step 4:

a. df -hT

b. lsblk

c. btrfs filesystem df /data

Next, type umount /data and press Enter to unmount your BTRFS
19
volume.

At the command prompt, type btrfs check /dev/sdb and press


20
Enter to check your BTRFS filesystem for errors. What other
command can be used to perform the same check?

Type exit and press Enter to log out of your shell.


21

Project 6-5
In this hands-on project, you examine installation log files and system
information on your Ubuntu Server 18 virtual machine.

On your Ubuntu Server 18 virtual machine, log into the command-


1
line terminal (tty1) using the user name of root and the password
of LINUXrocks!.
At the command prompt, type ls /var/log/installer and press
2
Enter. Note the different log files in this directory. Next, type less
/var/log/installer/installer-journal.txt and press Enter. Briefly
examine the entries within this file to see each action taken during
the installation process, and then type q to quit the less utility.
Finally, type egrep –i "(error|warn)" /var/log/installer/installer-
journal.txt and press Enter. View any warnings or errors that the
installation program generated during your installation.

333
At the command prompt, type ls –F /proc and press Enter to view
3
the file and directory contents of the proc filesystem.

At the command prompt, type less /proc/cpuinfo and press Enter.


4
Did the installation detect your CPU correctly? Type q to quit the
less utility. Use the less command to examine some of the other
files within the /proc directory listed in Table 6-1.

At the command prompt, type lshw | less and press Enter.


5
Examine the entries for your system hardware and type q to quit
the less utility when finished. Next, execute some of the other
hardware commands listed in Table 6-2 (for the lsscsi command,
you will first be prompted to install the associated package using
the apt install lsscsi command).

At the command prompt, type lsmod | less and press Enter.


6
Spend a few moments to examine the modules that are loaded into
your kernel in depth, Googling their names, if necessary. Can you
match them to the hardware devices you saw in the previous step?
Do you see modules that are used to interact with virtualized
hardware? Do you see modules that are used to provide software
feature or filesystem support? Type q to quit the less utility when
finished.
At the command prompt, type modinfo dummy and press Enter
7
to view the information about the dummy module.

At the command prompt, type modprobe dummy and press Enter


8
to insert the dummy module into your Linux kernel. Next, type
lsmod | less and press Enter. Is the dummy module listed? Type q
to quit the less utility, and then type rmmod dummy and press

Enter to remove the dummy module from the Linux kernel.

At the command prompt, type ls /etc/modprobe.d and press


9
Enter. Next, type ls /etc/modules-load.d and press Enter. Observe
the entries. What are the files within these directories used for?

At the command prompt, type vi /etc/modules-


10
load.d/modules.conf and press Enter. Add the line dummy to the
end of this file, save your changes, and quit the vi editor. Next,
type reboot and press Enter to reboot your virtual machine.

After Ubuntu Server 18 has booted, log into the command-line


11
terminal (tty1) using the user name of root and the password of
LINUXrocks!. At the command prompt, type lsmod | less and
press Enter. Is the dummy module listed? Type q to quit the less
utility.

At the command prompt, type dmesg | less and press Enter.


12
Observe the entries. How do they correspond with the hardware
information that you saw within this project? Type q to quit the
less utility.

At the command prompt, type journalctl –k | less and press


13
Enter. How does the information compare to the previous step?
Type q to quit the less utility.
At the command prompt, type less /var/log/syslog and press
14
Enter. What does each entry represent? Type q to quit the less
utility.

334
At the command prompt, type journalctl –b | less and press
15
Enter. How does the information compare to the previous step?
Type q to quit the less utility.

Type poweroff and press Enter to power off your Ubuntu Server
16
18 virtual machine.

Project 6-6
In this hands-on project, you use system rescue on your Fedora Linux virtual
machine using your live installation media to check your root filesystem for
errors and change the root user’s password.

In your virtualization software, ensure that the DVD for your


1
Fedora Linux virtual machine is attached to the ISO image for
Fedora 28 Live (Fedora-Workstation-Live-x86_64-28-1.1.iso). Next,
start and then connect to your Fedora Linux virtual machine using
your virtualization software.

At the Fedora Live welcome screen, select Start Fedora-


2
Workstation-Live 28 and press Enter.

After the graphical desktop and Welcome to Fedora screen have


3
loaded, select the option Try Fedora and click Close when
prompted.

Navigate to Activities, Show Applications, Terminal within the


4
GNOME desktop to open a BASH terminal.
At the command prompt, type su - root and press Enter to switch
5
to the root user.

At the command prompt, type df and press Enter to view the


6
mounted filesystems. Is the root filesystem on your hard disk
mounted?

At the command prompt, type fsck –f /dev/sda3 and press Enter to


7
check your (/) root filesystem for errors.

At the command prompt, type mount /dev/sda3 /mnt and press


8
Enter to mount the (/) root filesystem on your hard disk to the
/mnt directory on the Fedora live system. Next, type mount
/dev/sda1 /mnt/boot and press Enter to mount the /boot
filesystem on your hard disk to the /mnt/boot directory on the
Fedora live system.

At the command prompt, type mount -t proc proc /proc and press
9
Enter to mount the /proc filesystem.

At the command prompt, type chroot /mnt and press Enter to


10
switch from the root filesystem on your Live Fedora system to the
root filesystem on your hard disk (ignore any warnings). Next,
type ls /root and press Enter. Do you recognize the files?

At the command prompt, type passwd root and press Enter.


11
Supply a new root user password of Secret123 and press Enter
when prompted (twice). What warning did you receive regarding
the Secret123 password?

Click the power icon in the upper-right corner, select the power
12
icon that appears, and click Power Off to shut down your Fedora
Live installation image.
In the Settings for your virtual machine in your virtualization
13
software, ensure that the DVD drive is no longer attached to the
Fedora ISO image.

Finally, start your Fedora Linux virtual machine using your


14
virtualization software. After the system has loaded, switch to a
command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in
to the terminal using the user name of root and the password of
Secret123. Were you successful?

335
At the command prompt, type passwd root and press Enter.
15
Supply a new root user password of LINUXrocks! and press Enter
when prompted (twice).

At the command prompt, type poweroff and press Enter to shut


16
down your Fedora Linux virtual machine.

Project 6-7
In this hands-on project, you install Ubuntu Server 14.04 LTS Linux within a
virtual machine on a Windows computer and examine the LVM partition
configuration afterwards.
In your virtualization software, create a new virtual machine
1
called Ubuntu Server 14 that has the following characteristics:

a. 2GB of memory

b. An Internet connection via your PC’s network card


(preferably using an external virtual switch or bridged
mode)

c. A 50GB SATA/SCSI/SAS virtual hard disk (dynamically


allocated)

d. The virtual machine DVD drive attached to the ISO file for
the Ubuntu Server 14.04 installation media (ubuntu-
14.04.5-server-amd64.iso)

Start and then connect to your Ubuntu Server 14 virtual machine


2
using your virtualization software.

At the Language screen, ensure that English is selected and press


3
Enter.

At the Ubuntu welcome screen, examine the options. Ensure that


4
Install Ubuntu Server is selected and press Enter.

At the Select a language page, ensure that English is selected and


5
press Enter.

At the Select your location screen, ensure that United States is


6
selected and press Enter.

At the Configure the keyboard screen, select Yes and press Enter.
7
Follow the prompts to complete the detection. When the detection
process finds a “us” keyboard layout, select Continue and press
Enter.
At the Configure the network screen, type a hostname of
8
Ubuntu14 , select Continue, and press Enter.

At the Set up users and passwords page, type user1 as the full user
9
name, select Continue, and press Enter. When prompted for the
simple user name, ensure that user1 is displayed, select Continue,
and press Enter. When prompted for a password for user1, type
LINUXrocks! , select Continue, and press Enter. When prompted
to repeat the password, enter LINUXrocks! again, select
Continue, and press Enter. When prompted to encrypt user1’s
home directory, ensure that No is selected and press Enter.

At the Configure the clock screen, ensure that the correct time
10
zone is displayed, select Yes, and press Enter. Alternatively, if an
incorrect time zone is displayed, select No, press Enter, select your
time zone, and press Enter.

At the Partition disks screen, note that the default selection is


11
Guided – use entire disk and set up LVM and press Enter. Press
Enter again to select your disk (sda), and then select Yes and press
Enter to write your partition changes to the disk. Note that the full
size is used for the volume group, select Continue, and press
Enter.

336
At the summary screen, note that Ubuntu will create an LV for the
12
root filesystem with an ext4 filesystem and an LV for swap as well.
Select Yes and press Enter to write the changes to the disk and
start the installation of the core system packages.

At the Configure the package manager screen, optionally supply


13
the URL address of your classroom proxy (if your classroom uses
one), select Continue, and press Enter.
At the Configuring tasksel screen, ensure that No automatic
14
updates is selected and press Enter.

At the Software selection screen, use the spacebar to individually


15
choose all packages (except for Manual package selection), select
Continue, and press Enter.

At the Configuring mysql-server-5.5 screen, supply a password of


16
LINUXrocks! , select Continue, and press Enter. When prompted
to confirm the password, type LINUXrocks! , select Continue, and
press Enter.

At the Postfix Configuration screen, ensure that Internet Site is


17
selected and press Enter. When prompted for a system mail name,
ensure that Ubuntu14 is listed, select Continue, and press Enter.

At the configuring dovecot-core screen, ensure that Yes is selected


18
and press Enter to create an SSL encryption certificate. When
prompted for the host name used in the certificate, type Ubuntu14
in place of localhost, select Continue, and press Enter.

At the Install the GRUB boot loader on a hard disk screen, ensure
19
that Yes is selected and press Enter.

At the Finish the installation screen, ensure that Continue is


20
selected and press Enter to reboot into the new system.

After the system has booted, log into tty1 as user1 with the
21
password LINUXrocks!. At the command prompt, type who and

press Enter.
At the command prompt, type sudo passwd root and press Enter.
22
Supply user1’s password of LINUXrocks! when prompted and
press Enter. Supply a password of LINUXrocks! for the root user
when prompted and press Enter. Confirm the root user password
by typing LINUXrocks! and press Enter.

At the command prompt, type su - root and supply a password of


23
LINUXrocks! to switch to the root user.

At the command prompt, type lsblk and press Enter. Examine the
24
output. Why was a /boot partition created on your hard disk? Is
the / (root) filesystem a volume managed by the LVM?

At the command prompt, type fdisk -l and press Enter. Note that
25
the remainder of the drive is an extended partition (/dev/sda2)
that contains a single logical drive (/dev/sda5) used exclusively by
the LVM.

At the command prompt, type lvdisplay and press Enter. Note the
26
logical volumes created for the root filesystem and swap partition
within the Ubuntu14-vg volume group.

At the command prompt, type poweroff and press Enter to shut


27
down your Ubuntu Server 14 virtual machine.
337
Book Title: eTextbook: COMPTIA Linux Guide to Linux Certification
Chapter 6. Linux Server Deployment
Discovery Exercises

Discovery Exercises

1. Project 6-5 was performed on your Ubuntu Server 18 virtual machine.

Perform the same project using your Fedora Linux virtual machine,

as well as your Ubuntu Server 14 virtual machine and note any


differences.

2. Modern Linux distributions often allow you to create fault-tolerant


BTRFS volumes during installation to host the Linux operating system

and applications. Provided that you have adequate storage space on


your host operating system, create a new virtual machine called

Fedora BTRFS that has the following characteristics:

a. 4GB of memory

b. Two 50GB SATA/SCSI/SAS virtual hard disks (both dynamically


allocated)

c. The virtual machine DVD drive attached to the ISO file for
Fedora 28 live media (Fedora-Workstation-Live-x86_64-28-

1.1.iso)

Next, perform an installation of Fedora Linux that contains a / (root)

filesystem that uses BTRFS RAID 1 fault tolerance for both data and

metadata from space on both virtual hard disks. In order to configure

this during the Fedora installation program, you will need to choose
the Advanced Custom (Blivet-GUI) option on the Installation

Destination screen. Also note that the /boot filesystem cannot use

BTRFS. Following the installation, verify your BTRFS configuration


using the appropriate commands. When finished, remove your

virtual machine and both virtual hard disk files.

3. An alternative to BTRFS RAID 1 for operating system and application

fault tolerance is software RAID 1. Perform Discovery Exercise 2


again, but instead of using a BTRFS RAID 1 volume for the / (root)

filesystem, select the appropriate options to create a software RAID 1

volume formatted with ext4.

4. The LVM can also be used to provide RAID for logical volumes,

provided that the underlying volume group consists of multiple

physical volumes. View the lvmraid manual page to learn how to


implement LVM RAID 0, 1, and 5 using the lvcreate command. Next,

add three 10GB SATA/SCSI/SAS virtual hard disks (dynamically


expanding) to your Fedora Linux virtual machine, and configure
them as a single LVM RAID 5 logical volume.

5. Search the Internet for information about five Linux installation


problems that are different from those described in this chapter. How

have other people solved these problems? If you had similar


difficulties during installation, how could you get help?

6. Linux servers are typically stored in a locked server closet to prevent


physical access by unauthorized persons. Given the steps that you

performed in Project 6-6, describe why these physical restrictions are


warranted.
338

You might also like