Transferring Ubuntu to New Harddrive
My old harddrive had 60 G for my Ubuntu partition and the free space left was less than 2 G (and it is going fast). I figured it was time for me to find a bigger home for my Linux partition. I followed the Backup and Restore post but it missed out a couple simple and very important steps. So I guess it is good to log these here.
Honestly, I think the backup procedure might work (though unlikely, at least I think one shouldn’t just copy the boot folder to a new harddrive) if I only had nothing but a Linux partition. Anyhow, I think it is good to keep a Windows partition even though I rarely go there.
As mentioned in the backup guide, it is important to restore grub. However, the grub restoration guide there didn’t work for me. Actually, I’m not even sure the restoration steps did help or not since I got exactly the same problem–Grub Error 17: Cannot Mount Selected Partition–before and after applying these steps.
Actually, the problem can be fixed easily as follows.
Use Ubuntu Live CD to get on a working OS, from menu->Places->xxG Media to mount your harddrive. Then type
sudo fdisk -l
to see your actual drive location. Most probable reason of grub error 17 is that you have a wrong device link of your drive (wrong info inherited from my previous harddrive in my case). In my case, I have
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6080 48837568+ 7 HPFS/NTFS
/dev/sda2 6081 60801 439546432+ 5 Extended
/dev/sda5 60045 60801 6080571 82 Linux swap / Solaris
/dev/sda6 6081 60044 433465767 83 Linux
My Linux partition sda6 corresponds to (hd0,5). If you have sdb5 and sdc4, they correspond to (hd1,4) and (hd2,3) and so on.
Edit boot/grub/menu.lst in your Linux partition, your drive mostly should be mounted to /media. If you are not certain, you can go to menu->System->Administration->System Monitor and select File System tab, it should display where your drive mount to. In my case, it is /media/disk. Then, edit grub menu by typing (or any other editor)
sudo vi /media/disk/boot/grub/menu.lst
Search for something like the following and
title Ubuntu 8.10, kernel 2.6.24-21-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=683edbfa-6d51-49f9-ae55-95f07a644b53 ro quiet splash
initrd /boot/initrd.img-2.6.24-21-generic
quiet
replace (hd0,4) by the correct drive link, which is (hd0,5) in my case.
Actually, that is not complete yet. If you reboot now, you will have another problem saying something like UUID=683edbfa-6d51-49f9-ae55-95f07a644b53 not found.
Instead, before rebooting, type ls -l /dev/disk/by-uuid
there should be a couple file with long names which link to one of your drive. For my case, I have
total 0
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 6b453fda-b857-4ba1-a00b-74aadb2123c6 -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 91f2ed9a-de11-4dfb-9ccc-46c0ae3e97cb -> ../../sda6
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 960447000446E2BB -> ../../sda1
so, I should replace the uuid in menu.lst by 91f2ed9a-de11-4dfb-9ccc-46c0ae3e97cb. Everything should work fine with these changes.
2 comments February 4, 2009
OU recently acquired matlab for all students and faculty. However, to use at one, one needs to setup vpn. The defacto cisco vpn provided on the OU website is really dated. It doesn’t work with ubuntu unless one does some patches. I gave up after a few tries but instead I found one post mentioned about vpnc. And it is really easy to setup.
After installing it from synaptic, run
sudo vpnc
then input the following info (ur <4×4> and <password> needed of course)
Enter IPSec gateway address: soonerconnect-cox.ou.edu
Enter IPSec ID for soonerconnect-cox.ou.edu: users
Enter IPSec secret for users@soonerconnect-cox.ou.edu: ou-vpn
Enter username for soonerconnect-cox.ou.edu: <4×4>
Enter password for chen6802@soonerconnect-cox.ou.edu: <password>
One can setup even more conveniently as below if network-manager-vpnc is also installed. The version shown is Ubuntu 8.10.

