Install Ubuntu 20.04.3 LTS to the USB flash disk:
(SanDisk Ultra Luxe USB3.2Gen1 32GB, Model: SDCZ74-032G-G46)

Choose one of your perferred Linux distribution. You can find some of the distributions from class homepage.
Download the ISO image file, and burn it into a DVD disk. Here we take Ubuntu 20.04.3 LTS AMD 64 Desktop for example.

Install MBR boot record for legacy BIOS boot strategy after installation



Post-installation

There are a few steps that are recommended after installation.

Install full Mandarin-Chinese language support and other Input Method

The procedure is somewhat compilicated for beginners. Refer to my video at YouTube starting at 14min10sec: https://www.youtube.com/watch?v=BlzKTkeQ7OA&t=850s

The input module for Mandarin-Chinese language that is closest to Microsoft's Chewing (微軟新注音) is probably HIME(姬), instead of the gcin or fcitx.
Install it by sudo apt install hime after you have done the configuration for Languages Support indicated above in my video.
Then type im-config & , choose hime then save and exit.
Alternatively, you can use the Language Support interface in the Application Center to adjust it.

Note that you must reboot the system to make HIME work. Switch between English and Chinese Inputs with Ctrl-space.
Also check the homepage of your senior schoolmate 黃培宸 to see how he customized HIME from an English interface.

File Manager

The PCManFM is strongly recommended. You could install it by sudo apt install pcmanfm
Default file manager that comes with Ubuntu 20.04 is a modified version of nautilus.
You can launch PCManFM with Mandarin-Chinese menu by:
LANG=zh_TW.utf8 pcmanfm &
under shell prompt.

Internet Browsers

You should be able to find firefox or opera as the pre-installed web browser. Additional installation of Google Chrome is suggested because it comes with several extra fonts that will make the browser look nicer. Its open-source version in Linux is called Chromium. To install Chromium to Ubuntu 20.04, refer to this link and search the string You can use Chromium from the Debian "buster" repository. Follow the instructions there.

Note that if you install Chromium just by sudo apt install chromium-browser without the instructions above, the default action is to download Chromium from Canonical's snap store; this version of Chromium from snap is not compatible with the HIME input! You will get NOTHING if your press Ctrl-space inside Chromium from snap.

Several packages you may try for X-windows

Other applications you will need for your system during this semester

  1. Check if /bin/sh is a symbolic link to /bin/bash or /bin/dash. We need the real bash for our class.
    whereis bash
    locate bash
    sudo apt install bash
    Note that Ubuntu 20.04 installs the sytem with real /bin/bash and symbolically links to /bin/sh ; for Ubuntu 18.04 or earlier, the /bin/sh links to /bin/dash, which is a simplified version of bash. In those earlier distributions, you need to do apt install bash by yourself.

  2. File transfer between platforms: FileZilla
    Install it by sudo apt install filezilla

  3. Screen capture: for Ubuntu 20.04, the PrintScreen, Alt-PrintScreen and Shift-PrintScreen can already offer enough functions for you. The captured image will be saved under your $HOME/Pictures directory.

    See also https://help.ubuntu.com/stable/ubuntu-help/screen-shot-record.html for more details.

    Another tool for screen capture in Linux is ksnapshot.
    See the homepage of your senior schoolmate 黃浩儒 for his experiences in ksnapshot. You might need to use either one for your presentation or homework.

  4. Again, if you failed to get an IP address using DHCP, type sudo dhclient




If you accidently destroyed the boot record of Windows 10 after installation of Linux,
you can try to fix it according to these instructions at https://thinker-evans.blogspot.com/2020/02/windows-10-uefi-bootloaderwindows-10.html


If you accidently destroyed the boot record of Windows 7, read the following section:

Rescue Boot Record of Windows

Some of the progress of next week:

More shell commands:

  1. Control keys: Ctrl-A, Ctrl-E, Ctrl-D, Ctrl-L, Ctrl-C, Ctrl-Z, Ctrl-Q, Ctrl-S, and Ctrl-\
  2. Review of muilti-tasking control commands: jobs, ps, fg and bg.
  3. Shell command modification with carets.
  4. File checksum and comparison with chksum, md5sum and diff.
  5. Pack and compress files by tar, gzip and bzip2.
  6. Functions of /etc/hosts and /etc/resolv.conf files.
  7. Find out Linux distribution by /etc/*version and /etc/*release files.
  8. Definitions of RAID levels.
  9. How to perform XOR operation.


Compile a new kernel _


  1. Get the kernel source from ftp://linux.cis.nctu.edu.tw/kernel/linux/kernel/v2.6 (say 2.6.33.2) or http://www.kernel.org and untar it to /usr/src (typically) or /tmp
  2. Uncompress it to a directory, say /usr/src
    tar zxf linux-2.6.33.2.tar.gz -C /usr/src
    tar jxf linux-2.6.33.2.tar.bz2 -C /usr/src
  3. Configure the kernel from existing config file
    cd /usr/src/linux-2.6.33.2
    cp /boot/config-version /usr/src/linux-2.6.33.2/.config
    make menuconfig
    (or make xconfig if you use X-windows)
  4. Make kernel image
    make bzImage
  5. Make modules (drivers)
    make modules
    make modules_install
  6. Copy the kernel image to /boot and make initrd image
    cp arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.33.2
    cp .config /boot/config-2.6.33.2
    cp System.map /boot/System.map-2.6.33.2
    cd /boot
    mkinitrd -o initrd.img-2.6.33.2 2.6.33.2
  7. Modify /boot/grub/menu.lst (GRUB) or /etc/lilo.conf (LILO, must run lilo again)

Alternative Linux loader

loadlin, documentation

Examples of Partiton Tables

Copying pre-defined partition table from /dev/sda to /dev/sdb using sfdisk

Commands of probing system information

Disk and filesystem commands


System Migration

  • RAID-1 with missing devices
    mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1

  • Copy filesystems:
    find /olddev/ -xdev | cpio -pm /mnt/newdev

    or
    cp -dpRx /olddev/ /mnt/newdev

  • Copy devices using dd (without mounting the filesystem)
    dd if=/dev/sda of=/dev/sdb (copy whole disk)
    dd if=/dev/sda1 of=/dev/sdb1
    (copy one partition)
    and followed by fsck and resizefs



Other commands:

dmraid (not recommanded; use software RAID for more flexibility).