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). Wherever it is, it brings the boot process to a screeching halt with a kernel panic when it tries to pivot mount the root drive.
Until I get this figured out, my Centos install is dead, and I am back on my old Mandrake install.
Ted Miller
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).
Yep. Fortunately, thats a cpio file. So uncompress, go to tmp make a work dir and "cpio -idmvc -I <your uncompressed file name>". 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).
Then cpio it back up by using the -c param and compress it.
HTH -- Bill
<snip eulogy intro>
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).
Yep. Fortunately, thats a cpio file. So uncompress, go to tmp make a work dir and "cpio -idmvc -I <your uncompressed file name>".
I tried this, but I get the message: [root@Office2 /home/tmiller/tmp/centos01]$cpio -idmvc -F /media/centos/boot/initrd-2.6.9-34.EL.img cpio: premature end of file
No files show up in the directory. Any ideas appreciated. Doing this in Mandrake 2006.0.
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).
Then cpio it back up by using the -c param and compress it.
Bill
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.
# 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
work dir and "cpio -idmvc -I <your uncompressed file name>".
I tried this, but I get the message: [root@Office2 /home/tmiller/tmp/centos01]$cpio -idmvc -F /media/centos/boot/initrd-2.6.9-34.EL.img cpio: premature end of file
No files show up in the directory. Any ideas appreciated. Doing this in Mandrake 2006.0.
Replace the "t" with "d" in either of the "itmcv" below and it will extract instead of giving a TOC.
# gzip -dc </boot/initrd-2.6.9-34.EL.img | cpio -itmvc|head -10 4166 blocks drwx------ 10 root root 0 Aug 28 19:07 . drwxr-xr-x 2 root root 0 Aug 28 19:07 sys drwxr-xr-x 2 root root 0 Aug 28 19:07 sysroot drwxr-xr-x 2 root root 0 Aug 28 19:07 dev crw-r--r-- 1 root root 4, 0 Aug 28 19:07 dev/systty crw-r--r-- 1 root root 4, 1 Aug 28 19:07 dev/tty1 brw-r--r-- 1 root root 1, 1 Aug 28 19:07 dev/ram crw-r--r-- 1 root root 4, 3 Aug 28 19:07 dev/tty3 crw-r--r-- 1 root root 1, 3 Aug 28 19:07 dev/null crw-r--r-- 1 root root 4, 4 Aug 28 19:07 dev/tty4
# gzip -dc </boot/initrd-2.6.9-34.EL.img >/tmp/test # cpio -itmvc -I /tmp/test|head -10 4166 blocks drwx------ 10 root root 0 Aug 28 19:07 . drwxr-xr-x 2 root root 0 Aug 28 19:07 sys drwxr-xr-x 2 root root 0 Aug 28 19:07 sysroot drwxr-xr-x 2 root root 0 Aug 28 19:07 dev crw-r--r-- 1 root root 4, 0 Aug 28 19:07 dev/systty crw-r--r-- 1 root root 4, 1 Aug 28 19:07 dev/tty1 brw-r--r-- 1 root root 1, 1 Aug 28 19:07 dev/ram crw-r--r-- 1 root root 4, 3 Aug 28 19:07 dev/tty3 crw-r--r-- 1 root root 1, 3 Aug 28 19:07 dev/null crw-r--r-- 1 root root 4, 4 Aug 28 19:07 dev/tty4
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).
Then cpio it back up by using the -c param and compress it.
Bill
<snip sig stuff>
HTH -- Bill
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
On Thu, 2006-09-21 at 23:17 -0400, Ted Miller wrote:
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, <snip>
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
This probably means you were not in the right directory level after you did "cd xxxx". Maybe too "high" or "low" in the tree. To see where you should have been, do the uncompress thing on one of the original CentOS installed archives and pipe output to cpio using -itc (add a v if more info is desired).
BTW, the "cpio -oc" can also have a "v" so you can see what it processes. I think you might want to do some of this again for the "entertainment value"! ';-)
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,
It used to be "--best". I *think* I recall seeing that a "-9" also did that (bzip2 for sure, not sure about gzip - my man pages for it have grown yellowed by age and disuse). Hmm... maybe it was "--best" added to bzip2. Regardless...
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.
Sorry it didn't work out. I have an LVM-based backup routine in the final throes of completion (will actually get completed if the fallback to the -34 kernel solves my 36 carefully tracked OOPS/panic that came with the -42 kernel. I'll bugzilla it and be done with it and have time to work on other things again). Naturally I had to ensure a decent recovery process before developing the backup process. This exact technique has saved my buns several times and is, in fact, an integral part of being able to "instantly recover" by booting another HD when primary HD has died or boot got lost or whatnot.
Ted Miller
<snip sig stuff>
-- Bill
On Fri, 2006-09-22 at 08:40 -0400, William L. Maltby wrote:
On Thu, 2006-09-21 at 23:17 -0400, Ted Miller wrote:
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:
<snip>
This probably means you were not in the right directory level after you did "cd xxxx". Maybe too "high" or "low" in the tree. To see where you should have been, do the uncompress thing on one of the original CentOS installed archives and pipe output to cpio using -itc (add a v if more info is desired).
OOPS! Another possibility is the form of the find? I'm not sure it would have an effect, but since I'm not *that* intimate with the booting details (its screwed me a lot, but I've not been able to screw it ;-)..
"find ." is not the same as "find *" or find {x,y,z}
When the archive is extracted, relative path vs. absolute path considerations may come into play.
When you do the extract with the "cpio -ict", if the patches begin with "./", then "find ." is good. If they do not have a leading ".", that may be the problem.
<snip>
-- Bill