Wednesday, January 24, 2007

Creating FC5 a rescue disk in USB stick from windows


All of us who love linux have this little pieces of it we do not dare to try, maybe we think we don't need to know how it is done, maybe it just looks too complicated to be bothered, maybe we are rushing to the nice, more exciting parts of our new Linux book and ALWAYS skip this one part. Why.. we will never need it?... WRONG! sooner or later we will need to know that piece of info.

In my particular case we are talking about creating a Rescue/Boot disc for linux (Fedora Core 5).

Why would you ever need to know this? I can think many scenarios. USB are for more portable and withstand more heavy usage than CDs and DVDs, so they are more likely to be ready when disaster strikes. Not all servers/desktops/laptops have CD-ROMs, even less likely they will have DVD-ROM drive. Normally I use a rescueCD+Net install from DVD. It is a fact that the more media is required on an installation, more things you have to go sour. (that LAST 4th CD of Fedora has a tiny scratch... and there goes those 30 mins of your life...).

So let's get to it:
In your distro you will find : \Images\bootdisk.img this contains ALL the necessary files required for the rescue media to be booted. Sadly it is not as easy as coying the file to the USB Drive. But it is not that hard either.

If you are on linux you could just do this:

dd if=diskboot.img of=/dev/sda1

et voilá! but as Mr. Murphy will have it, the server that is down will be for sure the ONLY one with linux and a DVD.

So, in your laptop you have windows installed, and a DVD ROM... (yes you know you have windows there!! admit it!)

Normally, you can read around and they will suggest that you use the rawrite utility, or it nice GUI cousin rawwritewin, but sadly those two
will only write to a Floppy Drive or will complain that they have no info in the sectors of that drive. So we are in trouble. Please stand up, and cheer our saviour:


dd for win which you can find here

Go ahead, download that and extract it to a directory, after that just type:

dd if=D:\diskboot.img of=\\.\E:

where D drive is your DVD-ROM and E: is your USB stick.

And you are ready.

Remember not all BIOS are created equal, be sure to check the boot order and see if USB is available at all. Else just like me you would have just wasted some time creating your own
USB FC5 rescue disk!!

Hope this help!! See ya!












Sunday, January 21, 2007

I deleted zlib in a live environment!

I really don't know what the BIG deal about RHEL is; if anything i have found it to be annoying, HARD to upgrade (rpms are scarce). Definitively CentOS is wiser choice. Try upgrading to PHP 5.2 on RHEL 4! now... just for kicks try the upgrade on a X86_64 platform. I have been going crazy about this. Some good soul posted his experiences on a 686 platform:

http://www.jasonlitka.com/2006/11/30/upgrading-php-520-rhel-centos/


I have being trying to get all the dependencies for X86_64 and it is very very hard. While i was going crazy about getting a succesful spec build:

rpmbuild -bb php.sec

I get many many many dependencies issues (sqlite,mysql-dev,libpng,etc,etc,etc,etc) I bump that it is complaing about a libc flag not being there "-fPIC", I start searching the web for references for this happening to someone else, and i find several places pointing to a solution by simply updating the zlib libraries.


Never I suspected i was about to venture into dark, scary, uncharted territory. So being as naive as i can i write

rpm -e --nodeps zlib(dont remember the full name)


Let the fun begin:
First i notice that wget, ssh, up2date,rpm or mostly anything else for that matter is working anymore, uh oh. Let me say it again: Uh oh.

Funny thing, this is a colocation server. I am i a different Country, i have no access to the server. I call up the people at The Planet, they suggest i get an OS reload. NOT a choice, there is a lot of valuable data there that would take DAYS to restore since i would have to upload everything again. (whole story being that i HAD to build the .rpm there since there is no php 5.2 rpm for RHEL and i dont have access to another server with the same characteristics).




I noticed that ftp is about the only service currently working. So i went to grab zlib at

http://www.zlib.net/

Since gunzip or tar are not working i had to extract the files in some other server and upload the files already extracted.

After that i cross my fingers and write

./configure

Nope, not working so i read further and notice that i should write for my system

./configure --shared --lib=/usr/lib64


I got away with this one easily... scared but no harm done.

I hope this helps someone. I learned that if you get a collocation server... do yourself a favor and get NAS.


Bye!