Add comment December 14, 2008
Computer graphic course
I accidentally found a very interesting course from Berkeley today. The title is Mesh Generation and Geometry Processing in Graphics, Engineering, and Modeling by Jonathan Shewchuk.
Add comment November 6, 2008
Installing leJOS NXJ for Lego Mindstorm
I was trying to install leJOS to my Lego minstorm brick. I used ubuntu and got into trouble when I tried to flash the lego brick. I realized that the problem is that I didn’t have write permission to usb device. If I used sudo, I didn’t know how to export the environment variable NXJ_HOME.
I tried sudo export NXJ_HOME=~/lejos_nxj but it didn’t work. It turns out the solution is easy. What I need is simply
sudo -s
Add comment November 4, 2008
Video stuff in Ubuntu
Switching to Linux means relearning of many old skills. I finally got DVD Decrypter working again. I first tried installing it in a guest XP under virtualbox but it doesn’t work very well. It does do ripping but the output is all messed up somehow. On the other hand, installing using wine goes quite well despite my bad experience on wine. The only problem I faced was that decrypter didn’t recognize the drive at the beginning. But this can be easily solved (after some digging in the internet) by setting DVDDecrypter using NT4.0: open winecfg; under application tab, add application…
DVD Decrypter seems to fail for some DVDs but Ripit4me seems to take care of that.
I am still looking for a good tool to transcode MPEG2 video to Divx or Xvid under Ubuntu. I used to use guardian knot in WinXP. I am testing Avidemux right now. It seems doing the job okay.
Add comment October 31, 2008
DNS problem of virtualbox
I wasted a couple hours today trying to figure out why my guest winxp has no connection. It is the third ubuntu machines that I have installed a virtualbox with a guest winxp. I am very satisfied with virtualbox. It is very fast and I can do almost anything I need for a window machine. The only draw back is that I believe it has no native video driver support (so no hardware acceleration) and no support for pnp hardware. But what can I complain—it is free and I can even watch netflix movie online with my guest winxp very smoothly!
Now, back to my problem. I had totally no clue why connection was not working for my newly installed ubuntu. Virtualboxes work fine for both my office PC and my home PC. It took me a while as I was a bit stupid not to check DNS right away. Once I realize there is actually a connection but just dns isn’t working. The solution becomes more obvious. It turns out that the dns server list in my host machine is not totally up-to-date. The first server is not working but it is included anyway. There is no connection problem for ubuntu as it apparently checks for the other server down the list after it figures out the first server doesn’t work. But it seems the guest machine isn’t as smart and it was stuck with the first bad server and didn’t try the rest.
So the fix is very easy. left click connection icon on upper panel of ubuntu, select Manual network configuration…
Under the DNS tab, correct the list of DNS servers (make sure the first one really a working DNS server)
Add comment October 29, 2008
DVD authoring
A friend asked me how to burn his grand daughter’s video to a dvd disk. I have done something like that using windows couple years ago. As I moved to Ubuntu recently, I was annoyed to found it quite complicated. I tried a couple of ways. Eventually my solution is the following:
One major difficulty I faced was that the video file is in mov format. I couldn’t convert to avi or mpeg after several different attempts. I almost got it working using mencoder but it keeps skipping frames. After no much luck doing it “myself”, I just upload the files to “media convert.com“. Yeah, it is much easier that way.
The rest is quite easy. Follows the instructions of this guide,
Create the DVD file structure
dvdauthor -o DVD/ -t file1.mpg
dvdauthor -o DVD/ -t file2.mpg
…
dvdauthor -o DVD/ -T
Create The .ISO File
Type:
mkisofs -dvd-video -v -o DVD.iso DVD
Add comment October 27, 2008
A site collection of “lets”
I found this from when browsing randomly on Nuit Blanche. It has nice collection of links to curvelets, ridgelets, and so on.
Add comment June 22, 2008
Useful Tools
Just found a list of good tools suggested in Nuit Blanche.
The list may be a bit dated but many of the tools are still very useful.
Add comment June 22, 2008
Hong Kong
It almost concludes my short trip back to Hong Kong. Asia is blooming. Nothing can hide this fact. To my surprise, the cost of living in Hong Kong even excluding housing is on par with the US now. Food is no longer cheap. I still have the impression that going out lunch is less expensive than in the US. It still is. Especially given the great competition in the dining industry in HK, but the gap is getting close. I even feel that eventually Hong Kong will become a very expensive city (it already is if I include housing) as Tokyo and London.
Lunch in a local chinese fast food chain cost around 25-40 HK$, it is about 3 to 5 US dollars. But as I grew up here, I find food suit my taste buds much better.
I have chance to chat with a number of friends, both inside and outside academia. My impression is that indeed it is hard to pursue high end technical research in Hong Kong. There are too much easy money flowing around. Honestly, I even don’t think it worths pursuing this path. That is exactly the philosophy behind global trade; emphasizing regional strength rather than weakness and acquiring the insufficient from trading.
Local people here think that HK people lack of imagination. But I think the otherwise. Creative industry can be a path to success. Its past success in movie industry illustrated that. Though it is going way down now. I came across news articles about high school students patented new designs for bottle opener and egg cracker. I think these are some signs supporting my argument.
Pre-university education is getting much better now. I visited my mother middle and high school and I totally envied the students there now. As the principal explained, the students come to school to have fun. It is a very enjoyable experience. They build robot in class, visit museums and beaches, and learn by working on projects. They spend the whole middle school life learning to work on one big project. They do literature survey from online articles, propose ideas, pursue viable one, conclude with short report and presentation. Of course, the bill is not small also. It needs about 50 million HK dollars to run a secondary school per year. That is about 6 million US dollars. The majority of this lump sum goes to the salaries of staffs and teachers. Only about 4 million HK dollars (500K US dollars) is left for other expenses. There are about 1100 students in the school. Therefore, about 6000 US dollars are spent for each student per year. Comparing students from the past, students now are more active and less likely to be satisfied by mere book grinding. But that is exactly the trait of the workforce needed for the years ahead. I am most interested in how to attract students into science and engineering disciplines. It turns out to be very difficult especially in HK. As I said, HK has too much easy money; from stock and derivative trading, private tutoring, and tourism. The best students right now are first attracted to finance and business area. After that, some students go to STEM (science, technology, engineering, math) displines, finally to social science or so. But on average, the local has excellent math skill for daily life. The grinding culture for math is one possible reason. Olympic math for primary kids is very popular. Arithmetic skills are needed for commerce and trading also. All these contribute why HK kids can rank first in math globally. On the other hand, science and engineering is getting much less emphasis.
Housing market is getting incredibly expensive. It is now even above Tokyo and becomes the most expensive place to live in asia. The luxury housing can go up to $5000 US per square feet. It is still way below London. But in a long run, I think it can still go up. Somehow Hong Kong is a very attractive place, both to Chinese and the others. I heard of stories of non-chineses are willing to turn down offer from UCLA and EPFL and teach in HKUST and CUHK. As a result, competition in academia is fierce. However, funding situation is great. I heard that the funding rate for new PI is 100% for physics discipline. However, funding amount is about 1/8 of the US.
Finally, pollution is not as bad as I thought. But it probably is one ultimate factor in detering growth. The city’s wealth is actually very relied on its image and air pollution can be one big negative factor.
Add comment June 11, 2008
