Thursday, December 01, 2005

INIT Issues : More reasons why I love Linux

A couple of days ago, I was playing with the LIVE CD image i've created. It boots properly off the HDD when I vector to it using a basic initrd image. The problem is that once It gets written to a CD, funky stuff begin to happen, all b/cos a CD is a read-only medium.

When I started playing with the LIVE CD creation, I hadn't really taken that into consideration. So I had to scourge the web looking for ideas on how ppl handled that. Why I was scouring, I was trying to take the lazy way out - I went into my /etc/rc.sysinit, and started commenting out lines that would cause a disk write (I just wanted to see a darned login screen... i mean... what's wrong with that? :) )

Anyway, after one of my many chroots into the image, i tried to boot into the image, and realised i'd borked something badly. I then tried to boot back into my system and TADA!!!!! i got:

INIT: "cannot execute /etc/rc.sysinit"

Anyway, to cut out all the dramatics, I had a very unusable system.

Now, lemme qualify, when Linux doesn't boot normally, there are a MYRIAD of ways to boot and access your files, especially when you use GRUB as your bootloader. Anyway, I tried doing a chroot from the original install cd which can serve as a minimal rescue cd, and all the permissions where in place... nothing looked out of the ordinary, still i got the silly message!!!

I did what i normally do with Linux problems, I just let it alone, and for a the last few days, i didn't get to boot linux when i got back home from work (I work on .NET on M$ by day anyways ;) ). Finally I decided to give it one last shot. I sent a message to the archlinux mailing list, asking for an idea on what could be wrong. While waiting for an answer, i hit google, and i came across a nearly similar thread in a RedHat ml and on the Arch forums. Both just confirmed my suspicions, something WAS amiss, in the case of the RedHat guy, the file that INIT was looking for, wasn't physically there... in the case of the ArchLinux guy, the file was there, but permissions were denied, and none of these was my scenario. To make matters worse, I'd been running /etc/rc.sysinit on that partition when accessed from the install cd without issues.

Finally, i decided to take it home. I just used grub to set my init=/bin/bash, once i got the bash prompt, i attempted to run /etc/rc.sysinit, and BOOP!!!, it borked nicely. It couldn't find /bin/sh!!! This was the problem... the intepreter at the shebang was /bin/sh!!! I looked, and it wasn't there... i prolly symlinked it out without knowing when i was doing multiple chroots from the root image :((

Anyway, I had to reboot the kernel in rw mode (other than the default ro mode), and use pacman to reinstall bash, and get back that symlink, and voila... its all good my man!!! All GOOD!!!

The moral lesson? Use a flexible OS, that allows you to know all about it without buying expensive books etc... this was what saved me, and this is Why i LOVE Linux.

with BlinDvws, i would prolly have had to reinstall (at least a repair install of XP :( )

Anyway... Linux R0ckz and so do I :)

Essien out


Post a Comment

<< Home