Install Ubuntu 16.04 LTS to the USB flash disk (16GB AxisPLUS):

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 16.04 LTS AMD 64 Desktop for example.

First boot after installation

Mandarin-Chinese Input Method

The best input module for Chinese is probably HIME, instead of the gcin or fcitx.
Install it by sudo apt-get install hime
Then type im-config & , choose hime then save and exit. Note that you must logout then login again to make HIME work.
Also check the homepage of your senior schoolmate 黃培宸 to see how he installed and customized it from an English interface.

File Manager

The PCManFM is strongly recommended. You could install it by sudo apt-get install pcmanfm

Some tools 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-get install bash
  2. Check if your vi | vim is a symbolic link to vim.tiny or vim.basic. We need the real vim for our class.
    whereis vim
    locate vim
    sudo apt-get install vim
  3. File transfer between platforms: FileZilla
    Install it by sudo apt-get install filezilla
  4. Screen capture: ksnapshot
    See the homepage of your senior schoolmate 黃浩儒 for his experiences in it. You will also need to use it for your presentation website.
  5. If you failed to get an IP address using DHCP, type sudo dhclient


If you accidently destroyed the boot record of Windows, 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).