Monday, May 24, 2010

Ubuntu 10.04 amd64 Desktop on RAID1 Installation

The following are categorized into three parts: general utilities, numerical research related and server utilities.

Install Ubuntu 10.04 on RAID 1


Just don't believe all the above (I put them in the end now) attempts fail. Later I realized I was not alone. Tons of bug reports were posted on-line, e.g. 1, 2, 3, 4, 5, 6, 7, 8. There are at least three different kinds of issues. Most likely there are some bugs in grub2 that cannot handle a RAID more than 2TB and erroneously attempts to access non-existent floating disks even though all simulated ones have been turned off in the bios. Hence a reasonable guess is that this issue is bios dependent (or motherboard dependent). The new version of grub2 is not totally compatible for different One way to workaround is to upgrade from 8.04 LTS to 10.04 LTS. Several has confirmed that would work (see here). This upgrade workaround also works on my Dell Precision T3500 64-bit machine.
  • Install Ubuntu 8.04 LTS on RAID1 through Ubuntu 8.04 LTS amd64 Alternate CD. The RAID disk can be created when you create two equal sized partitions in your system. A new item "Create software RAID" will show up.
  • Follow the instructions here.
    • update-manager --proposed
    • Install updates first.
    • Click "Upgrade" and follow the instructions.
General utilities:
  • Archivers

    • rar: sudo apt-get install rar
    • 7zip: sudo apt-get install p7zip-full
    • both automatically are associated with file-roller (the Gnome default archiver)

  • Multimedia

    • Go to System -> Administration -> Synaptic
    • Search for ubuntu-restricted-extra and install it

  • Latex

    • sudo apt-get install texlive-full
    • sudo apt-get install kile

  • Chinese input method

    • sudo apt-get install gcin
    • set up default input method manager: im-switch -s gcin
    • download the mapping table
      wget http://edt1023.sayya.org/gcin/noseeing-12.tar.gz
    • move the table to the gcin folder
      mv noseeing.gtab ~/.gcin
    • Logout and login

  • Instant messenger

    • sudo apt-get install kmess
    • enable history and turn off annoying pop-ups and sounds

  • Compiz theme and Emerald decoration

    • If following the above ubuntu 10.04 installation procedures, Compiz fusion theme utilities are mostly installed. Here are several missing pieces.
    • In System -> Administration -> Synaptic Package Manager,
      search for "Emerald" and install the only entry with the "decorative" keyword in its description.
    • Also in Synaptic, search for "compiz," find the "Compiz Fusion Icon" and install it.
    • sudo apt-get install compizconfig-settings-manager
    • Goto System -> Preference -> Startup Applications, add a new entry: fusion-icon --no-start

  • Skype
  • Dropbox
  • Visualbox
  • Tomboy
  • nxclient
Numerical research related:
  • MATLAB

    • Go to File -> Preferences -> Keyboard to change to Windows key binding style
    • Since mex in Matlab r2009a (both 32-bit and 64-bit versions) only looks for stdc++.so as a standard C++ library, we need to manually make a symbolic link to the ubuntu built-in library.
      cd /usr/lib
      sudo ln -s libstdc++.so.6 libstdc++.so

  • Sedumi 1.3

    • Add the extracted folder path into Matlab
    • Install Yalmip and run yalmiptest in Matlab. If there is no obvious errors, it's done. Otherwise run "install_sedumi" in Matlab.
      (Note: sometimes the precompiled version along with the sedumi download works fine. But sometimes only the locally compiled version by "install_sedumi" works. It seems always either one fails on a single machine. If you encounter Matlab crashes due to calling the precomiled sedumi, try install_sedumi, and vice versa.)

  • Yalmip R20100512

    • Extract the downloaded file
    • Add the paths listed in README.txt in Matlab
    • Run "yalmiptest" in Matlab 
     
  • spot 250210

    • Extract the file into the folder "spot" (It will complain later if it is not.)
    • Run "spot_install"
    • Run "spot_check" If the first three pass, it is done. It is because Sedumi cannot provide an optimal solution in the test cases. We only check paths and our setup functionality rather than accuracy here.

  • For others, see here.
Server utilities:
  • DynDNS update client (ddclient)

    • See this very decent step-by-step guide
    • Or you can try this.

  • OpenSSH

    • sudo apt-get install openssh-client
    • sudo apt-get isntall openssh-server
    • Edit /etc/ssh/sshd_config if necessary

  • FTP (SSH can do the job if not using public FTP)

    • See here
  • nxserver

      
