[CentOS] Lost path to root directory!

Ted Miller tmiller at broadcast.net
Fri Sep 22 03:17:48 UTC 2006


William L. Maltby wrote:
> On Sun, 2006-09-17 at 22:22 -0400, Ted Miller wrote: 
>>William L. Maltby wrote:
>>>On Sun, 2006-09-17 at 09:27 -0400, Ted Miller wrote:
>>>
>>>>I'll admit I am new to LVM2, but I have got myself in a bad spot.
>>>>
>>>>I renamed the LVM volume and volume group so that I can keep track of what
>>>>is in them.  I have changed grub's menu.lst, /etc/fstab, and /etc/mtab, but
>>>>somewhere else there is still something telling lvm that my root drive is
>>>>on VolGroup00.  Where is it, and how do I convince it that
>>>>VolGroup00/Volume00 (or whatever the defaults are) is now DriveC/Centos?  I
>>>>suspect it may be hiding in initrd (compressed).
> 
>                                         ^^^^^^^^^^
> I didn't repeat this since you spotted it already.
> 
> 
>>>Yep. Fortunately, thats a cpio file. So uncompress, go to tmp make a
> 
>                                             ^^^^^^^^^^
>
> Did you remember to do the above? Based on your file name I suspect not.

No, I read too fast, and thought cpio would take care of the compression
too.  I
should have known better.

> # file /boot/initrd*
> /boot/initrd-2.6.9-34.EL.img:     gzip compressed data, from Unix, max
> compression
> /boot/initrd-2.6.9-42.0.2.EL.img: gzip compressed data, from Unix, max
> compression
> 
> My use of the -I (your -F) presumed that you did something like
> 
>     gzip -dc <your-compressed-image >a-temp-file
> 
> but you could just as easily gzip -dc <image | cpio -idmvc # No -I/-F

That worked for me this time.

>>Ted Miller
>>
>>>Then cd
>>>into the dir and find . -name init. Edit that file. There's two
>>>"ingnorelockingfailure" imperatives in there. One of them names the
>>>volgroup. Add yours to the list (comma, IIRC - use the man page if there
>>>is one).

Got that done right (I think, see below)

>>>Then cpio it back up by using the -c param and compress it.

I tried to do this:
find . -print -depth | cpio -oc | gzip >
/media/centos/boot/initrd-2.6.9-34.EL.img

I got a file that looks the same as the original initrd (size, permissions,
etc) but when I go to reboot, I get a message saying it can't find the init
file >> kernel panic

I also get this:
file ini*
initrd-2.6.9-EL.img:          gzip compressed data, from Unix
initrd-2.6.9-EL.img.orig.TCM: gzip compressed data, from Unix, max compression

obviously mine isn't quite the same as the original.  I assume that it is
probably some command line switch on the gzip command that makes the
difference, but the info page is not at all clear about what I have to do
to match the original.  One web page showed using gzip without any
parameters, so I tried that, using this command line:
find . -print -depth | cpio -ov > tree.cpio|gzip>initrd-2.6.9-EL.img

After several more tries, without success, trying to get the boot process 
to recognize and use my altered rdinit file, I finally gave up and did an 
"upgrade" from CD.  It trashed some things, but it did restore the install 
so that it would boot.  I should have unchecked all packages when it asked 
what I wanted installed.  That would have trashed less stuff.

Ted Miller



More information about the CentOS mailing list