Exercise 4
Table of Contents
1 Introduction
In this exercise, we jump straight into the current day and reinstall KONE2 with Ubuntu 18.04 LTS. We put the VM into the NAT network, as we will have some special use for it later.
\includegraphics[width=18cm]{verkko}
2 Steps
2.1 Reinstall KONE2
- If you have anything valuable in KONE2, save it. Otherwise, nuke the VM.
- Login to lonkaN+1, where lonkaN is your home lonka (or lonka5 if N=8). Start a new log in that lonka. (Optional) make a note in the old KONE2 log that the machine has been removed and reinstalled in another location.
- Reinstall in similiar manner as the previous install of KONE2. Differences below:
- 5G disk.
- Virt-install arguments: Replace
xenial
withbionic
in the installer URL, and addpriority=low
in kernel arguments (to enable expert mode). Replacebridge=br0
withnetwork=default
. - Network settings: No autoconfiguration. For IP address, choose
192.168.12X.NNN, where X is the number of your (different)
lonka and NNN is the last octet of your KONE2 address. Check
the netmask from lonka's routing settings. (
ip r
) - Proxy: http://192.168.12N.1:3142/
- LVM with following partition table:
LV Size FS Mount point Details lvroot 1G ext4 / lvusr 1G ext4 /usr Typical use news lvvar 800M xfs /var lvtmp 100M ext2 /tmp lvhome 1G ext4 /home lvswap1 1G swap - At the end of the installer, after GRUB is installed, open a
shell and chroot into the installed system (
chroot /target sh
). Enable serial console right away (systemctl enable serial-getty@ttyS0
). Exit the shell and finish the installation after that.
2.2 Post-installation
- Setup Kerberos and users. (Using a backup or
scp
, doesn't matter.) - Move disk out of
/ramdisk
. - Update system. Check free disk space.
- Reduce RAM to 256M. Reboot.
2.3 Create a backups VG
- Create a 1G image and attach it to KONE2. Create a new PV and a new VG on that. Name it TUNNUS-backups-vg.
2.4 Change UID and home path of the zero account
Move the zero account (TUNNUS0) directly to filesystem root
(/TUNNUS0
) and change its uid to 999. usermod
refuses to
change these details of a logged in user. You can work around this
by using the normal account
2.5 Grep
- What is the origin of the name of the command grep?
- Find the config file where apt's proxy information is stored in
/etc
. Recursive grep (grep -r
) can be very useful here. - How can you find all addresses of form 192.168.12X.NNN in
/etc
? Write the command and analyze the found addresses in your log.
2.6 Shrink swap partition
- Shrink swap partition down to 500MB (
swapoff, lvresize, mkswap, swapon
). Check disk space before and after.