Chapter 3: Installation - spc-computer-society/spc-cs-db GitHub Wiki

The Ultimate Linux guide for Beginners

Chapter 3 --- Installation

In this chapter, we will go through the installation process, as well as partitioning and booting up. This chapter is very important, and should not be done wrong. Please be careful, read and understand what you are doing. These actions are potentially destructive if carelessly applied. All portions which may cause file damage will be marked. You are advised to read carefully. If in doubt, ask or Google.

Partitioning

Partitioning is the act of dividing a hard disk or an SSD into different parts, called partitions. This provides a place for Linux to ‘live in’. Partitions must be mounted before they can be used. Partitions are mounted at mount points. A normal Linux distribution requires two partitions. One, called ‘swap’, allows the OS to use some of the hard disk as RAM when RAM is scarce or something in memory is not used for a long time. The other partition, called ‘root’, contains all your files. The mount point of the root partition is ‘/’. ‘/’ is the root of the file system of your OS. Hence, it is called ‘root’. Some people, (including some of the authors), prefer an extra third partition called the home partition, which holds all users’ personal files.

Caution! Partitioning for Mac users

MacOS systems use proprietary file systems. For MacOS versions of or under MacOS High Sierra (10.13), it uses HFS+, together with 3 partitions. They are: EFI Partition (ESP) (fat32), Apple Core storage (HFS+) and Recovery partition (Unknown). For versions above (Mojave and Catalina), there are only two: EFI Partition (ESP) (fat32) and a container disk consisting of recovery and storage (APFS). These file systems(HFS+ and APFS) cannot be modified, nor read by linux file systems without 3rd party utilities. Therefore, if you want to dual boot MacOS with Linux, you will need to shrink your partition first. Using launchpad or spotlight, open disk utility. Click on your disk (e.g. SSD). Then on the top, click partition. You should now see a circle. Click the + sign to add a new partition. This will be your Linux partition(s). Drag and allocate at least 15gb of space. More is highly recommended. When done, make sure the file system is set to MS-DOS. This is actually equivalent to Fat32, this is just how they call it for some reason. Optionally, name your partition if this helps you identify. Click Apply to confirm the change.

If ‘root’ is mounted at ‘/’, where is ‘swap’ mounted? Swap is mounted, but not at a specific mount point.

Partition Table

Each disk requires a partition table in order to locate partitions. The major types of partition tables are MBR and GPT. MBR(Master Boot Record) is an older type of partition which only supports up to 4 primary partitions, or 3 primary and an arbitrarily large amount of logical partitions. Logical partitions differ from primary partitions in that they cannot be booted from. GPT(GUID Partition Table), or the (Globally Unique Identifier Partition Table), is the newer standard of partition tables. It removes the restriction of MBR and allows more partitions. A GPT disk can be read by MBR systems, but the 5th and later partitions will not be shown. This is accomplished by a ‘protective MBR’ at the front of GPT’s partition table, which prevents tools which expect MBR from messing up the system.

Booting into the live system

In order to install the linux distro into your internal storage, you will first need to boot into the live system using the bootable usb drive you previously flashed. Here are the general steps:

  1. For Windows users, if you have your fastboot turned on, make sure to switch it off.
  2. Shut down your computer. We are going to boot into the live system. Please note that this will not affect anything. Your previous operating system will not be erased.
  3. Plug in your usb drive. Turn on your computer. If you are using a PC, hold the BIOS menu key. You can know your key by Googling it. If you are using a Mac, you can skip to step 5.
  4. In the BIOS menu, make sure that SECURE BOOT is diasbled. This step is very crucial, as your usb drive might not be able to boot. You may need to enable a ‘supervisor’/’master’/’BIOS’ password. You can remove the password after you have diasabled secure boot. If you are using Ubuntu, you may try to skip this. However, drivers may not be able to function properly, especially Nvidia graphics cards. You are also recommended to make sure that you are booting using UEFI, not Legacy, since most modern storage partition tables should be GPT, not MBR. If you have MBR as your partition table formatted as MBR, or your computer does not support UEFI, leave it as Legacy.
  5. Exit BIOS menu. Reboot and this time, hold the BOOT options key, and select your bootable usb drive. If your PC does not have the BOOT options menu, you may want to boot into BIOS Menu again. Change the Boot order for the flashed usb drive on the top over Windows Boot Manager. For Macs, hold down the ALT/OPTIONS key to boot into the Boot selection menu, and select “EFI BOOT” with the yellow logo.
  6. You should then see the boot screen of your chosen distribution. A screen such as below can be seen.
  7. Simply press enter with the default option selected to boot into the live system.
  8. After booting it up, you should see a brand new interface. This is your distro’s default interface. Feel free to test out the features and play around as much as you like. However, please note that things will not be saved (including files and customisations).

Installation

