Saturday, August 30, 2008

"find" performance on windows ntfs vs linux ext3

Just for the heck of it, I ran a find command to look for the same file under the same relative path, in (Cygwin over) Windows and in Linux.  The performance is ~50 times difference. Guess who is faster :) .  Add more to the twist, my Windows machine is a Core 2 Duo @ 2.13 Gig (each, of course), with 2.5GB ram; Linux is running on a Pentium-4 @ 2.8 Gig, single core, 2GB ram.

Cygwin over Windows:
ztang@LV017554 /cygdrive/c/same_folder_tree_node 
$ time find . -name b.bat
./b.bat

real 0m9.290s
user 0m1.483s
sys 0m7.796s


Linux
ztang@ubuntu2:~/projects/same_folder_tree_node$ time find . -name b.bat
./b.bat

real 0m0.196s
user 0m0.056s
sys 0m0.136s

sdl, gpac, dss, and others

I should have roughly about 300 gig HDD to fill for my new toy, Ubuntu 8.04.  The smallest of the 4 HDDs is a 40 gig one, where I store the boot, os, and everything the is dependent on it, so that pretty much means all the software.  Then I should have 250+ gigs for data, should be primarily multimedia.  That should be fun.

For now, I am reloading the all software I used and think that I will be using, ffmpeg, mm codecs, mplayer, vlc, etc.  All were kind of smooth, just time consuming.  Here are couple of hurdles that might be worth documenting.

SDL - when configuring and compiling SDL, it does not care if there is no graphic drivers, or devices available.  Don't get why.  So a successful build of it does not mean much.  I ran vlc or mplayer, all were fine with audio, but video could not find any device.  So I had to go apt-get install a bunch of directfb, gtk stuffs.  Easy enough, just don't get why SDL doesn't crap out at config time.

gpac, except for its MP4Box, I never used anything else of it.  But it seems it has a player, a streamer, along with many other cool stuffs.  It seems that it does not compile with OpenGL.  Could also be something of OpenGL is missing on my machine.  I did not dig into it.  It was not recommended to build with OpenGL anyways, for performance risks, as it said in README.

dss, this is an interesting one.  It does not compile.  Something are apparently missing in header files, conditional compiled linux defs, head inclusion path in makefiles, head includes are even spelt wrong (in upper / lower cases).  It does not even have a readme file to tell you how to compile.  Try at your own risk :) .   Tired and frustrated, at 2 am in the morning, I found a patch file by chance, http://freebsd.ntu.edu.tw/FreeBSD/ports/local-distfiles/nork/dss-6.0.3.patch . No description or anything.  I figure it wont hurt to give a try.  Turned out it was one of the few right things I did in my life.  It took me 2+ hours to bust a quarter of all the problems, but 1.5 seconds to resolved the rest with this patch.  And then the build and install went on a smooth sail.

By now I think the re-setup of my Linux box, upgraded with Ubuntu 8.04 Hardy Heron is pretty done.  It is a pretty distro.  When I plugged my cell phone, a mass storage device was automatically mounted.  

Sunday, August 24, 2008

GRUB Loading, Error 15

Loading Ubuntu is a labor job. Then starting with it, I get this on the boot up screen

GRUB Loading Stage1.5

Grub Loading, please wait...
Error 15

I don't remember when was last time I did not hit a wall the first step out of the door. Anyhow, standard procedure is googling with this error. So I did. Unlike most of the other times, did not find something that was close enough. So I played with it myself, and found something. The root cause was as dumb as it could be, the /boot partition did not have bootable flag set.

I have a total of 4 HDDs in the system, 2 previously loaded with fc6, 2 were from my Sony Vaio. While loading Ubuntu, I did not want to lose any data, so I loaded onto a hw that only had fc6 boot partition. That was a 40GB HDD. I loaded the whole Ubuntu 8.04 system on this single HDD. For some reason, bootable flag was not set, or perhaps was not set correctly. I found 2 other partitions were set with this flag, but not the actualy boot. Changing the flag fixed problem.

Today, a year after I posted the above, I was reading something regarding GRUB, where it mentioned that GRUB stage 1.5 is to load a program that understands file systems, ext2, ext3, or rfs. It is located in the first 30 kilobytes of hard disk immediately following the MBR. So guess my original problem was that this program was loaded, but when it tried to parse the boot flag marked partition, which did NOT have GRUB stage 2 to be found and loaded, it hung.

Grub error 17, cannot mount selected partition

I was not done with grub yet.  After grub loaded, it shows all the bootable options, all 4 of them, Ubuntu 8.04, Ubuntu 8.04 (recovery), memory test, and XP (the HDDs from Vaio).  That was nice to see things going fine, until it came to me the another error after hit the first boot option.

Grub error 17

Cannot mount selected partition

It apparently was trying to start Linux OS.  But I did not have guesses better than this.  Google proved to be my friend this time.  Here is a link to some very nice info.

http://ubuntuforums.org/showthread.php?t=442945#9

Briefly, there is misunderstanding between what hd[0 - 3] are on my system, between Ubuntu and BIOS.  The HDD, that has both boot and root on it, was considered hd0 by BIOS, but Ubuntu's guess was hd3.  So when Ubuntu wrote up the menu.lst for grub to find os image, it put hd3.  Modifying menu.list so thta it points to hd0 fixed problem.

Now I am awaiting for the next blocker.

Overtuure - Never ending problems

Been an engineer for so many year, I am led to believe that we are here not just to fix problems, but to also create problems (so that we can then fix).  If there is a quiet period of time when there is no problems to tackle, it itches. 

Lately I killed my Sony Vaio (that I never quite understood how I did it), so bad that, I think the motherboard is gone.  Buying a new 24" iMac as the consequence of it made this rather a celebrative accident than sorrowful, but the engineer part of me took out the 2 hard drives from Vaio and put in my OTHER box, which is a fc6 Linux.  I had a PCI raid card in it from a coupla years ago, so I can have up to a total of 6 (P)ATA HDDs.  Well, now I have 4.  The fc6 finds the PCI card, but NOT the 2 foreign HDDs.  FC6 is kind of old, and every customization I ever tried to have, I had change a lot of things, and many times rebuild the kernel.  So finally I got fed up with it, and decided to load Ubuntu (better forum support) 8.04.  

OK, this is gonna make me busy for the next few months, I am pretty sure.  Since I did that two sleepless nights ago, I have already experienced quite a few problems.  I never used to do this, but age finally put me to where, I believe some documentation might save time.  Now I got myself a fresh start (newly loaded Ubuntu, well, sort of), I will log the problems I experience.