Miscellaneous:
  • Mount partitions at startup

    • The natural and robust way is to modify /etc/fstab directly. For example, one line of my setup is 
    • LABEL=Spring    /media/Spring    ntfs-3g    rw,auto,nls=utf8,uid=1000,gid=1000,umask=0077,fmask=0077     0    0

      • LABEL=Spring: the name of the partition
      • /media/Spring: mount point
      • ntfs-3g: ntfs format with write ability
      • rw,auto,nls=utf8,uid=1000,gid=1000,umask=0077 (options)

        • rw: support read and write
        • auto: mount at startup
        • nls=utf8: support uft-8 in file and folder names
        • uid: user id, type "id" in the command line
        • gid: group id
        • umask: file and directory accessibility. It is computed in this way.
        • fmask and dmask are separate setups as umask.
      • 0: dump
      • 0: pass. check when reboot if 0.


Appendix:

Not working installation procedure on RAID1
  • See here.
    The following are excerpted from the instructions given above.
  • Use Ubuntu 10.04 to boot your system. Choose "try Ubuntu 10.04"
  • Go to System -> Administration -> GParted to make out two equal sized partitions (if you will use two partitions to create a RAID disk.) Make sure reserve some space for swap area.
  • sudo apt-get update
  • sudo apt-get install mdadm -> Choose "Local Only" when it prompts mail server installation.
  • sudo mdadm --create /dev/md1 --verbose --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
  • "Continue creating array?" answer: yes
  • Format raid disk: sudo mkfs.ext4 /dev/md1
  • Double click on the "Install Ubuntu 10.04 LTS" icon on the desktop.
  • Install regularly except choosing “Specify partitions manually (advanced)."
  • Specify root/ in md1. Then go through regular installation process.
  • Once the installation is done, DON'T REBOOT! Choose "Continue trying Ubuntu 10.04."
  • Now we are trying to install mdadm for our new installation. The following instructions just change the root from the installation CD to our new installation spot md1

    • Mount md1: mount /dev/md1 /target/ (you can also do it by going to "Places")
    • Bind the folders which will be altered by installing mdadm to this installation CD boot

      • mount --bind /dev/ /target/dev/
      • mount --bind /sys/ /target/sys/
      • mount --bind /proc/ /target/proc/
    • Change root to the new installation: chroot /target
  • sudo apt-get update
  • sudo apt-get install mdadm

    • Here since I don't need to use Postfix as my mail server. I choose Local again. Don't know whether it affects if I need a mail server later.
  • Last, install grub to both raid disks in case that when one of them is dead we can still boot from the other.

    • grub-install /dev/sda
    • grub-install /dev/sdb

Saturday, May 8, 2010

Install Kubuntu 10.04 directly instead of ubuntu + KDE desktop

I did the latter case first, but I encountered several following problems:
  1. gcin input method floating window went dead when the desktop effects are enabled. The dead window made me unable to see which character to choose and it hid a random area on the screen. (It was proved later that this is an issue of gcin. gcin by now cannot function normally in the plasma theme. Installing Kubuntu directly cannot solve this issue)
  2. Sometimes the background became back to Gnome background and there is no way to change it back rather than rebooting.
  3. It is obviously slower than Kubuntu itself.
  4. When the desktop effects are enabled, several kinds of windows cannot be displayed when using alt+tab to switch windows.
Hence it is not suggested to use both window managers on the same machine.

Here are some tweaks I did after installation kubuntu 10.04:
  1. Disable Intel CPU c-state 3 and 4 to stop hissing. (see Ubuntu 9.04, 9.10, 10.04 Installation tweaks in Misc.)
  2. Configure power manager of Thinkpad (see Ubuntu 9.04, 9.10, 10.04 Installation tweaks in Misc.)
  3. Disable annoying kwallet
  4. Configure terminal
  5. Install KMess and disable online-offline notification
  6. Enable desktop effects
  7. Right click on the "K" start menu and launch menu editor to add Matlab after installing Matlab in command lines.
  8. and many others...
After using Kubuntu 10.04 for a while, there are a couple of issues that I cannot solve so now I go back for Ubuntu 10.04...
  1. Mic doesn't work. 
  2. Wireless doesn't work. It seemed connected but only few packets are transmitted. In other words, it was not working properly.