| Site Index |
 |
|
|
|
 |
| Linux Journal |
|
| by bpopp
on Wednesday, February 04, 2004 - 03:02 PM |
| |
| Tech |
|
|
I've found myself growing more and more obsessed with Linux over the last few months. I've always been a fan, but here lately I've just really submerged myself in it and have learned so much that I took for granted before. I'm going to use this thread to document my progress until I can get an official journal section opened up. My only regret is that I didn't start doing this years ago because I am constantly finding myself at a loss for a particularly useful command or trick I used to know.
|
|
| Comments |
 |
|
|
 |
Page
1 of 3, 27 items total.
(look for morebar™ improvements soon!) |
|
| bpopp
|
Wednesday, February 04, 2004 04:13 PM |
|
Steph's getting tired of trying to get time on my PC so I told her I'd build her one. I have most of the parts, but I needed a CPU (to replace the one I burned up). Monday I ordered a new CPU (AMD 2500 Barton), a new motherboard (A7N8X-E DELUXE) and 512MB of DDR 3200 Corsair XMS memory. The plan is that I'm going to put the AMD 2200 that I'm using now in my linux server, give her the slower AMD that's in it, and then upgrade my main PC with the overclocked 2500(which is used mostly for gaming/game development now). From what I've read, the 2500 is really easy to overclock and many people have gotten 3200 speeds out of them (which is impressive since they only cost about $90). She plays mostly Tetris type stuff, so the older AMD running in the server should be plenty fast for her.
I'm currently running RedHat 9. I've used that distribution from the very beginning and it's served me well. Here lately, though, they really seem to be floundering. They've pawned off their home market to some open-source project which they aren't actively supporting (Fedora), they no longer offer free online updates (without incessant nagging), and their versions seem to be falling farther and farther behind the releases. Currently I'm using apt-get (which is awesome) to get around some of these limitations, but I really think I'm ready to take off the training wheels.
So what does that mean? I wasn't sure. I don't want to give up the convenience of packages. It's nice to have autoupdates of key components of the operating system so that you aren't constantly chasing bug fixes, but at the same time, I don't want a distribution that obfuscates things in unsual ways in order to cater to the mom & pop users.
I think I may have found the perfect distribution. I happened across an article today on Gentoo. I've heard the name more and more here lately, but wasn't sure exactly what it was. Gentoo is a distrubution which focuses on performance and choice. With Redhat (and most distributions) packages are generically built to support a particular processor. This works ok, but you sacrifice a lot of processing power in order to get compatibility. You could take a package compiled on an AMD and move it to a Pentium 4 and get the exact same degraded performance. By compiling your binaries with processor specific flags, however, you can build a binary which takes full advantage of your hardware. From what I've read, a Gentoo built system can be almost 50% faster on some high-end hardware (like the Athlon XP I'll be using). That rocks. Plus, it gives you full control over what gets put where. No more disparity between whether to use /usr/bin/ or /usr/local/bin/ or /bin/. I'm planning to do the upgrade this weekend which means this site will be down for maybe a day or two (hopefully not forever ). If that seems like a long time for an upgrade, keep in mind that compiling an entire distribution can take a very long time. KDE took a day and a half by itself.
|
|
|
| bpopp
|
Sunday, February 08, 2004 01:42 AM |
|
Waiting and Waiting
I stayed up till 7 AM Saturday morning putting all the PCs back together. It would have been a lot faster except that I had to move files around in order to get the hard drives in the best locations. I wanted a majority of my space to be on my linux server. I also spent a good 2 or 3 hours tweaking cpu settings in the bios. The Barton 2500 I have runs at about 1800Mhz normally, but by tweaking the front-side bus I'm able to get an extra 400 Mhz (2200Mhz). So far heat's not a problem (41 degrees) so I may push it a little more and see what it will do. I was really surprised, but there was a noticeable difference between the default speed and the overclock.
Next I started building Gentoo. I downloaded the two Live ISO CD's off their site for the Athlon XP. I booted off the first one and began the installation process. There's a lot to it but it's all pretty simple stuff and the documentation is excellent. It helped that I had some experience with linux. Someone brand new to linux would probably have found it a little intimidating, but most people wcould probably get through it ok.
There's three or four ways you can do the installationn. Technically I really only needed the first CD because after setting up the partitions and filesystems, I did the rest of the installation across the network using Portage. Portage is the foundation of Gentoo and everything I read about it said it was awesome. My limited experience supports that so far. It's basically a package manager that compiles all the packages. This supposedly offers a significant performance boost because you can tweak compiler settings with each installation. Instead of getting a generic kernel with a bunch of crap you really don't need installed (100 ethernet cards, for example), you get a tight, clean system tailored exactly to your hardware.
The downside, is that this can take quite a while (compared to using binaries) and you have to be careful which optimizations you take advantage. Some can negatively effect performance/options. I'm having a hard time getting my ethernet card compiled into my kernel, but hopefully I'll get that worked out here in the next few hours.
I haven't spent much time with my new system yet, but so far, Gentoo is exactly what I was looking for. The best thing about it, so far, has been that it's really helped me to understand how a linux installation works. I've learned much more about what is installed and where (and why). More later.
|
|
|
| bpopp
|
Sunday, February 08, 2004 02:52 AM |
|
Comm Up
Well, I finally got the ethernet card working. I had to find a source file for my ethernet card, move it into the kernel source directory, and then recompile the kernel adding the driver as a module. Once I did that, I was able to activate it at startup. That's one of those things that would really have tripped up someone that was unfamiliar with linux (had me stumped for an hour or so and I've been using linux for years).
I can remember taking a linux class in college and hearing the teacher talking about recompiling his kernel. I always thought he was some linux God but it's actually much easier than I expected. You basically just run 'make menuconfig' and then drill down throught he god-awful list of options activating what you need (the hardest part). After that you do a make deps and hope for the best. Once it finishes, you copy the binary kernel to your boot directory. Update your boot loader (grub), and reboot.
Right now I'm compiling XFree (the graphics system). It's a huge package and is taking forever. KDE is going to be even worse. The real make or break for Gentoo is going to be how much faster a compiled linux is vs. the packaged binary distribution I was using. I like the streamlined aspect of it, but that's less of a consideration than performance considering what you have to give up (speed of installation and simplicity of package installation/uninstall)
|
|
|
| bpopp
|
Tuesday, February 10, 2004 12:31 AM |
|
Finally
I won't lie. Gentoo has been somewhat of a beast to get setup. Compiling everything from scratch is a very slow process. When you make a mistake, you really feel it, too, because then you have to go back and recompile, etc. I've probably recompiled and reinstalled my kernel at least 15 times. I have to agree with the gentoo advocates, though, Portage is awesome. Installing KDE3.2 was as easy as 'emerge kde'. It figured out all my dependencies, configured, compiled, and installed each one, and then logged the install. Later, to update all my installation, I can just do a 'emerge world'. Very cool and so far it has worked very well. I have run into a few dependency issues, but most have been fixable by unmerging and r'emerging a few packages.
Late late last night I finally... FINALLY, got KDE installed. Actually, it probably would have been pretty easy if I had gone the binary package/kernel route, but I wanted to basically do everything from scratch. I wanted to know exactly what was installed where and why. I've learned more this weekend about linux than I have in a long time, but it's been full of frustrating challenges (which I personally enjoy).
Unfortunately, once I booted into KDE I was a little disappointed. It seemed slow. In fact, it seemed very slow. It seemed slower than the RedHat system I was running before I upgraded my hardware. Somewhat dismayed, I began to start trying to get stuff setup. First I loaded Samba and started moving over some data into my home directory across the network. The files were going VERY slow and my linux desktop ground to a halt. I could barely open and close windows. I ran a bandwidth performance utility and discovered that my transfer speeds were horrible (200-300kpbs). I did a little more research this morning and came to the (wrong) conclusion that something was either wrong with my network card, or maybe with my network card's driver. As I was preparing to buy another ethernet card, I happened across a utility called hdparm which tests your HD's performance.
Turns out, that was my problem all along. When I compiled my kernel, I hadn't included the module for my motherboards IDE chipset (VIA). This was causing my hard drive to prevent DMA from working and was pegging out at about 2MB/S (which falls well below even a slow network). After rebuilding the kernel with the appropriate settings, my HD is now getting about 50MB/S and rice absolutely SCREAMS. It's really quite impressive. I'm definitely a gentoo convert.
Of course, I'm also using the newest KDE 3.2 now which helps, too. KDE has come so far in such a short period of time. It's really amazing. It's already beyond Microsoft in a lot of ways. Open-source is such a powerful concept and it really goes to show that two (or two-thousand) minds are better than one (provided you can get over the organizational obstacles). I think it's really going to do even better now that we have such an amazing IDE (KDevelop).
|
|
|
| bpopp
|
Tuesday, February 10, 2004 05:06 PM |
|
Input/Output and Piping
Here's something I've wanted to do for a while but have never known how to do it correctly. In the past I've used the command 'nohup', but it's not very flexible so I finally took the time to learn a little about IO pipes.
When a process runs in linux, it has several sources of input and output that it can use. The three most common are stdin, stdout, and stderr. STDIN (0) is typically used for receiving information, STDERR (1)is typically used for reporting errors, and STDOUT (2) is typically used for displaying information back to the console. These are called pipes because they can be used to transfer data to and from other processes. Sometimes, however, you don\'t want to see this information. For some reason, the SSH running on my linux box is killing my SSH client whenever it sends large blocks of data. I suspect that this is a faulty ethernet card since it happened while I was running RedHat also. In order to get around this problem temporarily, I am telling programs to run quietly in the background using the following command:
emerge sync 2>/dev/null 1>&2l
This is telling the command 'emerge sync' to send stderr using the '2>' argument to stdout (1). The next argument passes stdout '1>' to /dev/null (which is synonymous with the trash). So basically it's like saying stderr, you follow stdout and stdout, you go quietly to the trash.
|
|
|
|
|
|
| bpopp
|
Saturday, February 14, 2004 03:25 AM |
|
I've spent a few days now getting aquainted with Gentoo. One thing I've noticed now that I have it pretty much back to the way it was is that it's MUCH more efficient with memory. I expected as much, but not really to this extent.
I had about 400 MB's in the old box and while using pan and kdevelop and a few other memory intensive apps, the system would start crawling and memory utilization would totter around 95%. With Gentoo, I have more stuff open and my memory hasn't gone over 190MB.
I guess the reason for this is that each layer (Kernel, X, fwm, KDE, etc.) I was building my system on in RedHat had every conceivable library compiled into the binaries to account for every contingency. With Gentoo, you tell it which systems you'll be using in a make file ahead of time and the package manager only adds those (plus any mandatory depedencies). Huge difference!
|
|
|
| bpopp
|
Thursday, May 13, 2004 11:50 PM |
|
I've seen lots of people talking about 'rsync' in the past, but unfortunately never took the time to learn how to use it. I even unknowingly wrote a pretty complicated PHP script to do almost EXACTLY what it does. Sigh. Basically it allows you to copy files and folders recursively from one place to another. The thing that makes this so much cooler than the 'cp' command is that it can pull stuff across an ssh login. It also looks at modification dates to determine what to copy so it can be much faster than a straight copy. Another nice feature I use is that you can add exceptions so that certain files won't get copied. I use it like this to push/pull stuff back and forth from work:
rsync -av --exclude=globals.php --delete bpopp@server.somewhere.com:/var/www/folder/ .
This logs into server.somewhere.com using ssh (after prompting for a password) and downloads the folder 'folder' into the current directory. The exclude parameter tells it to overlook any files named 'globals.php' (which I use to store server specific information). The delete parameter tells rsync to delete any local files or folders which aren't on the server (I'm guessing this could be dangerous).
|
|
|
| bpopp
|
Wednesday, June 16, 2004 10:32 AM |
|
This is not totally linux related, but I'm loving Firefox 0.9. Charmel is the coolest theme I've seen for a browser yet and I've found some really cool extensions. I'm using the web developer extension that gives you some pretty cool features. It lets you resize the window to common relolution sizes, view DOM models of your page, Turn images/cookies/java/javascript/etc off with a click. IE is dead.
|
|
|
| von
|
Thursday, June 17, 2004 06:13 PM |
|
Well, Firefox .9 is still running quite well at work after about 3 days. Here at home, however, on the XP machine, it just decided to crap out with a fatal error. Even when I reinstall, it still creates a fatal error when I try to run it. It's running great on the Linux box, and the win2k box though...
|
|
|
| bpopp
|
Thursday, June 17, 2004 11:28 PM |
|
They really emphasize that the old version needs to be removed before the new one can be added back. Hopefully that's something they get away from later (since it's a pain rebuilding prefs), but it might be worth it to uninstall, delete all prefs, verify that the Program Files directory is gone, and then reinstall (if you haven't already).
|
|
|
| von
|
Wednesday, June 30, 2004 10:10 AM |
|
Gentoo: It really isn't for the lazy. I too have learned tons of things I never knew before. I've installed it like ten times in the last 5 or 6 days. (I'm getting pretty good at it). Only like 2 of those installs were actually successful. The problem is that I keep doing stuff that I wish I hadn't done when it's over with. Like I emerged apache, but I just realized that I didn't include mod_php. I'm not sure if that's what I really want to do anyway, because I want to make sure I can make use of the template stuff like PEAR. (hence, the reason for the install in the first place.). I haven't exactly figured out how to "un merge" (for lack of a better word) apache, and start over. so, I may just do the whole install over. I'm using the Stage3 install though, so It's not as bad as what you are probably doing.
|
|
|
 |
Page
1 of 3, 27 items total.
(look for morebar™ improvements soon!) |
|
|
|