LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-08-2006, 05:32 PM   #1
jcai
Member
 
Registered: Sep 2004
Distribution: Fedora 5
Posts: 48

Rep: Reputation: 15
creating initrd to boot from LVM


i recently created a new lvm logical volume and put my entire root filesystem onto it. I want to boot from it now, but lvmcreate_initrd doesnt seem to exist. Is there another way to create an initial ram disk to boot from Lvm?
 
Old 06-10-2006, 01:38 AM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Boot into rescue mode using either the installation media or the rescue CD, search for and mount the installation. You will need to modify fstab to reflect the new locations in order to get a complete mount. Don’t forget to modify /boot/grub/grub.conf while you are at it.

Then make a new initrd image using mkinitrd. It’s very easy to do. Be sure to make backups of the existing initrd image(s) before you overwrite it/them.

You really only need to make one new image from rescue mode and then boot using that kernel/image. The others can be done after you boot the system using the new initrd image.

Example:
Code:
# cd /boot
# cp initrd-2.6.16-1.2122_FC5.img initrd-2.6.16-1.2122_FC5.img-original
# mkinitrd -f -v /boot/initrd-2.6.16-1.2122_FC5.img 2.6.16-1.2122_FC5
Look through the mkinitrd man page before you boot into rescue mode.

Last edited by WhatsHisName; 06-12-2006 at 02:17 PM. Reason: Fixed an error: “-fv” became “-f -v”
 
Old 06-12-2006, 01:42 PM   #3
jcai
Member
 
Registered: Sep 2004
Distribution: Fedora 5
Posts: 48

Original Poster
Rep: Reputation: 15
it seems like all that does is make a new initrd. What will be the difference between the new one and the old one? it doesnt seem like it knows that it is booting from LVM
 
Old 06-12-2006, 02:04 PM   #4
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Quote:
it seems like all that does is make a new initrd.
Well, gee, that’s the whole point.

Your original initrd image apparently does not contain lvm support, so you need to make an initrd image that does.

When you boot into rescue mode, successfully mount/chroot and make a new initrd image, the new initrd image should contain everything that is need to boot the installation that you have mounted/chrooted.

If it doesn’t, then you need to determine what module(s) is/are missing, load it/them and then add it/them with the appropriate --preload or --with options when you run mkinitrd. Normally, you only need those options when you are making a new initrd image before you modify the setup and want to build in enough new features to allow the new setup to boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating initrd file for diskless nodes syedarifali_13 Linux - Networking 0 05-20-2006 03:06 AM
SuSe 9.3 installation hangs @ 62% creating initrd... CurvKyle Suse/Novell 2 09-14-2005 12:32 PM
I want to install without creating an lvm system eklhad Fedora 1 06-28-2005 10:17 AM
Creating an initrd? raid517 Linux - Software 4 04-04-2005 10:26 AM
Creating custom initrd image in suse 9.1 Anmol Suse/Novell 1 01-08-2005 03:31 AM


All times are GMT -5. The time now is 01:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration