Browse Source

H1: Fix text syntax

master
Pekka Helenius 6 years ago
committed by GitHub
parent
commit
c705671692
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 56 additions and 27 deletions
  1. +56
    -27
      exercises/h1.md

+ 56
- 27
exercises/h1.md View File

@ -56,10 +56,15 @@ Let's take a detailed look for two of these approaches: Rufus on Windows 7 and `
You can use either Windows 7 or 10 (any student/enterprise/server subversion applies here). You can run Windows either in a virtual machine or as physically installed in your mass media storage (SSD/HDD). Whichever method you choose to run Windows, it doesn't really matter. The most important part is that you have a working operating system.
1. Launch Microsoft Windows
2. Download Rufus application from [here](https://rufus.akeo.ie/), under the title "Download"
3. You can use either portable or installable version of Rufus. In the following example, we use portable version v. 2.18.
4. Download any Linux distribution you prefer. In further parts, Debian-based Ubuntu 16.04.3 LTS is used. What comes to alternative download methods, you can choose either ISO image file (downloaded directly from servers) or distributed torrent method. Torrent method usually requires a client application (such as [Transmission](https://transmissionbt.com/download/)) to work correctly. The Linux distribution of choice can be anything you prefer in your working environment and which requirements you have set up for your Linux server environment.
**1.** Launch Microsoft Windows
**2.** Download Rufus application from [here](https://rufus.akeo.ie/), under the title "Download"
**3.** You can use either portable or installable version of Rufus. In the following example, we use portable version v. 2.18.
**4.** Download any Linux distribution you prefer. In further parts, Debian-based Ubuntu 16.04.3 LTS is used.
What comes to alternative download methods, you can choose either ISO image file (downloaded directly from servers) or distributed torrent method. Torrent method usually requires a client application (such as [Transmission](https://transmissionbt.com/download/)) to work correctly.
The Linux distribution of choice can be anything you prefer in your working environment and which requirements you have set up for your Linux server environment.
Let's download a widely used Xubuntu 16.04.3 LTS (x86_64 processor architecture), which is based on Ubuntu 16.04.3 LTS but uses XFCE desktop environment instead of Unity. In Ubuntu version syntax, 16 refers to release year (2016), 04 refers to release month (April), 3 is subversion and LTS stands for Long-Term Support (preferred in server environments).
[Xubuntu 16.04.3 LTS - Torrent download](http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/xubuntu-16.04-desktop-amd64.iso.torrent)
@ -67,35 +72,47 @@ Let's download a widely used Xubuntu 16.04.3 LTS (x86_64 processor architecture)
#### Comparing checksums
If you wanted to make sure the ISO image you just downloaded is valid, you should check its checksum (mainly for security reasons). In this way you make sure that no malicious party has altered the image you trust and the download process has succeeded. You should take a closer look on sha256sum and md5sum values of your ISO image file. The value must match the one which is published on the Ubuntu download site ([sha256sum](http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/SHA256SUMS), [md5sum](http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/MD5SUMS)).
If you wanted to make sure the ISO image you just downloaded is valid, you should check its checksum (mainly for security reasons). In this way you make sure that no malicious party has altered the image you trust and the download process has succeeded.
You should take a closer look on `sha256sum` and `md5sum` values of your ISO image file. The value must match the one which is published on the Ubuntu download site ([sha256sum](http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/SHA256SUMS), [md5sum](http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/MD5SUMS)).
**On Linux:** check checksums with commands `sha256sum xubuntu-16.04-desktop-amd64.iso` and/or `md5sum xubuntu-16.04-desktop-amd64.iso`
**On Windows:** Use [Microsoft File Checksum Integrity Verifier](https://www.microsoft.com/en-us/download/details.aspx?id=11533) or check a CertUtil-based solution [given on superuser.com](https://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7/898377#898377)
**NOTE:** Checking checksums is highly recommended. For instance, Linux Mint network servers were hacked due to outdated server software in 2016, resulting to maliciously injected ISO images uploaded by hostile attackers.
In addition, the Linux Mint forum software was affected, as well (user credentials leaked). More about the incident is explained [on Linux Mint blog](https://blog.linuxmint.com/?p=2994).
On Linux: check checksums with commands `sha256sum xubuntu-16.04-desktop-amd64.iso` and `md5sum xubuntu-16.04-desktop-amd64.iso`
**5.** Plug in an empty and large enough USB stick into your computer (4GiB should be sufficient). It is highly recommended that you have formatted the stick in advance because Rufus overwrites any existing files existing in the USB stick in order to place required Linux files in the stick. If your stick contained any important files, they should be moved from the stick to somewhere safe location before proceeding here.
On Windows: Use [Microsoft File Checksum Integrity Verifier](https://www.microsoft.com/en-us/download/details.aspx?id=11533) or check a CertUtil-based solution [given on superuser.com](https://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7/898377#898377)
**6.** Once the stick is emptied (and probably formatted), launch Rufus application. Select the USB stick as a target device in *Device* menu. All other settings can be left in their default values. Choose downloaded Xubuntu 16.04.3 LTS ISO image file from the dropdown menu located at the right of **Create a bootable disk using** part. The dropdown menu is presented as a disc icon without any texts.
**NOTE:** Checking checksums is highly recommended. For instance, Linux Mint network servers were hacked due to outdated server software in 2016, resulting to maliciously injected ISO images uploaded by hostile attackers. In addition, the Linux Mint forum software was affected, as well (user credentials leaked). More about the incident is explained [on Linux Mint blog](https://blog.linuxmint.com/?p=2994).
**7.** Click *Start*, choose ISO method as a writing method once asked. Read the warnings. If all steps have been successfully accomplished so far, proceed with the writing operation.
5. Plug in an empty and large enough USB stick into your computer (4GiB should be sufficient). It is highly recommended that you have formatted the stick in advance because Rufus overwrites any existing files existing in the USB stick in order to place required Linux files in the stick. If your stick contained any important files, they should be moved from the stick to somewhere safe location before proceeding here.
**8.** Wait until the ISO image file has been written into the USB stick. Once done, reboot your computer with the USB stick attached.
6. Once the stick is emptied (and probably formatted), launch Rufus application. Select the USB stick as a target device in *Device* menu. All other settings can be left in their default values. Choose downloaded Xubuntu 16.04.3 LTS ISO image file from the dropdown menu located at the right of **Create a bootable disk using** part. The dropdown menu is presented as a disc icon without any texts.
Immediately after the computer has rebooted, press a button which you can access your BIOS/UEFI/Boot options menu with. Choose the Xubuntu 16.04.3 LTS USB stick (which should appear in the boot list). Start the operating system boot-up process bt selecting **Try without installing** option (this step varies between Linux distribution. More generally, you can also choose **Install 'whateverdistro'** option and select installation on the live USB Linux desktop environment). Wait until the operating system has been booted up. Start installation and follow the instructions.
7. Click *Start*, choose ISO method as a writing method once asked. Read the warnings. If all steps have been successfully accomplished so far, proceed with the writing operation.
The installation process is not defined in detail here because installation steps varies from Linux distribution to distribution. However, basic principle is to install the operating system with good and strong passwords. Encrypted home folder or HDD/SSD partition options should also be considered.
8. Wait until the ISO image file has been written into the USB stick. Once done, reboot your computer with the USB stick attached. Immediately the computer has rebooted, press a button which you can access your BIOS/UEFI/Boot options menu with. Choose the Xubuntu 16.04.3 LTS USB stick (which should appear in the boot list). Start the operating system boot-up process bt selecting **Try without installing** option (this step varies between Linux distribution. More generally, you can also choose **Install <whateverdistro>** option and select installation on the live USB Linux desktop environment). Wait until the operating system has been booted up. Start installation and follow the instructions.
After you have successfully installed Linux, detach the live USB stick and reboot your computer. You should be able to access the installed Linux distribution without the USB stick.
The installation process is not defined in detail here because installation steps varies from Linux distribution to distribution. However, basic principle is to install the operating system with good and strong passwords. Encrypted home folder or HDD/SSD partition options should also be considered. After you have successfully installed Linux, detach the live USB stick and reboot your computer. You should be able to access the installed Linux distribution without the USB stick.
When writing and applying passwords, please pay attention to correct keyboard layouts. In my case, I use a Swedish (Finnish) keyboard layout which differs from the default en_US layout. Therefore, mistyping characters can easily happen. Many Linux distributions allow you to change the keyboard layout during the installation process. Unless you're not able to do it in installation window, you can change the keyboard layout temporarily by executing `setxkbmap fi` (`fi` = finnish layout, adapt this parameter to your language preferences) in a local shell environment (NOTE: graphical environment is required for `setxkbmap` command since it's a part of graphical X11 environment!).
When writing and applying passwords, please pay attention to correct keyboard layouts. In my case, I use a Swedish (Finnish) keyboard layout which differs from the default en_US layout. Therefore, mistyping characters can easily happen. Many Linux distributions allow you to change the keyboard layout during the installation process. Unless you're not able to do it in installation window, you can change the keyboard layout temporarily by executing *setxkbmap fi* in a local shell environment (NOTE: graphical environment is required since the command is a part of graphical X11 environment!). You can open up a local shell by opening a terminal emulator while running Linux from your USB stick. NOTE: changing passwords must be done before writing them in the installation steps!
You can open up a local shell by opening a terminal emulator while running Linux from your USB stick. NOTE: changing passwords must be done before writing them in the installation steps!
#### Alternative 2 - dd command (Linux, CLI-based)
In case you use any Unix-based operating system (Linux, GNU/Linux, Apple MacOS, FreeBSD), you can create a USB live stick by using shell-based `dd` command. This method does not require a graphical desktop environment. **NOTE!** Commands on Apple MacOS may not be exactly equal to Linux ones if you use extra parameters in the following commands.
In case you use any Unix-based operating system (Linux, GNU/Linux, Apple MacOS, FreeBSD), you can create a USB live stick by using shell-based `dd` command. This method does not require a graphical desktop environment.
**NOTE:** Commands on Apple MacOS may not be exactly equal to Linux ones if you use extra parameters in the following commands.
The following instructions assume that you have only a command line environment and you have a working network connection.
1. At first, you need to download an ISO image of your Linux distribution of choice. There are usually two options: download ISO image from a centralized server or download ISO image using torrent protocol. In the following steps, we download Xubuntu 16.04.3 LTS (x86_64).
**1.** At first, you need to download an ISO image of your Linux distribution of choice. There are usually two options: download ISO image from a centralized server or download ISO image using torrent protocol. In the following steps, we download Xubuntu 16.04.3 LTS (x86_64).
a. Centralized server:
**a. Centralized server:**
- requires that `wget` command exists in the system
- download the ISO image with the command:
@ -103,7 +120,7 @@ a. Centralized server:
wget --directory-prefix=$HOME --show-progress http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/xubuntu-16.04-desktop-amd64.iso
```
b. Torrent download:
**b. Torrent download:**
- requires that `transmission-cli` command exists in the system
- download the ISO image with the command:
@ -111,7 +128,13 @@ b. Torrent download:
transmission-cli -w $HOME http://cdimage.ubuntu.com/xubuntu/releases/16.04.3/release/xubuntu-16.04-desktop-amd64.iso.torrent
```
2. Plug in an empty and large enough USB stick into your computer (4GiB should be sufficient). It is highly recommended that you have formatted the stick in advance but you can format the stick with `fdisk` command, as well ([util-linux](https://www.kernel.org/pub/linux/utils/util-linux/)). When using fdisk, please follow [these instructions](https://www.cyberciti.biz/faq/linux-how-to-delete-a-partition-with-fdisk-command/), for example. In case you have important files to be copied from your USB stick, copy the files with the following command sequence. We assume that the stick is not yet mounted on the system. Command sequence is expected to be executed with the default user (UID = 1000) which belongs to the default user group (GID = 1000). Correct USB stick device name and partition number (*/dev/XdYZ*) must be find out in advance by executing command `sudo fdisk -l`. Y stands for the device's alphabetical ID, Z stands for partition number (*/dev/sda1*, for example). X can have value `h` (IDE-based HDD/SSD's) or `s` (SATA-based HDD/SSD's). Newer NVMe-based storage solutions such as Samsung EVO series 860/960 use syntax */dev/nvme0n1p1* in which `1` stands for the device number and `p1` stands for the partition number.
**2.** Plug in an empty and large enough USB stick into your computer (4GiB should be sufficient). It is highly recommended that you have formatted the stick in advance but you can format the stick with `fdisk` command, as well ([util-linux](https://www.kernel.org/pub/linux/utils/util-linux/)).
When using fdisk, please follow [these instructions](https://www.cyberciti.biz/faq/linux-how-to-delete-a-partition-with-fdisk-command/), for example. In case you have important files to be copied from your USB stick, copy the files with the following command sequence. We assume that the stick is not yet mounted on the system. Command sequence is expected to be executed with the default user (`UID` = 1000) which belongs to the default user group (`GID` = 1000).
Correct USB stick device name and partition number (`/dev/XdYZ`) must be find out in advance by executing command `sudo fdisk -l`.
- `Y` stands for the device's alphabetical ID, `Z` stands for partition number (`/dev/sda1`, for instance). `X` can have value `h` (IDE-based HDD/SSD's) or `s` (SATA-based HDD/SSD's). Newer NVMe-based storage solutions such as Samsung EVO series 860/960 use syntax `/dev/nvme0n1p1` in which `1` stands for the device number and `p1` stands for the partition number.
```
sudo mkdir -p /mnt/livestick && \
@ -123,13 +146,17 @@ sudo chown -R 1000:1000 $HOME/livestick-backup
**NOTE:** If you have any USB stick partitions mounted already on the system, you should **not** use `/mnt/livestick` location in above commands. Instead, use the path you can extract for the correct USB stick partition with `mount` command.
3. When you have backed up your important files earlier stored in the USB stick, you have confirmed the USB stick is empty and you have successfully downloaded your Linux distribution ISO image, you can start proceeding with the writing operations.
**3.** When you have backed up your important files earlier stored in the USB stick, you have confirmed the USB stick is empty and you have successfully downloaded your Linux distribution ISO image, you can start proceeding with the writing operations.
**NOTE!** You must be extra careful with `dd` command. If misused, the command can destroy any data you have in your HDD/SSD or in any storage device. Recovering files is a headache and you really don't want to end up having one! One key principle is to triple check all locations given for the `dd` command and check that used locations are in correct places (so that input and output operations are being executed for correct devices and the devices don't mix up).
**NOTE:** You must be extra careful with `dd` command. If misused, the command can destroy any data you have in your HDD/SSD or in any storage device. Recovering files is a headache and you really don't want to end up having one! One key principle is to triple check all locations given for the `dd` command and check that used locations are in correct places (so that input and output operations are being executed for correct devices and the devices don't mix up).
4. Let's begin with Xubuntu 16.04.3 LTS USB writing operations. In this section we assume that you have successfully downloaded the ISO image and you definitely know the correct path for your USB stick device (syntax: `/dev/sda`). **NOTE!** I don't refer to USB stick partition path (syntax: /dev/sda1). The device path syntax is as stated: `/dev/sda`, `/dev/sdb`, etc. `dd` command is executed as the root user (Linux main user/super user). `dd` command doesn't confirm the command syntax is correct so you must write it correctly in the beginning. If you are not sure about the correct syntax, please contant an expert.
**4.** Let's begin with Xubuntu 16.04.3 LTS USB writing operations. In this section we assume that you have successfully downloaded the ISO image and you definitely know the correct path for your USB stick device (syntax: `/dev/sda`).
The command syntax (NOTE: not likely the exact command in your environment!) is as follows:
**NOTE:** I don't refer to USB stick partition path (syntax: /dev/sda1). The device path syntax is as stated: `/dev/sda`, `/dev/sdb`, etc. `dd` command is executed as the root user (Linux main user/super user).
`dd` command doesn't confirm the command syntax is correct so you must write it correctly in the beginning. If you are not sure about the correct syntax, please contant an expert.
The command syntax (**NOTE:** not likely the exact command in your environment!) is as follows:
```
sudo dd status=progress if=$HOME/xubuntu-16.04-desktop-amd64.iso of=/dev/sdb
@ -139,11 +166,13 @@ where `/dev/sdb` is your USB stick as seen on Linux system. **Use correct, your
If you want more instructions how to use the `dd` command, it is recommended to read the following wiki, for example: [Wikipedia - dd (Unix)](https://en.wikipedia.org/wiki/Dd_(Unix))
5. Wait until the ISO image file has been written into the USB stick. Once done, reboot your computer with the USB stick attached. Immediately the computer has rebooted, press a button which you can access your BIOS/UEFI/Boot options menu with. Choose the Xubuntu 16.04.3 LTS USB stick (which should appear in the boot list). Start the operating system boot-up process bt selecting **Try without installing** option (this step varies between Linux distribution. More generally, you can also choose **Install <whateverdistro>** option and select installation on the live USB Linux desktop environment). Wait until the operating system has been booted up. Start installation and follow the instructions.
**5.** Wait until the ISO image file has been written into the USB stick. Once done, reboot your computer with the USB stick attached. Immediately the computer has rebooted, press a button which you can access your BIOS/UEFI/Boot options menu with. Choose the Xubuntu 16.04.3 LTS USB stick (which should appear in the boot list). Start the operating system boot-up process bt selecting **Try without installing** option (this step varies between Linux distribution. More generally, you can also choose **Install 'whateverdistro'** option and select installation on the live USB Linux desktop environment). Wait until the operating system has been booted up. Start installation and follow the instructions.
The installation process is not defined in detail here because installation steps varies from Linux distribution to distribution. However, basic principle is to install the operating system with good and strong passwords. Encrypted home folder or HDD/SSD partition options should also be considered.
The installation process is not defined in detail here because installation steps varies from Linux distribution to distribution. However, basic principle is to install the operating system with good and strong passwords. Encrypted home folder or HDD/SSD partition options should also be considered. After you have successfully installed Linux, detach the live USB stick and reboot your computer. You should be able to access the installed Linux distribution without the USB stick.
After you have successfully installed Linux, detach the live USB stick and reboot your computer. You should be able to access the installed Linux distribution without the USB stick.
When writing and applying passwords, please pay attention to correct keyboard layouts. In my case, I use a Swedish (Finnish) keyboard layout which differs from the default en_US layout. Therefore, mistyping characters can easily happen. Many Linux distributions allow you to change the keyboard layout during the installation process. Unless you're not able to do it in installation window, you can change the keyboard layout temporarily by executing *setxkbmap fi* in a local shell environment (NOTE: graphical environment is required since the command is a part of graphical X11 environment!). You can open up a local shell by opening a terminal emulator while running Linux from your USB stick. NOTE: changing passwords must be done before writing them in the installation steps!
When writing and applying passwords, please pay attention to correct keyboard layouts. In my case, I use a Swedish (Finnish) keyboard layout which differs from the default en_US layout. Therefore, mistyping characters can easily happen. Many Linux distributions allow you to change the keyboard layout during the installation process. Unless you're not able to do it in installation window, you can change the keyboard layout temporarily by executing `setxkbmap fi` (`fi` = finnish layout, adapt this parameter to your language preferences) in a local shell environment (NOTE: graphical environment is required for `setxkbmap` command since it's a part of graphical X11 environment!).
**b)** List hardware components of your new Linux computer (sudo lshw -short -sanitize).
--------------
@ -193,7 +222,7 @@ Detailed comments about the listed devices have been included after each termina
| /0/100/1f.2storage8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] | SATA controller of C220 chipset family for SATA-based mass media storage inputs |
| /0/100/1f.3bus8 Series/C220 Series Chipset Family SMBus Controller | Power management [System Management Bus controller](https://en.wikipedia.org/wiki/System_Management_Bus) |
P.S. If you frequently listed your hardware on a Linux computer, you should consider creating a *bash alias command* for this purpose (assuming your default shell environment is bash). Basic idea is to simplify commands you need to type each time you want to do something. For listing hardware, write a the following in your `$HOME/.bashrc` file (it's a hidden dotfile):
P.S. If you frequently listed your hardware on a Linux computer, you should consider creating a **bash alias command** for this purpose (assuming your default shell environment is `bash`). Basic idea is to simplify commands you need to type each time you want to do something. For listing hardware, write a the following in your `$HOME/.bashrc` file (it's a hidden dotfile):
```
alias listhw='sudo lshw -short -sanitize'
```


Loading…
Cancel
Save