We will demonstrate the installation process with Linux Mint and Manjaro separately. This process officially writes the OS onto your internal storage, so you should be careful of what you are doing.

Linux Mint

  1. Click on the ‘Install Linux Mint’ icon.
  2. Choose your language.
  3. Choose your keyboard layout. Click on ‘Detect Keyboard Layout’ if you’re not sure.
  4. You can choose to install third-party drivers or not. You are recommended to do so because it provides better hardware compatibility.
  5. At installation types, choose ‘Something Else’ to manually partition, or install ‘Install Linux Mint alongside OS(es) already present`. If you would like to erase the entire disk and install Linux Mint, choose ‘Erase Disk and Install Linux Mint’. Note that this operation is irreversible and you must be completely sure. If you choose anything other than ‘Something Else’, skip to Step 8.
  6. There should be some empty space from your earlier partitioning. Select the empty space and create a new partition with the space. Specify the partition type as ‘Linux Swap’ and allocate a maximum of 16GB. Usually 4 is enough, but if you are going to do hibernation go for twice your RAM, with the cap at 16 GB.
  7. Create 2 more partitions of the ‘ext4 journaling file system’ type. Allocate at least 10 GB for the first partition, but preferably up to 40 GB. Allocate all your remaining space for the next partition. For the first partition, set the mount point as / and for the second partition, choose the mount point /home.
  8. You are done! Wait for the installer to finish and enjoy the slideshow in the meantime.
  9. Open a terminal. Run sudo update-grub.
  10. Reboot. You should see a menu prompting you which OS you would like to boot into. Choose Linux Mint.

Manjaro

  1. Click on the install icon on the top left corner. It should prompt you into the Manjaro installer.
  2. Select your language, region and zone. Also, select the correct keyboard layout of your own choice.
  3. Now, for the partitioning part, you can go with “install alongside windows, replace a partition or erase a partition” options, but it is always best to do it manually. For your reference, “Install Along Windows” will shrink your Windows NTFS partition and allocate the rest of the space for your linux filesystem. The Erase option will erase EVERYTHING on your whole disk. All files will be lost. Only do this if you are planning to overwrite your original OS (i.e Windows, MacOS). Then, there is another option called Replace a partition. As the name says, it replaces a partition. If you already have a formatted partition ready for erasing and use for Linux, go ahead. Make sure you select the correct partition you want to erase on the bar below. These options usually provide an option called Swap. Swap is highly recommended. Choose the option “swap with hibernation” if you have sufficient space. However, the best choice is always “Manual partition”, as you can fully control how you want to partition your Linux filesystem.
  4. In the menu, click the “create” button to create a new partition. If you are dual booting, you don’t need an additional ESP, since you can share it with previous OSes. In case you are planning to overwrite everything, you can create a new ESP, set the format to fat32 and the mount point to /boot. Then, create a storage system. Set the format to ext4, and mount point to /. In case you want to further divide the /home partition and the / partition, you can also create a new ext4 partition. Just set the mount point at /home. This is normally useless, but in case your system is corrupted, or you have plans to distro hop(rapidly switching linux distros), it might become handy. Last but not least, create a swap partition. Though this is just optional, it prevents your computer from running out of ram and screwing up. If your computer only has 8GB of Ram of below, a swap partition is almost a must. Set the format to linux-swap and leave everything else by default. Please also make sure that the boot loader disk and the partitioning disk are correct. (The disk you want to install Manjaro on)
  5. Then, it’s time to create a new user. Type in username, password, computer name. Also, set the root password. You are recommended to set the root password the same as your user’s.
  6. Next, you can optionally choose an office suite. If you don’t have means of using office suites, or you want to keep your system as minimalistic as possible, you can choose No Office. For your information, Libreoffice is the common choice for most Linux users. On the other hand, Freeoffice is a new product sponsored by Manjaro. The looks of it is closer to Microsoft Office. Of course, you can change your mind after installing Manjaro, Linux is always very flexible.
  7. If you are using Nvidia cards, it should somehow prompt you to a page, asking whether you want to use Free graphics drivers or proprietary ones. Sadly, Nvidia is well known as one of the worst companies the Linux community has ever encountered. The Free open source drivers(Nouveau) are made using reverse engineering, therefore, performance-wise, it doesn’t do well. You are therefore highly recommended to select the proprietary one.
  8. Please confirm your actions before installing, since it will erase everything you do to your target partition. Please also make sure that you are connected to the internet, or else it would fail. AC Power connection is also highly recommended in case anything happens.

Congratulations! You are now done installing a Linux distro. You just have to wait 10 to 20 minutes, then reboot it without your usb drive after it is finished! You should now see a Bootloader page(GRUB 2). Choose your distro to boot into. and you are done.

In the following chapter, the final chapter, we are going to walk through the post installation processes to help you work around with your freshly installed distro.