|
|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
How the.nalle.no was made.Preface. I needed to upgrade nalle.no - the server. nalle.no was a trusty PII 450 with parts I've found here and there, but had done a great job for me so far. Why would I want to upgrade then? Two reasons, mainly: 1. I wanted a RAID 1 mirror, not to loose sleep if one HDD should kill itself. 2. I'm programming PHP and my current project will also need to generate pdf-files, so I wanted a bit faster CPU. Nothing big, really just a simple IDE RAID would be good enough - a Ghz or so processor would suffice. I'd like to up the RAM a little too, going from 256 MB SDRAM, I'd now like 512 MB DRAM. I called my local deliverer, and he said that it wouldn't be easy to get IDE with RAID fuctinallity anymore, since SATA now was becoming so cheap. "Well, so much the better" I thought. Day One. Fetched the computer that was supposed to become the new nalle.no. As I fetched the parts, I remembered that one of the things I really wanted this machine to do was to turn itself on again if there's a power-out, something the old nalle.no was supposed to be able to but wasn't. The guy at the store wasn't sure that the Abit AI7 could do that, but he had another one that he was sure that could. I put in 512 MB DRAM, a 1.7 GHz Celeron processor and two 120 GB SATA disks. Assembled the PC and turned it on. Went straight into BIOS to set up the RAID 1 functionallity - the main reason for me upgrading nalle.no at all. The blasted card doesn't have RAID functionality! Day Two. I made the computer shop change back to the AI7 motherboard again. This time with a 2.8 Celeron processor. The 1.7 -one was not compatible with the main board for some reason. Well I got home and startet setting up the box. Now the SATA chip in this one was an ICH5-R. Not at all well supported by Linux. There was no way I could get the RAID-functionallity up and running, and the chip itself wasn't supported well before kernel 2.6.x. Now, I didn't want to start all over again. Thankfully the Linux kernel supports software RAID, so I decided to go with that. But I still needed kernel 2.6! I could have compiled one into any distro, but I'd rather find one that uses it by default. The reason for that is that most distros modify their kernels to add extra functionallity and driver support. Having to tweak in those things was something I could, but wouldn't do if I didn't have to. I was thinking about that while I was reading the Linux software RAID HOWTO. I'd need that one anyway. Day Three. Now, a friend of mine helps me from time to time. He's a Mandrake fan, really. He told me that Mandrake (MDK) 10.0 Community version came out a couple of days before and that he had a copy. MDK 10.0 runs kernel 2.6.3, he told me. I downloaded the 5 ISO's from a friendly server, and started installing. Since I wanted to boot from the RAID, it wasn't really that simple. I would need to recompile the kernel to add RAID personallity to it. MDK uses RAID functionallity with kernel-modules. To boot from that I would have to use a ramdisk for the modules while booting and that would be a point of potensial errors. I'd like as few of them as possible, thankyouverymuch! THE SETUP OF THE RAID First I installed MDK to one of the disks. Then I recompiled the kernel, adding the RAID functionallity. Then I used the Linux software RAID HOWTO to set up the RAID. Remember I wanted to boot from the RAID? To make that happen I needed to create the RAID on the disk that I was not using yet, and then set the disk I was working from as a degraded disk in the RAID. That would enable me to work from the degraded disk, copying the filesystem onto the RAID disk and then make the RAID boot and run. At last I should upgrade the disk I was setting up from, and then have both disks in a running RAID. Looks simple, doesn't it? Well it wasn't! Creating the RAID and the «work disk» as degraded was a breeze. An extra plus is that Linux software RAID is on partition level, so if I put the two swap partitions outside of the RAID, the Linux kernel would stream to those, hence giving me twice as fast swap (well allmost). The two swap partitions will have to be on two different ports (both Master is fine). You will also have to set priority in /etc/fstab (as shown below), but then you'll get a very fast swap. The downside of this is that you will have to accept that the machine will go down if a harddisk breaks. The streamed swap will become incontinous, since only half of the information is on the disk that's still alive. Then I used "dd" to copy the "degraded" filesystems over to the RAID disks. BIG mistake, as I will soon explain! I moved the RAID disk into a chrooted environment, so I could set up fstab and lilo.conf. Then I ran lilo, and everything looked fine. Time too boot the RAID. I booted; it didn't find any RAID at all. A bit of fiddeling around to get it to boot from the degraded disk again, before I started finding the reason why the kernel didn't see any RAID disks. It turned out that you have to use fdisk and set the disks to "Linux raid autodetect" (or FD in fdisk/cfdisk) before the kernel could see them. I did that and booted. Then I got the answer to why you can't use "dd" to copy the filesystems. Since RAID disks of this kind are virtual disks, they need somwhere to put their virtual information. That space is the same space that the file system journal wants to take. It can't since the RAID information is very well protected, so it will be truncated beyond repear. I know - I've tried - and tried till I finally realized the bitter truth. I went to bed! Day Four. I started by formatting the RAID disk partitions: / as reiserfs /boot as ext3 /var as reiserfs and /home as reiserfs Then I used "cp -faRp ..." to copy the partiton over one by one, mounting and unmounting as I needed to. I could have mounted the disks in the same order and done the whole copying in one command, but I'd rather go the safe route this time. After copying everyting over, altering the RAID disk with fdisk and the rewrite of /etc/fstab and /etc/raidtab I booted. Lo and behold, it actually booted! Now I had done it! Well mostly anyway. I set the degraded disk to "FD" with "fdisk" an rebooted again. Then I removed the "failed-disk" directive from /etc/raidtab. There is a command "raidhotadd" that will add a new disk into the RAID. I ran that on all partitions, and looked into /proc/mdstat to see the disks build themselves happily, one by one. I had a server running RAID! I'd done enough for today. Day Five. Using a community version presented a new problem. Where should I get the updates? A quick (two hours) search on the net gave me the answer to that too. MDK has a "stable" directory in their devel tree just for that use. I set the updating to be fetched from there, and did an update. Then I started copying files from the old nalle.no, setting passwords on whatever needed (as MySQL & such) and testing that everything would work when I put it into production, so to speak. Had a bit problems with getting the https-part working, but that, I found out, was due to wrong IP address. TECNICAL INFORMATION At the end here I'll give you the tecnical info, for those of you that might care:
|
Newsflash!
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|